sveltekit-ui 1.0.8 → 1.0.9

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 (33) hide show
  1. package/dist/Components/TextInput/index.svelte.js +1 -0
  2. package/dist/client/types/index.js +78 -2238
  3. package/package.json +11 -8
  4. package/src/app.html +1 -0
  5. package/src/lib/Components/TextInput/index.svelte.js +1 -0
  6. package/src/lib/client/types/index.js +78 -2238
  7. package/src/routes/[component]/+page.svelte +3 -3
  8. package/svelte.config.js +1 -1
  9. package/dist/Components/FunctionInput/Node/helpers/DefinedTargetInput/index.svelte +0 -110
  10. package/dist/Components/FunctionInput/Node/helpers/Field/index.svelte +0 -109
  11. package/dist/Components/FunctionInput/Node/helpers/Field/index.svelte.js +0 -207
  12. package/dist/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte +0 -97
  13. package/dist/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte.js +0 -105
  14. package/dist/Components/FunctionInput/Node/helpers/ObjectInput/index.svelte +0 -198
  15. package/dist/Components/FunctionInput/Node/helpers/StackArea/index.svelte +0 -169
  16. package/dist/Components/FunctionInput/Node/helpers/StackArea/index.svelte.js +0 -152
  17. package/dist/Components/FunctionInput/Node/index.svelte +0 -144
  18. package/dist/Components/FunctionInput/Node/index.svelte.js +0 -134
  19. package/dist/Components/FunctionInput/index.svelte +0 -356
  20. package/dist/Components/FunctionInput/index.svelte.js +0 -1215
  21. package/src/lib/Components/FunctionInput/Node/helpers/DefinedTargetInput/index.svelte +0 -110
  22. package/src/lib/Components/FunctionInput/Node/helpers/Field/index.svelte +0 -109
  23. package/src/lib/Components/FunctionInput/Node/helpers/Field/index.svelte.js +0 -207
  24. package/src/lib/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte +0 -97
  25. package/src/lib/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte.js +0 -105
  26. package/src/lib/Components/FunctionInput/Node/helpers/ObjectInput/index.svelte +0 -198
  27. package/src/lib/Components/FunctionInput/Node/helpers/StackArea/index.svelte +0 -169
  28. package/src/lib/Components/FunctionInput/Node/helpers/StackArea/index.svelte.js +0 -152
  29. package/src/lib/Components/FunctionInput/Node/index.svelte +0 -144
  30. package/src/lib/Components/FunctionInput/Node/index.svelte.js +0 -134
  31. package/src/lib/Components/FunctionInput/index.svelte +0 -356
  32. package/src/lib/Components/FunctionInput/index.svelte.js +0 -1215
  33. package/src/routes/[component]/Showcase/FunctionInput/index.svelte +0 -77
@@ -72,86 +72,6 @@ export const acceptable_storage_mime_types = [
72
72
  "text/markdown",
73
73
  ]
74
74
 
75
- export const node_categories = {
76
- main: {
77
- h: 7,
78
- display_order: 1,
79
- },
80
- variables: {
81
- h: 9,
82
- display_order: 2,
83
- },
84
- actions: {
85
- h: 12,
86
- display_order: 3,
87
- },
88
- math: {
89
- h: 15,
90
- display_order: 4,
91
- },
92
- compare: {
93
- h: 18,
94
- display_order: 5,
95
- },
96
- arrays: {
97
- h: 20,
98
- display_order: 6,
99
- },
100
- triggers: {
101
- h: 22,
102
- display_order: 7,
103
- },
104
- }
105
-
106
- // triggers:
107
- // cron
108
- // link_visited / qr_code_scanned
109
- // signed_up_to_contibase
110
- // subscribed_to_email_list
111
- // unsubscribed_from_email_list
112
- // submits_form
113
- // opens_email
114
- // clicks_link_in_email
115
- // votes_in_poll
116
- // replies_to_email
117
- // date_has_passed
118
- // makes_a_purchase
119
- // abandons_cart
120
- // qualified_score_changes
121
- // value_score
122
- // subscription_payment_failed
123
- // views_post_on_contibase
124
- // upgraded
125
- // downgraded
126
- // email was sent,received,opened,clicked
127
- // days_without_opens
128
- // days_without_clicks
129
- // days_without_opens_change
130
- // referred_users_change
131
- // subscription_tier_change
132
- // twitter_verified
133
- // twitter_followers
134
- // instagram_verified
135
- // instagram_followers
136
- // discord_verified
137
- // webhook_endpoint_called
138
- // manual_call
139
- // user_poll_amounts
140
- // user_poll_correct within last 30 days
141
- // user_poll_amounts
142
- // user_poll_correct_percentage of last 30 days or of last 10 polls
143
-
144
- // get_current_date
145
- // ask_chat_ai
146
- // set_custom_field_on_subscriber
147
- // set_subscriber_tier
148
- // send_email
149
- // rate_limiter
150
-
151
- // image_literal
152
- // audio_literal
153
- // get_typeof
154
-
155
75
  const array_literal = {
156
76
  kind: "literal",
157
77
  category: "variables",
@@ -520,2154 +440,102 @@ const location_literal = {
520
440
  country_code: { type: "string" },
521
441
  administrative_area: { type: "string" },
522
442
  administrative_area_code: { type: "string" },
523
- locality: { type: "string" },
524
- sub_locality: { type: "string" },
525
- full_thoroughfare: { type: "string" },
526
- },
527
- required: ["latitude", "longitude", "name"],
528
- additionalProperties: false,
529
- },
530
- validator: (input) => {
531
- // validate here
532
- },
533
- }
534
- const cron_literal = {
535
- kind: "literal",
536
- category: "variables",
537
- name: "Cron",
538
- postgres_type: "jsonb",
539
- json_schema: {
540
- type: "object",
541
- properties: {
542
- content: { type: "string" },
543
- cron: { type: "string" },
544
- minute: { type: "string" },
545
- hour: { type: "string" },
546
- day_of_month: { type: "string" },
547
- month: { type: "string" },
548
- day_of_week: { type: "string" },
549
- },
550
- additionalProperties: false,
551
- required: [],
552
- },
553
- validator: (input) => {
554
- // validate here
555
- },
556
- }
557
- const variable_path_literal = {
558
- kind: "literal",
559
- category: "variables",
560
- name: "Variable Path",
561
- postgres_type: "jsonb",
562
- json_schema: {
563
- type: "array",
564
- description: "The path to the value within variables.",
565
- items: {
566
- anyOf: [
567
- {
568
- type: "string",
569
- },
570
- {
571
- type: "number",
572
- },
573
- {
574
- type: "array",
575
- items: {
576
- anyOf: [
577
- {
578
- type: "string",
579
- },
580
- {
581
- type: "number",
582
- },
583
- ],
584
- },
585
- },
586
- ],
587
- },
588
- },
589
- validator: (input) => {
590
- // validate here
591
- },
592
- }
593
- const content_literal = {
594
- kind: "literal",
595
- category: "variables",
596
- name: "Content",
597
- postgres_type: "jsonb",
598
- // json_schema: get_content_node_json_schema("content_literal"),
599
- validator: (input) => {
600
- // validate here
601
- },
602
- }
603
- const table_id_for_foreign_row_literal = {
604
- kind: "literal",
605
- category: "variables",
606
- name: "Table ID for Foreign Row",
607
- postgres_type: "text",
608
- // json_schema: get_content_node_json_schema("content_literal"),
609
- validator: (input) => {
610
- // validate here
611
- },
612
- }
613
- // image_literal
614
- // audio_literal
615
- // file_literal
616
- // dropdown_literal
617
- // text_array_literal
618
- // function_literal
619
-
620
- const node_json_schema = {}
621
- const all_node_types = [
622
- "defined_target_literal",
623
- "stack_literal",
624
- "function_literal",
625
- "define",
626
- "set_defined",
627
- "get_defined",
628
- "run_defined",
629
- "if_then",
630
- "if_then_else",
631
- "for_loop",
632
- "return",
633
- "dropdown_literal",
634
- "log",
635
- "truthy_compare",
636
- "arithmetic_binary_operation",
637
- "round",
638
- "parse",
639
- "add_item_to_array",
640
- "add_item_to_array_at_index",
641
- "remove_item_from_array",
642
- "remove_item_from_array_at_index",
643
- "split_text",
644
- "concat_arrays",
645
- "sort_array",
646
- "local_compare",
647
- "slice",
648
- "join_array_of_text_items",
649
- "reverse_array",
650
- "average_of_number_array",
651
- "sum_of_number_array",
652
- "trim_text",
653
- "replace_text",
654
- "compare_numbers",
655
- "compare_text",
656
- "get_length",
657
- "object_expression",
658
- "call_endpoint",
659
- "cron_job",
660
- ]
661
- const value_node_types = [
662
- "array_literal",
663
- "array_uniform_literal",
664
- "object_literal",
665
- "object_uniform_literal",
666
- "text_literal",
667
- "boolean_literal",
668
- "int_literal",
669
- "bigint_literal",
670
- "null_literal",
671
- "epoch_literal",
672
- "float_literal",
673
- "color_literal",
674
- "domain_literal",
675
- "email_address_literal",
676
- "email_address_full_literal",
677
- "email_attachment_literal",
678
- "json_literal",
679
- "storage_item_literal",
680
- "html_literal",
681
- "phone_literal",
682
- "vector_literal",
683
- "icon_literal",
684
- "time_literal",
685
- "time_zone_literal",
686
- "location_literal",
687
- "cron_literal",
688
- "variable_path_literal",
689
- "content_literal",
690
- "table_id_for_foreign_row_literal",
691
- ]
692
-
693
- export const function_types = {
694
- defined_target_literal: {
695
- kind: "literal",
696
- category: "variables",
697
- name: "Defined Target Literal",
698
- value: {
699
- identifier: null,
700
- property_path: [],
701
- },
702
- node_structure: [[{ ui_type: "input", value: "defined_target_literal" }]],
703
- postgres_type: "jsonb",
704
- json_schema: {
705
- type: "object",
706
- properties: {
707
- identifier: {
708
- type: "string",
709
- },
710
- property_path: {
711
- type: "array",
712
- minItems: 1,
713
- maxItems: 50,
714
- items: {
715
- anyOf: [
716
- {
717
- type: "string",
718
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
719
- },
720
- {
721
- type: "number",
722
- },
723
- ],
724
- },
725
- },
726
- },
727
- },
728
- validator: (input) => {
729
- // validate here, made up of identifier_literal values
730
- },
731
- },
732
-
733
- stack_literal: {
734
- kind: "literal",
735
- category: "hidden",
736
- name: "Stack Literal",
737
- child_node_options: [
738
- "define",
739
- "set_defined",
740
- "run_defined",
741
- "instantiate_function",
742
- "if_then",
743
- "if_then_else",
744
- "for_loop",
745
- "return",
746
- "log",
747
- "call_endpoint",
748
- "cron_job",
749
- ],
750
- postgres_type: "jsonb",
751
- json_schema: {
752
- type: "array",
753
- items: {
754
- type: "object",
755
- properties: {
756
- type: {
757
- type: "string",
758
- },
759
- value: {
760
- type: "any",
761
- },
762
- },
763
- },
764
- },
765
- validator: (input) => {
766
- // validate here
767
- },
768
- },
769
-
770
- function_literal: {
771
- kind: "literal",
772
- category: "main",
773
- name: "Function Literal",
774
- fields: {
775
- parameters: {
776
- node_options: ["parameters_literal"],
777
- forced_node: "parameters_literal",
778
- },
779
- is_do_collapsed: {
780
- node_options: ["arrow_toggle_literal", "checkbox_literal"],
781
- forced_node: "arrow_toggle_literal",
782
- },
783
- do: {
784
- node_options: ["stack_literal"],
785
- forced_node: "stack_literal",
786
- },
787
- },
788
- node_structure: [
789
- [
790
- { ui_type: "field", field: "is_do_collapsed" },
791
- { ui_type: "text", value: "function with parameters" },
792
- { ui_type: "field", field: "parameters" },
793
- ],
794
- { ui_type: "stack", field: "do" },
795
- ],
796
- postgres_type: "jsonb",
797
- json_schema: {
798
- type: "object",
799
- default: { parameters: [], is_do_collapsed: false, do: [] },
800
- properties: {
801
- parameters: {
802
- type: "array",
803
- items: {
804
- type: "object",
805
- default: { identifier: null, type: null },
806
- properties: {
807
- identifier: {
808
- type: "string",
809
- minLength: 1,
810
- maxLength: 50,
811
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
812
- },
813
- type: {
814
- type: "string",
815
- enum: all_node_types,
816
- },
817
- },
818
- },
819
- },
820
- is_do_collapsed: {
821
- type: "boolean",
822
- },
823
- do: {
824
- type: "array",
825
- items: node_json_schema,
826
- },
827
- },
828
- required: ["do"],
829
- },
830
- validator: (input) => {
831
- // validate here
832
- },
833
- },
834
-
835
- define: {
836
- kind: "definition",
837
- category: "variables",
838
- name: "Define",
839
- fields: {
840
- identifier: {
841
- node_options: ["identifier_literal", "get_defined"],
842
- forced_node: "identifier_literal",
843
- },
844
- value: {
845
- node_options: all_node_types,
846
- },
847
- },
848
- postgres_type: "jsonb",
849
- node_structure: [
850
- [
851
- { ui_type: "field", field: "identifier" },
852
- { ui_type: "text", value: "=" },
853
- { ui_type: "field", field: "value" },
854
- ],
855
- ],
856
- json_schema: {
857
- type: "object",
858
- properties: {
859
- identifier: {
860
- type: "string",
861
- minLength: 1,
862
- maxLength: 50,
863
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
864
- },
865
- value: node_json_schema,
866
- },
867
- required: ["identifier", "value"],
868
- },
869
- validator: (input) => {
870
- // validate here
871
- },
872
- },
873
-
874
- set_defined: {
875
- kind: "definition",
876
- category: "variables",
877
- name: "Set Defined",
878
- fields: {
879
- defined_target: {
880
- node_options: ["defined_target_literal"],
881
- forced_node: "defined_target_literal",
882
- },
883
- value: {
884
- node_options: all_node_types,
885
- },
886
- },
887
- postgres_type: "jsonb",
888
- node_structure: [
889
- [
890
- { ui_type: "field", field: "defined_target" },
891
- { ui_type: "text", value: "=" },
892
- { ui_type: "field", field: "value" },
893
- ],
894
- ],
895
- json_schema: {
896
- type: "object",
897
- properties: {
898
- defined_target: {
899
- type: "object",
900
- properties: {
901
- identifier: {
902
- type: "string",
903
- },
904
- property_path: {
905
- type: "array",
906
- minItems: 1,
907
- maxItems: 50,
908
- items: {
909
- anyOf: [
910
- {
911
- type: "string",
912
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
913
- },
914
- {
915
- type: "number",
916
- },
917
- ],
918
- },
919
- },
920
- },
921
- },
922
- value: node_json_schema,
923
- },
924
- required: ["defined_target"],
925
- },
926
- validator: (input) => {
927
- // validate here
928
- },
929
- },
930
-
931
- get_defined: {
932
- kind: "expression",
933
- category: "variables",
934
- name: "Get Defined",
935
- fields: {
936
- defined_target: {
937
- node_options: ["defined_target_literal"],
938
- forced_node: "defined_target_literal",
939
- },
940
- },
941
- postgres_type: "jsonb",
942
- node_structure: [
943
- [
944
- { ui_type: "text", value: "value of" },
945
- { ui_type: "field", field: "defined_target" },
946
- ],
947
- ],
948
- json_schema: {
949
- type: "object",
950
- properties: {
951
- defined_target: {
952
- type: "array",
953
- minItems: 1,
954
- maxItems: 50,
955
- items: {
956
- anyOf: [
957
- {
958
- type: "string",
959
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
960
- },
961
- {
962
- type: "number",
963
- },
964
- ],
965
- },
966
- },
967
- },
968
- required: ["defined_target"],
969
- },
970
- output: {
971
- json_schema: {
972
- type: "any",
973
- },
974
- },
975
- validator: (input) => {
976
- // validate here
977
- },
978
- },
979
-
980
- run_defined: {
981
- kind: "expression",
982
- category: "variables",
983
- name: "Run Defined",
984
- fields: {
985
- defined_target: {
986
- node_options: ["defined_target_literal"],
987
- forced_node: "defined_target_literal",
988
- },
989
- arguments: {
990
- node_options: ["arguments_literal"],
991
- forced_node: "arguments_literal",
992
- },
993
- },
994
- postgres_type: "jsonb",
995
- node_structure: [
996
- [
997
- { ui_type: "text", value: "run" },
998
- { ui_type: "field", field: "defined_target" },
999
- { ui_type: "text", value: "with arguments" },
1000
- { ui_type: "field", field: "arguments" },
1001
- ],
1002
- ],
1003
- json_schema: {
1004
- type: "object",
1005
- properties: {
1006
- defined_target: {
1007
- type: "array",
1008
- minItems: 1,
1009
- maxItems: 50,
1010
- items: {
1011
- anyOf: [
1012
- {
1013
- type: "string",
1014
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
1015
- },
1016
- {
1017
- type: "number",
1018
- },
1019
- ],
1020
- },
1021
- },
1022
- arguments: {
1023
- type: "array",
1024
- items: {
1025
- parameter: {
1026
- type: "string",
1027
- },
1028
- value: {
1029
- type: "any",
1030
- },
1031
- },
1032
- },
1033
- },
1034
- required: ["defined_target"],
1035
- },
1036
- output: {
1037
- json_schema: {
1038
- type: "any",
1039
- },
1040
- },
1041
- validator: (input) => {
1042
- // validate here
1043
- },
1044
- },
1045
-
1046
- if_then: {
1047
- kind: "statement",
1048
- category: "main",
1049
- name: "If Then",
1050
- fields: {
1051
- condition: {
1052
- node_options: value_node_types,
1053
- },
1054
- is_do_collapsed: {
1055
- node_options: ["arrow_toggle_literal"],
1056
- forced_node: "arrow_toggle_literal",
1057
- },
1058
- do: {
1059
- node_options: ["stack_literal"],
1060
- forced_node: "stack_literal",
1061
- },
1062
- },
1063
- postgres_type: "jsonb",
1064
- node_structure: [
1065
- [
1066
- { ui_type: "field", field: "is_do_collapsed" },
1067
- { ui_type: "text", value: "if" },
1068
- { ui_type: "field", field: "condition" },
1069
- { ui_type: "text", value: "then" },
1070
- ],
1071
- { ui_type: "stack", field: "do" },
1072
- ],
1073
- json_schema: {
1074
- type: "object",
1075
- properties: {
1076
- condition: {
1077
- type: ["boolean", "number", "string", "epoch", "object", "array"],
1078
- },
1079
- passed_do: {
1080
- type: "array",
1081
- items: node_json_schema,
1082
- },
1083
- },
1084
- required: ["condition"],
1085
- },
1086
- validator: (input) => {
1087
- // validate here
1088
- },
1089
- },
1090
-
1091
- if_then_else: {
1092
- kind: "statement",
1093
- category: "main",
1094
- name: "If Then Else",
1095
- fields: {
1096
- condition: {
1097
- node_options: value_node_types,
1098
- },
1099
- is_passed_do_collapsed: {
1100
- node_options: ["arrow_toggle_literal"],
1101
- forced_node: "arrow_toggle_literal",
1102
- },
1103
- passed_do: {
1104
- node_options: ["stack_literal"],
1105
- forced_node: "stack_literal",
1106
- },
1107
- is_failed_do_collapsed: {
1108
- node_options: ["arrow_toggle_literal"],
1109
- forced_node: "arrow_toggle_literal",
1110
- },
1111
- failed_do: {
1112
- node_options: ["stack_literal"],
1113
- forced_node: "stack_literal",
1114
- },
1115
- },
1116
- postgres_type: "jsonb",
1117
- node_structure: [
1118
- [
1119
- { ui_type: "field", field: "is_passed_do_collapsed" },
1120
- { ui_type: "text", value: "if" },
1121
- { ui_type: "field", field: "condition" },
1122
- { ui_type: "text", value: "then" },
1123
- ],
1124
- { ui_type: "stack", field: "passed_do" },
1125
- [
1126
- { ui_type: "field", field: "is_failed_do_collapsed" },
1127
- { ui_type: "text", value: "else" },
1128
- ],
1129
- { ui_type: "stack", field: "failed_do" },
1130
- ],
1131
- json_schema: {
1132
- type: "object",
1133
- properties: {
1134
- condition: {
1135
- type: ["boolean", "number", "string", "epoch", "object", "array"],
1136
- },
1137
- passed_do: {
1138
- type: "array",
1139
- items: node_json_schema,
1140
- },
1141
- failed_do: {
1142
- type: "array",
1143
- items: node_json_schema,
1144
- },
1145
- },
1146
- required: ["condition"],
1147
- },
1148
- validator: (input) => {
1149
- // validate here
1150
- },
1151
- },
1152
-
1153
- for_loop: {
1154
- kind: "statement",
1155
- category: "main",
1156
- name: "For Loop",
1157
- fields: {
1158
- loop_over: {
1159
- node_options: ["get_defined", "int_literal"],
1160
- },
1161
- iter_item_identifier: {
1162
- node_options: ["identifier_literal"],
1163
- forced_node: "identifier_literal",
1164
- },
1165
- is_do_collapsed: {
1166
- node_options: ["arrow_toggle_literal"],
1167
- forced_node: "arrow_toggle_literal",
1168
- },
1169
- do: {
1170
- node_options: ["stack_literal"],
1171
- forced_node: "stack_literal",
1172
- },
1173
- },
1174
- postgres_type: "jsonb",
1175
- node_structure: [
1176
- [
1177
- { ui_type: "field", field: "is_do_collapsed" },
1178
- { ui_type: "text", value: "loop over" },
1179
- { ui_type: "field", field: "loop_over" },
1180
- { ui_type: "text", value: "as" },
1181
- { ui_type: "field", field: "iter_item_identifier" },
1182
- ],
1183
- { ui_type: "stack", field: "do" },
1184
- ],
1185
- json_schema: {
1186
- type: "object",
1187
- properties: {
1188
- loop_over: {
1189
- type: ["number", "object", "array"],
1190
- },
1191
- iter_item_identifier: {
1192
- type: "string",
1193
- minLength: 1,
1194
- maxLength: 80,
1195
- pattern: "^[a-z0-9]+(_[a-z0-9]+)*$",
1196
- },
1197
- do: {
1198
- type: "array",
1199
- items: node_json_schema,
1200
- },
1201
- },
1202
- required: ["loop_over"],
1203
- },
1204
- validator: (input) => {
1205
- // validate here
1206
- },
1207
- },
1208
-
1209
- return: {
1210
- kind: "statement",
1211
- category: "main",
1212
- name: "Return",
1213
- fields: {
1214
- value: {
1215
- node_options: all_node_types,
1216
- },
1217
- },
1218
- postgres_type: "jsonb",
1219
- node_structure: [
1220
- [
1221
- { ui_type: "text", value: "return" },
1222
- { ui_type: "field", field: "value" },
1223
- ],
1224
- ],
1225
- json_schema: {
1226
- type: "object",
1227
- properties: {
1228
- value: node_json_schema,
1229
- },
1230
- },
1231
- validator: (input) => {
1232
- // validate here
1233
- },
1234
- },
1235
-
1236
- dropdown_literal: {
1237
- kind: "statement",
1238
- category: "main",
1239
- name: "Dropdown",
1240
- fields: {
1241
- type: {
1242
- node_options: ["dropdown_literal"],
1243
- forced_node: "dropdown_literal",
1244
- dropdown_options: [
1245
- { key: "log", name: "Log" },
1246
- { key: "warning", name: "Warning" },
1247
- { key: "error", name: "Error" },
1248
- ],
1249
- dropdown_default: "log",
1250
- },
1251
- label: {
1252
- node_options: ["text_literal"],
1253
- forced_node: "text_literal",
1254
- },
1255
- value: {
1256
- node_options: all_node_types,
1257
- },
1258
- },
1259
- postgres_type: "jsonb",
1260
- node_structure: [
1261
- [
1262
- { ui_type: "field", field: "type" },
1263
- { ui_type: "field", field: "label" },
1264
- { ui_type: "field", field: "value" },
1265
- ],
1266
- ],
1267
- json_schema: {
1268
- type: "object",
1269
- properties: {
1270
- kind: {
1271
- type: "string",
1272
- enum: ["log", "warning", "error"],
1273
- default: "log",
1274
- },
1275
- label: {
1276
- type: "string",
1277
- },
1278
- value: node_json_schema,
1279
- },
1280
- required: ["kind", "value"],
1281
- },
1282
- validator: (input) => {
1283
- // validate here
1284
- },
1285
- },
1286
-
1287
- log: {
1288
- kind: "statement",
1289
- category: "main",
1290
- name: "Log",
1291
- fields: {
1292
- type: {
1293
- node_options: ["dropdown_literal"],
1294
- forced_node: "dropdown_literal",
1295
- dropdown_options: [
1296
- { key: "log", name: "Log" },
1297
- { key: "warning", name: "Warning" },
1298
- { key: "error", name: "Error" },
1299
- ],
1300
- dropdown_default: "log",
1301
- },
1302
- label: {
1303
- node_options: ["text_literal"],
1304
- forced_node: "text_literal",
1305
- },
1306
- value: {
1307
- node_options: all_node_types,
1308
- },
1309
- },
1310
- postgres_type: "jsonb",
1311
- node_structure: [
1312
- [
1313
- { ui_type: "field", field: "type" },
1314
- { ui_type: "field", field: "label" },
1315
- { ui_type: "field", field: "value" },
1316
- ],
1317
- ],
1318
- json_schema: {
1319
- type: "object",
1320
- properties: {
1321
- kind: {
1322
- type: "string",
1323
- enum: ["log", "warning", "error"],
1324
- default: "log",
1325
- },
1326
- label: {
1327
- type: "string",
1328
- },
1329
- value: node_json_schema,
1330
- },
1331
- required: ["kind", "value"],
1332
- },
1333
- validator: (input) => {
1334
- // validate here
1335
- },
1336
- },
1337
-
1338
- truthy_compare: {
1339
- kind: "expression",
1340
- category: "compare",
1341
- name: "Truthy Compare",
1342
- fields: {
1343
- a: {
1344
- node_options: all_node_types,
1345
- },
1346
- b: {
1347
- node_options: all_node_types,
1348
- },
1349
- operator: {
1350
- node_options: ["dropdown_literal"],
1351
- forced_node: "dropdown_literal",
1352
- dropdown_options: [
1353
- { key: "logical_or", name: "logical_or (||)" },
1354
- { key: "nullish_coalescing", name: "nullish_coalescing (??)" },
1355
- { key: "and", name: "and (&&)" },
1356
- ],
1357
- dropdown_default: "and",
1358
- },
1359
- },
1360
- postgres_type: "jsonb",
1361
- node_structure: [
1362
- [
1363
- { ui_type: "field", field: "a" },
1364
- { ui_type: "field", field: "operator" },
1365
- { ui_type: "field", field: "b" },
1366
- ],
1367
- ],
1368
- json_schema: {
1369
- type: "object",
1370
- properties: {
1371
- a: {
1372
- type: ["string", "number", "boolean", "object", "array"],
1373
- },
1374
- b: {
1375
- type: ["string", "number", "boolean", "object", "array"],
1376
- },
1377
- operator: {
1378
- type: "string",
1379
- enum: ["logical_or", "nullish_coalescing", "and"],
1380
- default: "and",
1381
- },
1382
- },
1383
- required: ["operator"],
1384
- },
1385
- output: {
1386
- json_schema: {
1387
- type: "boolean_literal",
1388
- },
1389
- },
1390
- validator: (input) => {
1391
- // validate here
1392
- },
1393
- },
1394
-
1395
- arithmetic_binary_operation: {
1396
- kind: "expression",
1397
- category: "math",
1398
- name: "Arithmatic Binary Operator",
1399
- fields: {
1400
- a: {
1401
- node_options: [
1402
- "get_defined",
1403
- "arithmetic_binary_operation",
1404
- "round",
1405
- "parse",
1406
- "get_length",
1407
- "int_literal",
1408
- "bigint_literal",
1409
- "float_literal",
1410
- ],
1411
- },
1412
- b: {
1413
- node_options: [
1414
- "get_defined",
1415
- "arithmetic_binary_operation",
1416
- "round",
1417
- "parse",
1418
- "get_length",
1419
- "int_literal",
1420
- "bigint_literal",
1421
- "float_literal",
1422
- ],
1423
- },
1424
- operator: {
1425
- node_options: ["dropdown_literal"],
1426
- forced_node: "dropdown_literal",
1427
- dropdown_options: [
1428
- { key: "add", name: "addition (+)" },
1429
- { key: "subtract", name: "subtraction (-)" },
1430
- { key: "multiply", name: "multiplication (*)" },
1431
- { key: "divide", name: "division (/)" },
1432
- { key: "remainder", name: "remainder (%)" },
1433
- { key: "exponent", name: "exponent (^)" },
1434
- { key: "min", name: "lowest" },
1435
- { key: "max", name: "highest" },
1436
- { key: "rand_value_between", name: "random value between" },
1437
- { key: "to_precision", name: "round to significant figures" },
1438
- ],
1439
- dropdown_default: "add",
1440
- },
1441
- },
1442
- postgres_type: "jsonb",
1443
- node_structure: [
1444
- [
1445
- { ui_type: "field", field: "a" },
1446
- { ui_type: "field", field: "operator" },
1447
- { ui_type: "field", field: "b" },
1448
- ],
1449
- ],
1450
- json_schema: {
1451
- type: "object",
1452
- properties: {
1453
- a: {
1454
- type: "number",
1455
- },
1456
- b: {
1457
- type: "number",
1458
- },
1459
- operator: {
1460
- type: "string",
1461
- enum: [
1462
- "add",
1463
- "subtract",
1464
- "multiply",
1465
- "divide",
1466
- "remainder",
1467
- "exponent",
1468
- "min",
1469
- "max",
1470
- "rand_value_between",
1471
- "to_precision",
1472
- ],
1473
- default: "add",
1474
- },
1475
- },
1476
- required: ["a", "b", "operator"],
1477
- },
1478
- output: {
1479
- json_schema: {
1480
- type: "number",
1481
- },
1482
- },
1483
- validator: (input) => {
1484
- // validate here
1485
- },
1486
- },
1487
-
1488
- round: {
1489
- kind: "expression",
1490
- category: "math",
1491
- name: "Round",
1492
- fields: {
1493
- value: {
1494
- node_options: [
1495
- "get_defined",
1496
- "arithmetic_binary_operation",
1497
- "round",
1498
- "parse",
1499
- "get_length",
1500
- "int_literal",
1501
- "bigint_literal",
1502
- "float_literal",
1503
- ],
1504
- },
1505
- operator: {
1506
- node_options: ["dropdown_literal"],
1507
- forced_node: "dropdown_literal",
1508
- dropdown_options: [
1509
- { key: "nearest_int", name: "nearest_int" },
1510
- { key: "floor_int", name: "floor_int" },
1511
- { key: "ceil_int", name: "ceil_int" },
1512
- { key: "absolute_value", name: "absolute_value" },
1513
- ],
1514
- dropdown_default: "floor_int",
1515
- },
1516
- },
1517
- postgres_type: "jsonb",
1518
- node_structure: [
1519
- [
1520
- { ui_type: "field", field: "operator" },
1521
- { ui_type: "field", field: "value" },
1522
- ],
1523
- ],
1524
- json_schema: {
1525
- type: "object",
1526
- properties: {
1527
- value: {
1528
- type: "number",
1529
- },
1530
- operator: {
1531
- type: "string",
1532
- enum: ["nearest_int", "floor_int", "ceil_int", "absolute_value"],
1533
- default: "floor_int",
1534
- },
1535
- },
1536
- required: ["value", "operator"],
1537
- },
1538
- output: {
1539
- json_schema: {
1540
- type: "number",
1541
- },
1542
- },
1543
- validator: (input) => {
1544
- // validate here
1545
- },
1546
- },
1547
-
1548
- parse: {
1549
- kind: "expression",
1550
- category: "main",
1551
- name: "Parse",
1552
- fields: {
1553
- value: {
1554
- node_options: ["get_defined", "text_literal"],
1555
- },
1556
- operator: {
1557
- node_options: ["dropdown_literal"],
1558
- forced_node: "dropdown_literal",
1559
- dropdown_options: [
1560
- { key: "to_int", name: "to_int" },
1561
- { key: "to_float", name: "to_float" },
1562
- { key: "to_json", name: "to_json" },
1563
- { key: "to_boolean", name: "to_boolean" },
1564
- ],
1565
- dropdown_default: "to_json",
1566
- },
1567
- },
1568
- postgres_type: "jsonb",
1569
- node_structure: [
1570
- [
1571
- { ui_type: "field", field: "operator" },
1572
- { ui_type: "field", field: "value" },
1573
- ],
1574
- ],
1575
- json_schema: {
1576
- type: "object",
1577
- properties: {
1578
- value: {
1579
- type: "string",
1580
- },
1581
- operator: {
1582
- type: "string",
1583
- enum: ["to_int", "to_float", "to_object", "to_array", "to_boolean"],
1584
- default: "to_object",
1585
- },
1586
- },
1587
- required: ["value", "operator"],
1588
- },
1589
- output: {
1590
- json_schema: {
1591
- type: "any",
1592
- },
1593
- },
1594
- validator: (input) => {
1595
- // validate here
1596
- },
1597
- },
1598
-
1599
- add_item_to_array: {
1600
- kind: "expression",
1601
- category: "arrays",
1602
- name: "Add Item To Array",
1603
- fields: {
1604
- array: {
1605
- node_options: ["get_defined", "empty_array_literal"],
1606
- },
1607
- value_to_add: {
1608
- node_options: all_node_types,
1609
- },
1610
- where_to_add: {
1611
- node_options: ["dropdown_literal"],
1612
- forced_node: "dropdown_literal",
1613
- dropdown_options: [
1614
- { key: "start", name: "start" },
1615
- { key: "end", name: "end" },
1616
- ],
1617
- dropdown_default: "end",
1618
- },
1619
- },
1620
- postgres_type: "jsonb",
1621
- node_structure: [
1622
- [
1623
- { ui_type: "text", value: "add" },
1624
- { ui_type: "field", field: "value_to_add" },
1625
- { ui_type: "text", value: "to" },
1626
- { ui_type: "field", field: "array" },
1627
- { ui_type: "text", value: "at" },
1628
- { ui_type: "field", field: "where_to_add" },
1629
- ],
1630
- ],
1631
- json_schema: {
1632
- type: "object",
1633
- properties: {
1634
- array: {
1635
- type: "array",
1636
- items: {
1637
- type: "any",
1638
- },
1639
- },
1640
- value_to_add: node_json_schema,
1641
- where_to_add: {
1642
- type: "string",
1643
- enum: ["start", "end"],
1644
- default: "end",
1645
- },
1646
- },
1647
- required: ["array", "value_to_add", "where_to_add"],
1648
- },
1649
- output: {
1650
- json_schema: {
1651
- type: "array",
1652
- items: {
1653
- type: "any",
1654
- },
1655
- },
1656
- },
1657
- validator: (input) => {
1658
- // validate here
1659
- },
1660
- },
1661
-
1662
- add_item_to_array_at_index: {
1663
- kind: "expression",
1664
- category: "arrays",
1665
- name: "Add Item To Array At Index",
1666
- fields: {
1667
- array: {
1668
- node_options: ["get_defined", "empty_array_literal"],
1669
- },
1670
- value_to_add: {
1671
- node_options: all_node_types,
1672
- },
1673
- where_to_add: {
1674
- node_options: ["get_defined", "int_literal"],
1675
- },
1676
- },
1677
- node_structure: [
1678
- [
1679
- { ui_type: "text", value: "add" },
1680
- { ui_type: "field", field: "value_to_add" },
1681
- { ui_type: "text", value: "to" },
1682
- { ui_type: "field", field: "array" },
1683
- { ui_type: "text", value: "at index" },
1684
- { ui_type: "field", field: "where_to_add" },
1685
- ],
1686
- ],
1687
- postgres_type: "jsonb",
1688
- json_schema: {
1689
- type: "object",
1690
- properties: {
1691
- array: {
1692
- type: "array",
1693
- items: {
1694
- type: "any",
1695
- },
1696
- },
1697
- value_to_add: node_json_schema,
1698
- where_to_add: {
1699
- type: "number",
1700
- },
1701
- },
1702
- required: ["array", "value_to_add", "where_to_add"],
1703
- },
1704
- output: {
1705
- json_schema: {
1706
- type: "array",
1707
- items: {
1708
- type: "any",
1709
- },
1710
- },
1711
- },
1712
- validator: (input) => {
1713
- // validate here
1714
- },
1715
- },
1716
-
1717
- remove_item_from_array: {
1718
- kind: "expression",
1719
- category: "arrays",
1720
- name: "Remove Item From Array",
1721
- fields: {
1722
- array: {
1723
- node_options: ["get_defined"],
1724
- forced_node: "get_defined",
1725
- },
1726
- where_to_remove: {
1727
- node_options: ["dropdown_literal"],
1728
- forced_node: "dropdown_literal",
1729
- dropdown_options: [
1730
- { key: "start", name: "start" },
1731
- { key: "end", name: "end" },
1732
- ],
1733
- dropdown_default: "end",
1734
- },
1735
- },
1736
- postgres_type: "jsonb",
1737
- node_structure: [
1738
- [
1739
- { ui_type: "text", value: "remove item from array" },
1740
- { ui_type: "field", field: "array" },
1741
- { ui_type: "text", value: "at" },
1742
- { ui_type: "field", field: "where_to_remove" },
1743
- ],
1744
- ],
1745
- json_schema: {
1746
- type: "object",
1747
- properties: {
1748
- array: {
1749
- type: "array",
1750
- items: {
1751
- type: "any",
1752
- },
1753
- },
1754
- where_to_remove: {
1755
- type: "string",
1756
- enum: ["start", "end"],
1757
- default: "end",
1758
- },
1759
- },
1760
- required: ["array", "where_to_remove"],
1761
- },
1762
- output: {
1763
- json_schema: {
1764
- type: "array",
1765
- items: {
1766
- type: "any",
1767
- },
1768
- },
1769
- },
1770
- validator: (input) => {
1771
- // validate here
1772
- },
1773
- },
1774
-
1775
- remove_item_from_array_at_index: {
1776
- kind: "expression",
1777
- category: "arrays",
1778
- name: "Remove Item From Array At Index",
1779
- fields: {
1780
- array: {
1781
- node_options: ["get_defined"],
1782
- forced_node: "get_defined",
1783
- },
1784
- where_to_remove: {
1785
- node_options: ["get_defined", "int_literal"],
1786
- },
1787
- },
1788
- node_structure: [
1789
- [
1790
- { ui_type: "text", value: "remove item from array" },
1791
- { ui_type: "field", field: "array" },
1792
- { ui_type: "text", value: "at index" },
1793
- { ui_type: "field", field: "where_to_remove" },
1794
- ],
1795
- ],
1796
- postgres_type: "jsonb",
1797
- json_schema: {
1798
- type: "object",
1799
- properties: {
1800
- array: {
1801
- type: "array",
1802
- items: {
1803
- type: "any",
1804
- },
1805
- },
1806
- where_to_remove: {
1807
- type: "number",
1808
- },
1809
- },
1810
- required: ["array", "where_to_remove"],
1811
- },
1812
- output: {
1813
- json_schema: {
1814
- type: "array",
1815
- items: {
1816
- type: "any",
1817
- },
1818
- },
1819
- },
1820
- validator: (input) => {
1821
- // validate here
1822
- },
1823
- },
1824
-
1825
- split_text: {
1826
- kind: "expression",
1827
- category: "arrays",
1828
- name: "Split Text",
1829
- fields: {
1830
- text: {
1831
- node_options: ["text_literal", "get_defined"],
1832
- },
1833
- delimiter: {
1834
- node_options: ["text_literal", "get_defined"],
1835
- },
1836
- },
1837
- node_structure: [
1838
- [
1839
- { ui_type: "text", value: "split text" },
1840
- { ui_type: "field", field: "text" },
1841
- { ui_type: "text", value: "to array at delimiter" },
1842
- { ui_type: "field", field: "delimiter" },
1843
- ],
1844
- ],
1845
- postgres_type: "jsonb",
1846
- json_schema: {
1847
- type: "object",
1848
- properties: {
1849
- text: {
1850
- type: "string",
1851
- },
1852
- delimiter: {
1853
- type: "string",
1854
- },
1855
- },
1856
- required: ["text", "delimiter"],
1857
- },
1858
- output: {
1859
- json_schema: {
1860
- type: "array",
1861
- items: {
1862
- type: "string",
1863
- },
1864
- },
1865
- },
1866
- validator: (input) => {
1867
- // validate here
1868
- },
1869
- },
1870
-
1871
- concat_arrays: {
1872
- kind: "expression",
1873
- category: "arrays",
1874
- name: "Concat Arrays",
1875
- fields: {
1876
- first_array: {
1877
- node_options: [
1878
- "get_defined",
1879
- "concat_arrays",
1880
- "add_item_to_array",
1881
- "add_item_to_array_at_index",
1882
- "remove_item_from_array",
1883
- "remove_item_from_array_at_index",
1884
- ],
1885
- },
1886
- second_array: {
1887
- node_options: [
1888
- "get_defined",
1889
- "concat_arrays",
1890
- "add_item_to_array",
1891
- "add_item_to_array_at_index",
1892
- "remove_item_from_array",
1893
- "remove_item_from_array_at_index",
1894
- ],
1895
- },
1896
- },
1897
- postgres_type: "jsonb",
1898
- node_structure: [
1899
- [
1900
- { ui_type: "text", value: "concat arrays" },
1901
- { ui_type: "field", field: "first_array" },
1902
- { ui_type: "text", value: "and" },
1903
- { ui_type: "field", field: "second_array" },
1904
- ],
1905
- ],
1906
- postgres_type: "jsonb",
1907
- json_schema: {
1908
- type: "object",
1909
- properties: {
1910
- first_array: {
1911
- type: "array",
1912
- items: {
1913
- type: "any",
1914
- },
1915
- },
1916
- second_array: {
1917
- type: "array",
1918
- items: {
1919
- type: "any",
1920
- },
1921
- },
1922
- },
1923
- required: ["first_array", "second_array"],
1924
- },
1925
- output: {
1926
- json_schema: {
1927
- type: "array",
1928
- items: {
1929
- type: "any",
1930
- },
1931
- },
1932
- },
1933
- validator: (input) => {
1934
- // validate here
1935
- },
1936
- },
1937
-
1938
- sort_array: {
1939
- kind: "expression",
1940
- category: "arrays",
1941
- name: "Sort Array",
1942
- fields: {
1943
- array: {
1944
- node_options: [
1945
- "get_defined",
1946
- "concat_arrays",
1947
- "add_item_to_array",
1948
- "add_item_to_array_at_index",
1949
- "remove_item_from_array",
1950
- "remove_item_from_array_at_index",
1951
- ],
1952
- },
1953
- iter_item_a_identifier: {
1954
- node_options: ["identifier_literal"],
1955
- forced_node: "identifier_literal",
1956
- },
1957
- iter_item_b_identifier: {
1958
- node_options: ["identifier_literal"],
1959
- forced_node: "identifier_literal",
1960
- },
1961
- do: {
1962
- node_options: ["stack_literal"],
1963
- forced_node: "stack_literal",
1964
- },
1965
- },
1966
- node_structure: [
1967
- [
1968
- { ui_type: "text", value: "sort array" },
1969
- { ui_type: "field", field: "array" },
1970
- { ui_type: "text", value: "with item identifiers" },
1971
- { ui_type: "field", field: "iter_item_a_identifier" },
1972
- { ui_type: "field", field: "iter_item_b_identifier" },
1973
- ],
1974
- { ui_type: "stack", field: "do" },
1975
- ],
1976
- postgres_type: "jsonb",
1977
- json_schema: {
1978
- type: "object",
1979
- properties: {
1980
- array: {
1981
- type: "array",
1982
- items: {
1983
- type: "any",
1984
- },
1985
- },
1986
- iter_item_a_identifier: {
1987
- type: "string",
1988
- },
1989
- iter_item_b_identifier: {
1990
- type: "string",
1991
- },
1992
- do: {
1993
- type: "array",
1994
- items: {
1995
- type: "node",
1996
- },
1997
- },
1998
- },
1999
- required: ["array", "do"],
2000
- },
2001
- output: {
2002
- json_schema: {
2003
- type: "array",
2004
- items: {
2005
- type: "any",
2006
- },
2007
- },
2008
- },
2009
- validator: (input) => {
2010
- // validate here
2011
- },
2012
- },
2013
-
2014
- local_compare: {
2015
- kind: "expression",
2016
- category: "arrays",
2017
- name: "Alphabetically Compare",
2018
- fields: {
2019
- a: {
2020
- node_options: ["text_literal", "get_defined"],
2021
- },
2022
- b: {
2023
- node_options: ["text_literal", "get_defined"],
2024
- },
2025
- },
2026
- node_structure: [
2027
- [
2028
- { ui_type: "text", value: "alphabetically compare" },
2029
- { ui_type: "field", field: "a" },
2030
- { ui_type: "text", value: "to" },
2031
- { ui_type: "field", field: "b" },
2032
- ],
2033
- ],
2034
- postgres_type: "jsonb",
2035
- json_schema: {
2036
- type: "object",
2037
- properties: {
2038
- a: {
2039
- type: "string",
2040
- },
2041
- b: {
2042
- type: "string",
2043
- },
2044
- },
2045
- required: ["a", "b"],
2046
- },
2047
- output: {
2048
- json_schema: {
2049
- type: "boolean",
2050
- },
2051
- },
2052
- validator: (input) => {
2053
- // validate here
2054
- },
2055
- },
2056
-
2057
- slice: {
2058
- kind: "expression",
2059
- category: "arrays",
2060
- name: "Slice",
2061
- fields: {
2062
- value: {
2063
- node_options: ["get_defined"],
2064
- forced_node: "get_defined",
2065
- },
2066
- start_index: {
2067
- node_options: ["int_literal", "get_defined"],
2068
- },
2069
- end_index: {
2070
- node_options: ["int_literal", "get_defined"],
2071
- },
2072
- },
2073
- node_structure: [
2074
- [
2075
- { ui_type: "text", value: "slice" },
2076
- { ui_type: "field", field: "value" },
2077
- { ui_type: "text", value: "from" },
2078
- { ui_type: "field", field: "start_index" },
2079
- { ui_type: "text", value: "to" },
2080
- { ui_type: "field", field: "end_index" },
2081
- ],
2082
- ],
2083
- postgres_type: "jsonb",
2084
- json_schema: {
2085
- type: "object",
2086
- properties: {
2087
- value: {
2088
- type: ["array", "string"],
2089
- },
2090
- start_index: {
2091
- type: "number",
2092
- },
2093
- end_index: {
2094
- type: "number",
2095
- },
2096
- },
2097
- required: ["value", "start_index", "end_index"],
2098
- },
2099
- output: {
2100
- json_schema: {
2101
- type: "array",
2102
- items: {
2103
- type: "any",
2104
- },
2105
- },
2106
- },
2107
- validator: (input) => {
2108
- // validate here
2109
- },
2110
- },
2111
-
2112
- join_array_of_text_items: {
2113
- kind: "expression",
2114
- category: "arrays",
2115
- name: "Join Array Of Text Items",
2116
- fields: {
2117
- array: {
2118
- node_options: ["get_defined"],
2119
- forced_node: "get_defined",
2120
- },
2121
- },
2122
- node_structure: [
2123
- [
2124
- { ui_type: "text", value: "join array of text" },
2125
- { ui_type: "field", field: "array" },
2126
- ],
2127
- ],
2128
- postgres_type: "jsonb",
2129
- json_schema: {
2130
- type: "object",
2131
- properties: {
2132
- array: {
2133
- type: "array",
2134
- items: {
2135
- type: "any",
2136
- },
2137
- },
2138
- },
2139
- required: ["array"],
2140
- },
2141
- output: {
2142
- json_schema: {
2143
- type: "string",
2144
- },
2145
- },
2146
- validator: (input) => {
2147
- // validate here
2148
- },
2149
- },
2150
-
2151
- reverse_array: {
2152
- kind: "expression",
2153
- category: "arrays",
2154
- name: "Reverse Array",
2155
- fields: {
2156
- array: {
2157
- node_options: ["get_defined"],
2158
- forced_node: "get_defined",
2159
- },
2160
- },
2161
- node_structure: [
2162
- [
2163
- { ui_type: "text", value: "reverse array" },
2164
- { ui_type: "field", field: "array" },
2165
- ],
2166
- ],
2167
- postgres_type: "jsonb",
2168
- json_schema: {
2169
- type: "object",
2170
- properties: {
2171
- array: {
2172
- type: "array",
2173
- items: {
2174
- type: "any",
2175
- },
2176
- },
2177
- },
2178
- required: ["array"],
2179
- },
2180
- output: {
2181
- json_schema: {
2182
- type: "array",
2183
- items: {
2184
- type: "any",
2185
- },
2186
- },
2187
- },
2188
- validator: (input) => {
2189
- // validate here
443
+ locality: { type: "string" },
444
+ sub_locality: { type: "string" },
445
+ full_thoroughfare: { type: "string" },
2190
446
  },
447
+ required: ["latitude", "longitude", "name"],
448
+ additionalProperties: false,
2191
449
  },
2192
-
2193
- average_of_number_array: {
2194
- kind: "expression",
2195
- category: "arrays",
2196
- name: "Average Of Number Array",
2197
- fields: {
2198
- array: {
2199
- node_options: ["get_defined"],
2200
- forced_node: "get_defined",
2201
- },
2202
- },
2203
- node_structure: [
2204
- [
2205
- { ui_type: "text", value: "average of numbers in" },
2206
- { ui_type: "field", field: "array" },
2207
- ],
2208
- ],
2209
- postgres_type: "jsonb",
2210
- json_schema: {
2211
- type: "object",
2212
- properties: {
2213
- array: {
2214
- type: "array",
2215
- items: {
2216
- type: "number",
2217
- },
2218
- },
2219
- },
2220
- required: ["array"],
2221
- },
2222
- output: {
2223
- json_schema: {
2224
- type: "number",
2225
- },
2226
- },
2227
- validator: (input) => {
2228
- // validate here
2229
- },
450
+ validator: (input) => {
451
+ // validate here
2230
452
  },
2231
-
2232
- sum_of_number_array: {
2233
- kind: "expression",
2234
- category: "arrays",
2235
- name: "Sum Of Number Array",
2236
- fields: {
2237
- array: {
2238
- node_options: ["get_defined"],
2239
- forced_node: "get_defined",
2240
- },
2241
- },
2242
- node_structure: [
2243
- [
2244
- { ui_type: "text", value: "sum of numbers in" },
2245
- { ui_type: "field", field: "array" },
2246
- ],
2247
- ],
2248
- postgres_type: "jsonb",
2249
- json_schema: {
2250
- type: "object",
2251
- properties: {
2252
- array: {
2253
- type: "array",
2254
- items: {
2255
- type: "number",
2256
- },
2257
- },
2258
- },
2259
- required: ["array"],
2260
- },
2261
- output: {
2262
- json_schema: {
2263
- type: "number",
2264
- },
2265
- },
2266
- validator: (input) => {
2267
- // validate here
453
+ }
454
+ const cron_literal = {
455
+ kind: "literal",
456
+ category: "variables",
457
+ name: "Cron",
458
+ postgres_type: "jsonb",
459
+ json_schema: {
460
+ type: "object",
461
+ properties: {
462
+ content: { type: "string" },
463
+ cron: { type: "string" },
464
+ minute: { type: "string" },
465
+ hour: { type: "string" },
466
+ day_of_month: { type: "string" },
467
+ month: { type: "string" },
468
+ day_of_week: { type: "string" },
2268
469
  },
470
+ additionalProperties: false,
471
+ required: [],
2269
472
  },
2270
-
2271
- trim_text: {
2272
- kind: "expression",
2273
- category: "operation",
2274
- name: "Trim Text",
2275
- fields: {
2276
- text: {
2277
- node_options: ["get_defined"],
2278
- forced_node: "get_defined",
2279
- },
2280
- },
2281
- node_structure: [
2282
- [
2283
- { ui_type: "text", value: "trim" },
2284
- { ui_type: "field", field: "text" },
2285
- ],
2286
- ],
2287
- postgres_type: "jsonb",
2288
- json_schema: {
2289
- type: "object",
2290
- properties: {
2291
- text: {
2292
- type: "string",
2293
- },
2294
- },
2295
- required: ["text"],
2296
- },
2297
- output: {
2298
- json_schema: {
2299
- type: "string",
2300
- },
2301
- },
2302
- validator: (input) => {
2303
- // validate here
2304
- },
473
+ validator: (input) => {
474
+ // validate here
2305
475
  },
2306
-
2307
- replace_text: {
2308
- kind: "expression",
2309
- category: "operation",
2310
- name: "Replace Text",
2311
- fields: {
2312
- base_text: {
2313
- node_options: ["text_literal", "get_defined"],
2314
- },
2315
- text_to_replace: {
2316
- node_options: ["text_literal", "get_defined"],
2317
- },
2318
- replacement_text: {
2319
- node_options: ["text_literal", "get_defined"],
2320
- },
2321
- },
2322
- node_structure: [
2323
- [
2324
- { ui_type: "text", value: "from base text" },
2325
- { ui_type: "field", field: "base_text" },
2326
- { ui_type: "text", value: "replace" },
2327
- { ui_type: "field", field: "text_to_replace" },
2328
- { ui_type: "text", value: "with" },
2329
- { ui_type: "field", field: "replacement_text" },
2330
- ],
2331
- ],
2332
- postgres_type: "jsonb",
2333
- json_schema: {
2334
- type: "object",
2335
- properties: {
2336
- base_text: {
2337
- type: "string",
2338
- },
2339
- text_to_replace: {
2340
- type: "string",
2341
- },
2342
- replacement_text: {
476
+ }
477
+ const variable_path_literal = {
478
+ kind: "literal",
479
+ category: "variables",
480
+ name: "Variable Path",
481
+ postgres_type: "jsonb",
482
+ json_schema: {
483
+ type: "array",
484
+ description: "The path to the value within variables.",
485
+ items: {
486
+ anyOf: [
487
+ {
2343
488
  type: "string",
2344
489
  },
2345
- },
2346
- required: ["base_text", "text_to_replace", "replacement_text"],
2347
- },
2348
- output: {
2349
- json_schema: {
2350
- type: "string",
2351
- },
2352
- },
2353
- validator: (input) => {
2354
- // validate here
2355
- },
2356
- },
2357
-
2358
- compare_numbers: {
2359
- kind: "expression",
2360
- category: "compare",
2361
- name: "Compare Numbers",
2362
- fields: {
2363
- a: {
2364
- node_options: [
2365
- "get_defined",
2366
- "arithmetic_binary_operation",
2367
- "round",
2368
- "parse",
2369
- "get_length",
2370
- "int_literal",
2371
- "bigint_literal",
2372
- "float_literal",
2373
- ],
2374
- },
2375
- b: {
2376
- node_options: [
2377
- "get_defined",
2378
- "arithmetic_binary_operation",
2379
- "round",
2380
- "parse",
2381
- "get_length",
2382
- "int_literal",
2383
- "bigint_literal",
2384
- "float_literal",
2385
- ],
2386
- },
2387
- operator: {
2388
- node_options: ["dropdown_literal"],
2389
- forced_node: "dropdown_literal",
2390
- dropdown_options: [
2391
- { key: "less_than", name: "less than (<)" },
2392
- { key: "less_than_or_equal", name: "less than or equal to (<=)" },
2393
- { key: "greater_than", name: "greater than (>)" },
2394
- { key: "greater_than_or_equal", name: "greater than or equal to (>=)" },
2395
- { key: "equal_to", name: "equals (==)" },
2396
- { key: "not_equal_to", name: "not equal to (!=)" },
2397
- ],
2398
- dropdown_default: "less_than",
2399
- },
2400
- },
2401
- node_structure: [
2402
- [
2403
- { ui_type: "field", field: "a" },
2404
- { ui_type: "field", field: "operator" },
2405
- { ui_type: "field", field: "b" },
2406
- ],
2407
- ],
2408
- postgres_type: "jsonb",
2409
- json_schema: {
2410
- type: "object",
2411
- properties: {
2412
- a: {
2413
- type: "number",
2414
- },
2415
- b: {
490
+ {
2416
491
  type: "number",
2417
492
  },
2418
- operator: {
2419
- type: "string",
2420
- enum: [
2421
- "less_than",
2422
- "less_than_or_equal",
2423
- "greater_than",
2424
- "greater_than_or_equal",
2425
- "equal_to",
2426
- "not_equal_to",
2427
- ],
2428
- default: "less_than",
2429
- },
2430
- },
2431
- required: ["a", "b", "operator"],
2432
- },
2433
- output: {
2434
- json_schema: {
2435
- type: "boolean",
2436
- },
2437
- },
2438
- validator: (input) => {
2439
- // validate here
2440
- },
2441
- },
2442
-
2443
- compare_text: {
2444
- kind: "expression",
2445
- category: "compare",
2446
- name: "Compare Text",
2447
- fields: {
2448
- a: {
2449
- node_options: ["get_defined", "text_literal"],
2450
- },
2451
- b: {
2452
- node_options: ["get_defined", "text_literal"],
2453
- },
2454
- operator: {
2455
- node_options: ["dropdown_literal"],
2456
- forced_node: "dropdown_literal",
2457
- dropdown_options: [
2458
- { key: "equal_to", name: "equals (==)" },
2459
- { key: "not_equal_to", name: "not equal to (!=)" },
2460
- { key: "contains", name: "contains" },
2461
- { key: "does_not_contain", name: "does not contain" },
2462
- { key: "starts_with", name: "starts with" },
2463
- { key: "ends_with", name: "ends with" },
2464
- ],
2465
- dropdown_default: "starts_with",
2466
- },
2467
- },
2468
- node_structure: [
2469
- [
2470
- { ui_type: "field", field: "a" },
2471
- { ui_type: "field", field: "operator" },
2472
- { ui_type: "field", field: "b" },
2473
- ],
2474
- ],
2475
- postgres_type: "jsonb",
2476
- json_schema: {
2477
- type: "object",
2478
- properties: {
2479
- a: {
2480
- type: "text",
2481
- },
2482
- b: {
2483
- type: "text",
2484
- },
2485
- operator: {
2486
- type: "string",
2487
- enum: ["equal_to", "not_equal_to", "contains", "does_not_contain", "starts_with", "ends_with"],
2488
- default: "starts_with",
493
+ {
494
+ type: "array",
495
+ items: {
496
+ anyOf: [
497
+ {
498
+ type: "string",
499
+ },
500
+ {
501
+ type: "number",
502
+ },
503
+ ],
504
+ },
2489
505
  },
2490
- },
2491
- required: ["a", "b", "operator"],
2492
- },
2493
- output: {
2494
- json_schema: {
2495
- type: "boolean",
2496
- },
2497
- },
2498
- validator: (input) => {
2499
- // validate here
2500
- },
2501
- },
2502
-
2503
- get_length: {
2504
- kind: "expression",
2505
- category: "math",
2506
- name: "Get Length",
2507
- fields: {
2508
- value: {
2509
- node_options: ["get_defined", "text_literal"], // array types
2510
- },
2511
- },
2512
- node_structure: [
2513
- [
2514
- { ui_type: "text", value: "length of" },
2515
- { ui_type: "field", field: "value" },
2516
506
  ],
2517
- ],
2518
- postgres_type: "jsonb",
2519
- json_schema: {
2520
- type: "object",
2521
- properties: {
2522
- value: {
2523
- type: ["array", "object", "text"],
2524
- },
2525
- },
2526
- required: ["value"],
2527
- },
2528
- output: {
2529
- json_schema: {
2530
- type: "number",
2531
- },
2532
- },
2533
- validator: (input) => {
2534
- // validate here
2535
507
  },
2536
508
  },
2537
-
2538
- object_expression: {
2539
- kind: "expression",
2540
- category: "variables",
2541
- name: "Object Expression",
2542
- fields: {
2543
- value: {
2544
- node_options: ["object_builder"],
2545
- forced_node: "object_builder",
2546
- },
2547
- },
2548
- node_structure: [
2549
- [{ ui_type: "text", value: "build object" }, { ui_type: "br" }, { ui_type: "field", field: "value" }],
2550
- ],
2551
- postgres_type: "jsonb",
2552
- json_schema: {
2553
- type: "array",
2554
- items: {
2555
- type: "object",
2556
- properties: {
2557
- key: {
2558
- type: "string",
2559
- node_options: ["text_literal", "get_defined"],
2560
- },
2561
- value: {
2562
- type: "any",
2563
- node_options: [...value_node_types],
2564
- },
2565
- },
2566
- },
2567
- },
2568
- output: {
2569
- json_schema: {
2570
- type: "object",
2571
- },
2572
- },
2573
- validator: (input) => {
2574
- // validate here
2575
- },
509
+ validator: (input) => {
510
+ // validate here
2576
511
  },
2577
-
2578
- call_endpoint: {
2579
- kind: "expression",
2580
- category: "actions",
2581
- name: "Call Endpoint",
2582
- fields: {
2583
- endpoint: {
2584
- node_options: ["get_defined", "text_literal"],
2585
- },
2586
- headers: {
2587
- node_options: ["object_literal", "get_defined"],
2588
- },
2589
- body: {
2590
- node_options: ["object_literal", "get_defined"],
2591
- },
2592
- },
2593
- node_structure: [
2594
- [
2595
- { ui_type: "text", value: "call endpoint" },
2596
- { ui_type: "br" },
2597
- { ui_type: "field", field: "endpoint" },
2598
- { ui_type: "br" },
2599
- { ui_type: "text", value: "with headers" },
2600
- { ui_type: "br" },
2601
- { ui_type: "field", field: "headers" },
2602
- { ui_type: "br" },
2603
- { ui_type: "text", value: "and body" },
2604
- { ui_type: "br" },
2605
- { ui_type: "field", field: "body" },
2606
- ],
2607
- ],
2608
- postgres_type: "jsonb",
2609
- json_schema: {
2610
- type: "object",
2611
- properties: {
2612
- endpoint: { type: "string" },
2613
- headers: { type: "object" },
2614
- body: { type: "object" },
2615
- },
2616
- required: ["endpoint"],
2617
- },
2618
- output: {
2619
- json_schema: {
2620
- type: "object",
2621
- },
2622
- },
2623
- validator: (input) => {
2624
- // validate here
2625
- },
512
+ }
513
+ const content_literal = {
514
+ kind: "literal",
515
+ category: "variables",
516
+ name: "Content",
517
+ postgres_type: "jsonb",
518
+ // json_schema: get_content_node_json_schema("content_literal"),
519
+ validator: (input) => {
520
+ // validate here
2626
521
  },
2627
-
2628
- cron_job: {
2629
- kind: "expression",
2630
- category: "triggers",
2631
- name: "Cron Job",
2632
- fields: {
2633
- cron: {
2634
- node_options: ["cron_literal"],
2635
- forced_node: "cron_literal",
2636
- },
2637
- do: {
2638
- node_options: ["stack_literal"],
2639
- forced_node: "stack_literal",
2640
- },
2641
- },
2642
- node_structure: [
2643
- [
2644
- { ui_type: "text", value: "cron" },
2645
- { ui_type: "field", field: "cron" },
2646
- ],
2647
- { ui_type: "stack", field: "do" },
2648
- ],
2649
- postgres_type: "jsonb",
2650
- json_schema: {
2651
- type: "object",
2652
- properties: {
2653
- cron: { type: "string" },
2654
- do: {
2655
- type: "array",
2656
- items: node_json_schema,
2657
- },
2658
- },
2659
- required: ["cron", "do"],
2660
- },
2661
- output: {
2662
- json_schema: {
2663
- type: "object",
2664
- },
2665
- },
2666
- validator: (input) => {
2667
- // validate here
2668
- },
522
+ }
523
+ const table_id_for_foreign_row_literal = {
524
+ kind: "literal",
525
+ category: "variables",
526
+ name: "Table ID for Foreign Row",
527
+ postgres_type: "text",
528
+ // json_schema: get_content_node_json_schema("content_literal"),
529
+ validator: (input) => {
530
+ // validate here
2669
531
  },
2670
532
  }
533
+ // image_literal
534
+ // audio_literal
535
+ // file_literal
536
+ // dropdown_literal
537
+ // text_array_literal
538
+ // function_literal
2671
539
 
2672
540
  export const literal_types = {
2673
541
  array_literal,
@@ -4139,7 +2007,6 @@ export const content_types = {
4139
2007
  export const node_types = {
4140
2008
  ...literal_types,
4141
2009
  ...content_types,
4142
- ...function_types,
4143
2010
  }
4144
2011
 
4145
2012
  function get_content_node_json_schema(type_id) {
@@ -4606,33 +2473,6 @@ function find_match(match_for, value) {
4606
2473
  return false
4607
2474
  }
4608
2475
 
4609
- // function is_pass_predicate(predicate, value, check_value) {
4610
- // switch (predicate) {
4611
- // case "equal_to":
4612
- // return check_value === value
4613
- // case "not_equal_to":
4614
- // return check_value !== value
4615
- // case "less_than":
4616
- // return check_value < value
4617
- // case "less_than_or_equal":
4618
- // return check_value <= value
4619
- // case "greater_than":
4620
- // return check_value > value
4621
- // case "greater_than_or_equal":
4622
- // return check_value >= value
4623
- // case "contains":
4624
- // return check_value.includes(value)
4625
- // case "does_not_contain":
4626
- // return !check_value.includes(value)
4627
- // case "starts_with":
4628
- // return check_value.startsWith(value)
4629
- // case "ends_with":
4630
- // return check_value.endsWith(value)
4631
- // default:
4632
- // return false
4633
- // }
4634
- // }
4635
-
4636
2476
  // const override_base = {
4637
2477
  // options: {
4638
2478
  // color: null,