-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathstructs.go
More file actions
executable file
·5226 lines (4677 loc) · 228 KB
/
structs.go
File metadata and controls
executable file
·5226 lines (4677 loc) · 228 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
package shuffle
import (
"encoding/json"
"encoding/xml"
"sync"
"time"
"github.com/shuffle/opensearch-go/v4/opensearchapi"
)
type AppContext struct {
AppName string `json:"app_name"`
AppID string `json:"app_id"`
ActionName string `json:"action_name"`
Label string `json:"label"`
ExampleResponse string `json:"example_response,omitempty" datastore:"example_response,noindex"`
Example string `json:"example,omitempty" datastore:"example,noindex"`
}
type CorrelationRequest struct {
Type string `json:"type"`
Key string `json:"key"`
Category string `json:"category"`
}
type LogRequest struct {
Timestamp int64 `json:"timestamp"`
Method string `json:"method"`
URL string `json:"url"`
Header map[string][]string `json:"header"`
Referer string `json:"referer"`
}
type PipelineRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Command string `json:"command"`
Environment string `json:"environment"`
WorkflowId string `json:"workflow_id"`
StartNode string `json:"start_node"`
Url string `json:"url"`
PipelineId string `json:"pipeline_id"`
TriggerId string `json:"trigger_id"`
}
type Pipeline struct {
Name string `json:"name" datastore:"name"`
ID string `json:"id" datastore:"id"`
Type string `json:"type" datastore:"type"`
Command string `json:"command" datastore:"command"`
Environment string `json:"environment" datastore:"environment"`
WorkflowId string `json:"workflow_id" datastore:"workflow_id"`
StartNode string `json:"start_node" datastore:"start_node"`
OrgId string `json:"org_id" datastore:"org_id"`
Status string `json:"status" datastore:"status"`
Errors []string `json:"errors" datastore:"errors"`
Url string `json:"url" datastore:"url"`
Owner string `json:"owner" datastore:"owner"`
PipelineId string `json:"pipeline_id" datastore:"pipeline_id"`
TriggerId string `json:"trigger_id" datastore:"trigger_id"`
}
type PipelineWrapper struct {
Index string `json:"_index"`
Type string `json:"_type"`
ID string `json:"_id"`
Version int `json:"_version"`
Found bool `json:"found"`
Source Pipeline `json:"_source"`
}
type AllPipelinesWrapper struct {
Hits struct {
Total struct {
Value int `json:"value"`
Relation string `json:"relation"`
} `json:"total"`
Hits []struct {
Index string `json:"_index"`
ID string `json:"_id"`
Score float64 `json:"_score"`
Source Pipeline `json:"_source"`
} `json:"hits"`
} `json:"hits"`
}
type QueryInput struct {
// Required
Query string `json:"query" datastore:"query,noindex"`
// Output helpers
Id string `json:"id,omitempty"`
OutputFormat string `json:"output_format,omitempty"`
// App helpers
WorkflowId string `json:"workflow_id"`
AppName string `json:"app_name,omitempty"`
AppId string `json:"app_id,omitempty"`
Category string `json:"category,omitempty"`
ActionName string `json:"action_name,omitempty"`
Parameters []WorkflowAppActionParameter `json:"parameters,omitempty"`
// Optional Input Parameters for more context
AppContext []AppContext `json:"app_context,omitempty"`
UserId string `json:"user_id,omitempty"`
Username string `json:"username,omitempty"`
OrgId string `json:"org_id,omitempty"`
TimeStarted int64 `json:"time_started,omitempty"`
TimeEnded int64 `json:"time_ended,omitempty"`
Formatting string `json:"formatting,omitempty"`
Environment string `json:"environment,omitempty"`
ImageURL string `json:"image_url,omitempty"`
// For OpenAI assistant with Shuffle labels
ThreadId string `json:"thread_id,omitempty"`
RunId string `json:"run_id,omitempty"`
// For responses API
ResponseId string `json:"response_id,omitempty"`
// For chat history storage (extending the conversations index)
Role string `json:"role,omitempty" datastore:"role"` // "user", "assistant", or "system"
Response string `json:"response,omitempty" datastore:"response,noindex"` // AI's response content
ConversationId string `json:"conversation_id,omitempty" datastore:"conversation_id"` // Groups all messages in one chat together
}
type AtomicOutput struct {
Success bool `json:"success"`
Reason string `json:"reason"`
ThreadId string `json:"thread_id"` // Thread the assistant ran
RunId string `json:"run_id"` // Run ID for the thread
ToolCallID string `json:"tool_call_id,omitempty"` // Result inside the run
ResponseId string `json:"response_id,omitempty"` // Response ID
ConversationId string `json:"conversation_id,omitempty"` // Conversation ID
}
type ExecutionRequestWrapper struct {
Data []ExecutionRequest `json:"data"`
}
type ExecutionRequest struct {
ExecutionId string `json:"execution_id"`
ExecutionArgument string `json:"execution_argument"`
ExecutionSource string `json:"execution_source"`
WorkflowId string `json:"workflow_id"`
Environments []string `json:"environments"`
Authorization string `json:"authorization"`
Status string `json:"status"`
Start string `json:"start"`
Type string `json:"type"`
Priority int64 `json:"priority" datastore:"priority" yaml:"priority"` // Mapped back to workflowexecutions' priority
Authgroup string `json:"authgroup" datastore:"authgroup"`
}
type RetStruct struct {
Success bool `json:"success"`
SyncFeatures SyncFeatures `json:"sync_features"`
SessionKey string `json:"session_key"`
IntervalSeconds int64 `json:"interval_seconds"`
Subscriptions []PaymentSubscription `json:"subscriptions,omitempty"`
Licensed bool `json:"licensed"`
CloudSyncUrl string `json:"cloud_sync_url,omitempty"`
}
type AppMini struct {
Id string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
LargeImage string `json:"large_image"`
Authentication Authentication `json:"authentication"`
AuthenticationRequired bool `json:"authentication_required"`
ActionName string `json:"action_name,omitempty"`
Category string `json:"category,omitempty"`
}
type WorkflowApp struct {
Name string `json:"name" yaml:"name" required:true datastore:"name"`
AppVersion string `json:"app_version" yaml:"app_version" required:true datastore:"app_version"`
ID string `json:"id" yaml:"id,omitempty" required:false datastore:"id"`
Link string `json:"link" yaml:"link" required:false datastore:"link,noindex"`
IsValid bool `json:"is_valid" yaml:"is_valid" required:true datastore:"is_valid"`
Generated bool `json:"generated" yaml:"generated" required:false datastore:"generated"`
Downloaded bool `json:"downloaded" yaml:"downloaded" required:false datastore:"downloaded"`
Sharing bool `json:"sharing" yaml:"sharing" required:false datastore:"sharing"`
Verified bool `json:"verified" yaml:"verified" required:false datastore:"verified"`
Invalid bool `json:"invalid" yaml:"invalid" required:false datastore:"invalid"`
Activated bool `json:"activated" yaml:"activated" required:false datastore:"activated"`
Tested bool `json:"tested" yaml:"tested" required:false datastore:"tested"`
Hash string `json:"hash" datastore:"hash" yaml:"hash"` // api.yaml+dockerfile+src/app.py for apps
PrivateID string `json:"private_id" yaml:"private_id" required:false datastore:"private_id"`
Environment string `json:"environment" datastore:"environment" required:true yaml:"environment"`
SmallImage string `json:"small_image" datastore:"small_image,noindex" required:false yaml:"small_image"`
LargeImage string `json:"large_image" datastore:"large_image,noindex" yaml:"large_image" required:false`
ContactInfo struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Url string `json:"url" datastore:"url" yaml:"url"`
} `json:"contact_info" datastore:"contact_info" yaml:"contact_info" required:false`
FolderMount struct {
FolderMount bool `json:"folder_mount" datastore:"folder_mount"`
SourceFolder string `json:"source_folder" datastore:"source_folder"`
DestinationFolder string `json:"destination_folder" datastore:"destination_folder"`
} `json:"folder_mount" datastore:"folder_mount"`
Authentication Authentication `json:"authentication" yaml:"authentication" required:false datastore:"authentication"`
Actions []WorkflowAppAction `json:"actions" yaml:"actions" required:true datastore:"actions,noindex"`
Tags []string `json:"tags" yaml:"tags" required:false datastore:"activated"`
Categories []string `json:"categories" yaml:"categories" required:false datastore:"categories"`
Created int64 `json:"created" datastore:"created"`
Edited int64 `json:"edited" datastore:"edited"`
LastRuntime int64 `json:"last_runtime" datastore:"last_runtime"`
Versions []AppVersion `json:"versions" datastore:"versions"`
LoopVersions []string `json:"loop_versions" datastore:"loop_versions"`
Owner string `json:"owner" datastore:"owner" yaml:"owner"`
SharingConfig string `json:"sharing_config" yaml:"sharing_config" datastore:"sharing_config"`
Public bool `json:"public" datastore:"public"`
PublishedId string `json:"published_id" datastore:"published_id"`
ChildIds []string `json:"child_ids" datastore:"child_ids"`
ReferenceOrg string `json:"reference_org" datastore:"reference_org"`
ReferenceUrl string `json:"reference_url" datastore:"reference_url"`
ActionFilePath string `json:"action_file_path" datastore:"action_file_path"`
Template bool `json:"template" datastore:"template,noindex"`
Documentation string `json:"documentation" datastore:"documentation,noindex"`
Description string `json:"description" datastore:"description,noindex"`
DocumentationDownloadUrl string `json:"documentation_download_url" datastore:"documentation_download_url"`
PrimaryUsecases []string `json:"primary_usecases" yaml:"primary_usecases" datastore:"primary_usecases"`
SkippedBuild bool `json:"skipped_build" yaml:"skipped_build" required:false datastore:"skipped_build"`
//SelectedTemplate WorkflowApp `json:"selected_template" datastore:"selected_template,noindex"`
ReferenceInfo struct {
OnpremBackup bool `json:"onprem_backup" datastore:"onprem_backup"`
IsPartner bool `json:"is_partner" datastore:"is_partner"`
PartnerContacts string `json:"partner_contacts" datastore:"partner_contacts"`
DocumentationUrl string `json:"documentation_url" datastore:"documentation_url"`
GithubUrl string `json:"github_url" datastore:"github_url"`
Triggers []string `json:"triggers" datastore:"triggers"`
} `json:"reference_info" datastore:"reference_info"`
Blogpost string `json:"blogpost" yaml:"blogpost" datastore:"blogpost"`
Video string `json:"video" yaml:"video" datastore:"video"`
CompanyURL string `json:"company_url" datastore:"company_url" required:false yaml:"company_url"`
Contributors []string `json:"contributors" datastore:"contributors"`
RevisionId string `json:"revision_id" datastore:"revision_id"`
Collection string `json:"collection" datastore:"collection"`
}
type AppVersion struct {
Version string `json:"version" datastore:"version"`
ID string `json:"id" datastore:"id"`
}
type WorkflowAppActionParameter struct {
Description string `json:"description" datastore:"description,noindex" yaml:"description"`
ID string `json:"id" datastore:"id" yaml:"id,omitempty"`
Name string `json:"name" datastore:"name" yaml:"name"`
Example string `json:"example" datastore:"example,noindex" yaml:"example"`
Value string `json:"value" datastore:"value,noindex" yaml:"value,omitempty"`
Multiline bool `json:"multiline" datastore:"multiline" yaml:"multiline"`
Multiselect bool `json:"multiselect" datastore:"multiselect" yaml:"multiselect"`
Options []string `json:"options" datastore:"options" yaml:"options"`
ActionField string `json:"action_field" datastore:"action_field" yaml:"actionfield,omitempty"`
Variant string `json:"variant" datastore:"variant" yaml:"variant,omitempty"`
Required bool `json:"required" datastore:"required" yaml:"required"`
Configuration bool `json:"configuration" datastore:"configuration" yaml:"configuration"`
Tags []string `json:"tags" datastore:"tags" yaml:"tags"`
Schema SchemaDefinition `json:"schema" datastore:"schema" yaml:"schema"`
SkipMulticheck bool `json:"skip_multicheck" datastore:"skip_multicheck" yaml:"skip_multicheck"`
ValueReplace []Valuereplace `json:"value_replace" datastore:"value_replace,noindex" yaml:"value_replace,omitempty"`
UniqueToggled bool `json:"unique_toggled" datastore:"unique_toggled" yaml:"unique_toggled"`
Error string `json:"error" datastore:"error" yaml:"error"`
Hidden bool `json:"hidden" datastore:"hidden" yaml:"hidden"`
}
type Valuereplace struct {
Key string `json:"key" datastore:"key" yaml:"key"`
Value string `json:"value" datastore:"value,noindex" yaml:"value"`
// Used for e.g. user input storage
Answer string `json:"answer,omitempty" datastore:"answer,noindex" yaml:"answer,omitempty"`
Question string `json:"question,omitempty" datastore:"question,noindex" yaml:"question,omitempty"`
}
type WorkflowAppAction struct {
Description string `json:"description" datastore:"description,noindex"`
ID string `json:"id" datastore:"id" yaml:"id,omitempty"`
Name string `json:"name" datastore:"name"`
AppID string `json:"app_id" datastore:"app_id"`
AppName string `json:"app_name,omitempty" datastore:"app_name"`
AppVersion string `json:"app_version,omitempty" datastore:"app_version"`
Label string `json:"label" datastore:"label"`
NodeType string `json:"node_type" datastore:"node_type"`
Environment string `json:"environment" datastore:"environment"`
Sharing bool `json:"sharing" datastore:"sharing"`
PrivateID string `json:"private_id" datastore:"private_id"`
PublicID string `json:"public_id" datastore:"public_id"`
Tags []string `json:"tags" datastore:"tags" yaml:"tags"`
LargeImage string `json:"large_image" datastore:"large_image"`
Authentication []AuthenticationStore `json:"authentication" datastore:"authentication,noindex" yaml:"authentication,omitempty"`
Tested bool `json:"tested" datastore:"tested" yaml:"tested"`
Parameters []WorkflowAppActionParameter `json:"parameters" datastore: "parameters"`
InvalidParameters []WorkflowAppActionParameter `json:"previous_parameters,omitempty" datastore: "previous_parameters,noindex"`
ExecutionVariable Variable `json:"execution_variable" datastore:"execution_variables"`
Returns struct {
Description string `json:"description" datastore:"returns" yaml:"description,omitempty"`
Example string `json:"example" datastore:"example,noindex" yaml:"example"`
ID string `json:"id" datastore:"id" yaml:"id,omitempty"`
Schema SchemaDefinition `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"returns" datastore:"returns"`
AuthenticationId string `json:"authentication_id" datastore:"authentication_id"`
Example string `json:"example,noindex" datastore:"example" yaml:"example"`
AuthNotRequired bool `json:"auth_not_required" datastore:"auth_not_required" yaml:"auth_not_required"`
SourceWorkflow string `json:"source_workflow" yaml:"source_workflow" datastore:"source_workflow"`
RunMagicOutput bool `json:"run_magic_output" datastore:"run_magic_output" yaml:"run_magic_output"`
RunMagicInput bool `json:"run_magic_input" datastore:"run_magic_input" yaml:"run_magic_input"`
ExecutionDelay int64 `json:"execution_delay" datastore:"execution_delay"`
RequiredBodyFields []string `json:"required_body_fields" datastore:"required_body_fields"`
CategoryLabel []string `json:"category_label" datastore:"category_label"`
ExampleResponse string `json:"example_response" datastore:"example_response"`
}
type Authentication struct {
Type string `json:"type" datastore:"type" yaml:"type"`
Required bool `json:"required" datastore:"required" yaml:"required" `
Parameters []AuthenticationParams `json:"parameters" datastore:"parameters" yaml:"parameters"`
RedirectUri string `json:"redirect_uri" datastore:"redirect_uri" yaml:"redirect_uri"`
TokenUri string `json:"token_uri" datastore:"token_uri" yaml:"token_uri"`
RefreshUri string `json:"refresh_uri" datastore:"refresh_uri" yaml:"refresh_uri"`
Scope []string `json:"scope" datastore:"scope" yaml:"scope"`
ClientId string `json:"client_id" datastore:"client_id"`
ClientSecret string `json:"client_secret" datastore:"client_secret"`
GrantType string `json:"grant_type" datastore:"grant_type"`
}
type AuthenticationStore struct {
Key string `json:"key" datastore:"key"`
Value string `json:"value" datastore:"value,noindex"`
}
type AuthenticationParams struct {
Description string `json:"description" datastore:"description,noindex" yaml:"description"`
ID string `json:"id" datastore:"id" yaml:"id"`
Name string `json:"name" datastore:"name" yaml:"name"`
Example string `json:"example" datastore:"example,noindex" yaml:"example"`
Value string `json:"value,omitempty" datastore:"value,noindex" yaml:"value"`
Multiline bool `json:"multiline" datastore:"multiline" yaml:"multiline"`
Required bool `json:"required" datastore:"required" yaml:"required"`
In string `json:"in" datastore:"in" yaml:"in"`
Schema SchemaDefinition `json:"schema" datastore:"schema" yaml:"schema"`
Scheme string `json:"scheme" datastore:"scheme" yaml:"scheme"` // Deprecated
}
type AppExecutionExample struct {
AppName string `json:"app_name" datastore:"app_name"`
AppVersion string `json:"app_version" datastore:"app_version"`
AppAction string `json:"app_action" datastore:"app_action"`
AppId string `json:"app_id" datastore:"app_id"`
ExampleId string `json:"example_id" datastore:"example_id"`
SuccessExamples []string `json:"success_examples" datastore:"success_examples,noindex"`
FailureExamples []string `json:"failure_examples" datastore:"failure_examples,noindex"`
}
type SchemaDefinition struct {
Type string `json:"type" datastore:"type"`
Name string `json:"name,omitempty" datastore:"name"`
}
type Userapi struct {
Username string `datastore:"Username"`
ApiKey string `datastore:"apikey"`
}
type AppUsage struct {
AppName string `json:"app_name" datastore:"app_name"`
AppId string `json:"app_id" datastore:"app_id"`
Usage int64 `json:"usage" datastore:"usage"`
}
type IncrementInCache struct {
Amount uint64 `json:"amount" datastore:"amount"`
CreatedAt int64 `json:"created_at" datastore:"created_at"`
}
// Should be for a particular day
// Reset is handled during caching. If the date is not today, then the reset is handled
type DailyStatistics struct {
Date time.Time `json:"date" datastore:"date"`
AppExecutions int64 `json:"app_executions" datastore:"app_executions"`
ChildAppExecutions int64 `json:"child_app_executions" datastore:"child_app_executions"`
AppExecutionsFailed int64 `json:"app_executions_failed" datastore:"app_executions_failed"`
SubflowExecutions int64 `json:"subflow_executions" datastore:"subflow_executions"`
WorkflowExecutions int64 `json:"workflow_executions" datastore:"workflow_executions"`
WorkflowExecutionsFinished int64 `json:"workflow_executions_finished" datastore:"workflow_executions_finished"`
WorkflowExecutionsFailed int64 `json:"workflow_executions_failed" datastore:"workflow_executions_failed"`
OrgSyncActions int64 `json:"org_sync_actions" datastore:"org_sync_actions"`
CloudExecutions int64 `json:"cloud_executions" datastore:"cloud_executions"`
OnpremExecutions int64 `json:"onprem_executions" datastore:"onprem_executions"`
AIUsage int64 `json:"ai_executions" datastore:"ai_executions"`
ApiUsage int64 `json:"api_usage" datastore:"api_usage"`
AppUsage []AppUsage `json:"app_usage" datastore:"app_usage"`
Additions []AdditionalUseConfig `json:"additions,omitempty" datastore:"additions"`
}
// Used to be related to users, now related to orgs.
// Not directly, but being updated by org actions
type ExecutionInfo struct {
// These have been configured for cache updates in db-connector.go with 5 hour (300 minutes) timeouts before dumping
OrgId string `json:"org_id" datastore:"org_id"`
OrgName string `json:"org_name" datastore:"org_name"`
LastCleared int64 `json:"last_cleared" datastore:"last_cleared"`
DailyStatistics []DailyStatistics `json:"daily_statistics" datastore:"daily_statistics"`
OnpremStats []DailyStatistics `json:"onprem_stats,omitempty" datastore:"onprem_stats"`
TotalAppExecutions int64 `json:"total_app_executions" datastore:"total_app_executions"`
TotalChildAppExecutions int64 `json:"total_child_app_executions" datastore:"total_child_app_executions"`
TotalAppExecutionsFailed int64 `json:"total_app_executions_failed" datastore:"total_app_executions_failed"`
TotalSubflowExecutions int64 `json:"total_subflow_executions" datastore:"total_subflow_executions"`
TotalWorkflowExecutions int64 `json:"total_workflow_executions" datastore:"total_workflow_executions"`
TotalWorkflowExecutionsFinished int64 `json:"total_workflow_executions_finished" datastore:"total_workflow_executions_finished"`
TotalWorkflowExecutionsFailed int64 `json:"total_workflow_executions_failed" datastore:"total_workflow_executions_failed"`
TotalOrgSyncActions int64 `json:"total_org_sync_actions" datastore:"total_org_sync_actions"`
TotalCloudExecutions int64 `json:"total_cloud_executions" datastore:"total_cloud_executions"`
TotalOnpremExecutions int64 `json:"total_onprem_executions" datastore:"total_onprem_executions"`
TotalAIUsage int64 `json:"total_ai_executions" datastore:"total_ai_executions"`
TotalAgentExecutions int64 `json:"total_agent_executions" datastore:"total_agent_executions"`
TotalAgentTokens int64 `json:"total_agent_tokens" datastore:"total_agent_tokens"`
TotalAgentInputTokens int64 `json:"total_agent_input_tokens" datastore:"total_agent_input_tokens"`
TotalAgentOutputTokens int64 `json:"total_agent_output_tokens" datastore:"total_agent_output_tokens"`
TotalChildWorkflowExecutions int64 `json:"total_child_workflow_executions" datastore:"total_child_workflow_executions"`
MonthlyApiUsage int64 `json:"monthly_api_usage,omitempty" datastore:"monthly_api_usage"`
MonthlyChildAppExecutions int64 `json:"monthly_child_app_executions,omitempty" datastore:"monthly_child_app_executions"`
MonthlyAppExecutions int64 `json:"monthly_app_executions,omitempty" datastore:"monthly_app_executions"`
MonthlyAppExecutionsFailed int64 `json:"monthly_app_executions_failed,omitempty" datastore:"monthly_app_executions_failed"`
MonthlySubflowExecutions int64 `json:"monthly_subflow_executions,omitempty" datastore:"monthly_subflow_executions"`
MonthlyWorkflowExecutions int64 `json:"monthly_workflow_executions,omitempty" datastore:"monthly_workflow_executions"`
MonthlyChildWorkflowExecutions int64 `json:"monthly_child_workflow_executions,omitempty" datastore:"monthly_child_workflow_executions"`
MonthlyWorkflowExecutionsFinished int64 `json:"monthly_workflow_executions_finished,omitempty" datastore:"monthly_workflow_executions_finished"`
MonthlyWorkflowExecutionsFailed int64 `json:"monthly_workflow_executions_failed,omitempty" datastore:"monthly_workflow_executions_failed"`
MonthlyOrgSyncActions int64 `json:"monthly_org_sync_actions,omitempty" datastore:"monthly_org_sync_actions"`
MonthlyCloudExecutions int64 `json:"monthly_cloud_executions,omitempty" datastore:"monthly_cloud_executions"`
MonthlyOnpremExecutions int64 `json:"monthly_onprem_executions,omitempty" datastore:"monthly_onprem_executions"`
MonthlyAIUsage int64 `json:"monthly_ai_executions,omitempty" datastore:"monthly_ai_executions"`
MonthlyAgentExecutions int64 `json:"monthly_agent_executions,omitempty" datastore:"monthly_agent_executions"`
MonthlyAgentTokens int64 `json:"monthly_agent_tokens,omitempty" datastore:"monthly_agent_tokens"`
MonthlyAgentInputTokens int64 `json:"monthly_agent_input_tokens,omitempty" datastore:"monthly_agent_input_tokens"`
MonthlyAgentOutputTokens int64 `json:"monthly_agent_output_tokens,omitempty" datastore:"monthly_agent_output_tokens"`
WeeklyAppExecutions int64 `json:"weekly_app_executions,omitempty" datastore:"weekly_app_executions"`
WeeklyChildAppExecutions int64 `json:"weekly_child_app_executions,omitempty" datastore:"weekly_child_app_executions"`
WeeklyAppExecutionsFailed int64 `json:"weekly_app_executions_failed,omitempty" datastore:"weekly_app_executions_failed"`
WeeklySubflowExecutions int64 `json:"weekly_subflow_executions,omitempty" datastore:"weekly_subflow_executions"`
WeeklyWorkflowExecutions int64 `json:"weekly_workflow_executions,omitempty" datastore:"weekly_workflow_executions"`
WeeklyChildWorkflowExecutions int64 `json:"weekly_child_workflow_executions,omitempty" datastore:"weekly_child_workflow_executions"`
WeeklyWorkflowExecutionsFinished int64 `json:"weekly_workflow_executions_finished,omitempty" datastore:"weekly_workflow_executions_finished"`
WeeklyWorkflowExecutionsFailed int64 `json:"weekly_workflow_executions_failed,omitempty" datastore:"weekly_workflow_executions_failed"`
WeeklyOrgSyncActions int64 `json:"weekly_org_sync_actions,omitempty" datastore:"weekly_org_sync_actions"`
WeeklyCloudExecutions int64 `json:"weekly_cloud_executions,omitempty" datastore:"weekly_cloud_executions"`
WeeklyOnpremExecutions int64 `json:"weekly_onprem_executions,omitempty" datastore:"weekly_onprem_executions"`
WeeklyAIUsage int64 `json:"weekly_ai_executions,omitempty" datastore:"weekly_ai_executions"`
DailyAppExecutions int64 `json:"daily_app_executions" datastore:"daily_app_executions"`
DailyChildAppExecutions int64 `json:"daily_child_app_executions" datastore:"daily_child_app_executions"`
DailyAppExecutionsFailed int64 `json:"daily_app_executions_failed" datastore:"daily_app_executions_failed"`
DailySubflowExecutions int64 `json:"daily_subflow_executions" datastore:"daily_subflow_executions"`
DailyWorkflowExecutions int64 `json:"daily_workflow_executions" datastore:"daily_workflow_executions"`
DailyChildWorkflowExecutions int64 `json:"daily_child_workflow_executions" datastore:"daily_child_workflow_executions"`
DailyWorkflowExecutionsFinished int64 `json:"daily_workflow_executions_finished" datastore:"daily_workflow_executions_finished"`
DailyWorkflowExecutionsFailed int64 `json:"daily_workflow_executions_failed" datastore:"daily_workflow_executions_failed"`
DailyOrgSyncActions int64 `json:"daily_org_sync_actions" datastore:"daily_org_sync_actions"`
DailyCloudExecutions int64 `json:"daily_cloud_executions" datastore:"daily_cloud_executions"`
DailyOnpremExecutions int64 `json:"daily_onprem_executions" datastore:"daily_onprem_executions"`
DailyAIUsage int64 `json:"daily_ai_executions" datastore:"daily_ai_executions"`
DailyAgentExecutions int64 `json:"daily_agent_executions" datastore:"daily_agent_executions"`
DailyAgentTokens int64 `json:"daily_agent_tokens" datastore:"daily_agent_tokens"`
DailyAgentInputTokens int64 `json:"daily_agent_input_tokens" datastore:"daily_agent_input_tokens"`
DailyAgentOutputTokens int64 `json:"daily_agent_output_tokens" datastore:"daily_agent_output_tokens"`
HourlyAppExecutions int64 `json:"hourly_app_executions,omitempty" datastore:"hourly_app_executions"`
HourlyChildAppExecutions int64 `json:"hourly_child_app_executions,omitempty" datastore:"hourly_child_app_executions"`
HourlyAppExecutionsFailed int64 `json:"hourly_app_executions_failed,omitempty" datastore:"hourly_app_executions_failed"`
HourlySubflowExecutions int64 `json:"hourly_subflow_executions,omitempty" datastore:"hourly_subflow_executions"`
HourlyWorkflowExecutions int64 `json:"hourly_workflow_executions,omitempty" datastore:"hourly_workflow_executions"`
HourlyChildWorkflowExecutions int64 `json:"hourly_child_workflow_executions,omitempty" datastore:"hourly_child_workflow_executions"`
HourlyWorkflowExecutionsFinished int64 `json:"hourly_workflow_executions_finished,omitempty" datastore:"hourly_workflow_executions_finished"`
HourlyWorkflowExecutionsFailed int64 `json:"hourly_workflow_executions_failed,omitempty" datastore:"hourly_workflow_executions_failed"`
HourlyOrgSyncActions int64 `json:"hourly_org_sync_actions,omitempty" datastore:"hourly_org_sync_actions"`
HourlyCloudExecutions int64 `json:"hourly_cloud_executions,omitempty" datastore:"hourly_cloud_executions"`
HourlyOnpremExecutions int64 `json:"hourly_onprem_executions,omitempty" datastore:"hourly_onprem_executions"`
HourlyAIUsage int64 `json:"hourly_ai_executions,omitempty" datastore:"hourly_ai_executions"`
// These are just here in case we get use of them
TotalApiUsage int64 `json:"total_api_usage" datastore:"total_api_usage"`
DailyApiUsage int64 `json:"daily_api_usage" datastore:"daily_api_usage"`
Additions []AdditionalUseConfig `json:"additions,omitempty" datastore:"additions"`
LastMonthlyResetMonth int `json:"last_monthly_reset_month" datastore:"last_monthly_reset_month"`
LastUsageAlertThreshold int64 `json:"last_usage_alert_threshold" datastore:"last_usage_alert_threshold"`
UsageAlerts []AlertThreshold `json:"usage_alerts" datastore:"usage_alerts"`
}
type AdditionalUseConfig struct {
Key string `json:"key" datastore:"key"`
Value int64 `json:"value" datastore:"value"`
DailyValue int64 `json:"daily_value,omitempty" datastore:"daily_value"`
Date time.Time `json:"date,omitempty" datastore:"date"`
}
type ParsedOpenApi struct {
Body string `datastore:"body,noindex" json:"body"` // Maps to swagger/openapi>=3
ID string `datastore:"id" json:"id,omitempty"`
Success bool `datastore:"success,omitempty" json:"success,omitempty"`
}
// Limits set for a user so that they can't do a shitload
type UserLimits struct {
DailyApiUsage int64 `json:"daily_api_usage" datastore:"daily_api_usage"`
DailyWorkflowExecutions int64 `json:"daily_workflow_executions" datastore:"daily_workflow_executions"`
DailyCloudExecutions int64 `json:"daily_cloud_executions" datastore:"daily_cloud_executions"`
DailyTriggers int64 `json:"daily_triggers" datastore:"daily_triggers"`
DailyMailUsage int64 `json:"daily_mail_usage" datastore:"daily_mail_usage"`
MaxTriggers int64 `json:"max_triggers" datastore:"max_triggers"`
MaxWorkflows int64 `json:"max_workflows" datastore:"max_workflows"`
}
// FIXME: DONT FIX ME! If you add JSON object handling, it will break frontend.
type Environment struct {
Name string `datastore:"name"`
Type string `datastore:"type"`
Registered bool `datastore:"registered"`
Default bool `datastore:"default" json:"default"`
Archived bool `datastore:"archived" json:"archived"`
Id string `datastore:"id" json:"id"`
OrgId string `datastore:"org_id" json:"org_id"`
Created int64 `json:"created" datastore:"created"`
Edited int64 `json:"edited" datastore:"edited"`
Checkin int64 `json:"checkin" datastore:"checkin"`
RunningIp string `json:"running_ip" datastore:"running_ip"`
Auth string `json:"auth" datastore:"auth"`
Queue int `json:"queue" datastore:"queue"`
// Unique identifier to a single Orborus runtime
// This makes leader/follower model work for failovers
OrborusUuid string `json:"orborus_uuid" datastore:"orborus_uuid"`
//Licensed bool `json:"licensed" datastore:"licensed"`
RunType string `json:"run_type" datastore:"run_type"`
DataLake LakeConfig `json:"data_lake" datastore:"data_lake"`
SuborgDistribution []string `json:"suborg_distribution" datastore:"suborg_distribution"`
}
type LakeConfig struct {
Enabled bool `json:"enabled" datastore:"enabled"`
Pipelines []PipelineInfo `json:"pipelines" datastore:"pipelines"`
}
// Saves some data, not sure what to have here lol
type UserAuth struct {
Description string `json:"description" datastore:"description" yaml:"description"`
Name string `json:"name" datastore:"name" yaml:"name"`
Workflows []string `json:"workflows" datastore:"workflows"`
Username string `json:"username" datastore:"username"`
Fields []UserAuthField `json:"fields" datastore:"fields"`
}
type UserAuthField struct {
Key string `json:"key" datastore:"key"`
Value string `json:"value" datastore:"value,noindex"`
}
// Used to contain users in miniOrg
type UserMini struct {
Username string `datastore:"Username" json:"username"`
Id string `datastore:"id" json:"id"`
Role string `datastore:"role" json:"role"`
}
type MFAInfo struct {
Active bool `datastore:"active" json:"active"`
ActiveCode string `datastore:"active_code" json:"active_code"`
PreviousCode string `datastore:"previous_code" json:"previous_code"`
}
type PublicProfile struct {
Public bool `datastore:"public" json:"public"`
Self bool `datastore:"self" json:"self"`
GithubUsername string `datastore:"github_username" json:"github_username"`
GithubUserid string `datastore:"github_userid" json:"github_userid"`
GithubAvatar string `datastore:"github_avatar,noindex" json:"github_avatar"`
GithubLocation string `datastore:"github_location" json:"github_location"`
GithubUrl string `datastore:"github_url" json:"github_url"`
GithubBio string `datastore:"github_bio" json:"github_bio"`
GithubTwitter string `datastore:"github_twitter" json:"github_twitter"`
WorkStatus string `datastore:"work_status" json:"work_status"`
Banner string `datastore:"banner" json:"banner"`
GithubContributions GithubContributions `datastore:"github_contributions" json:"github_contributions"`
ShuffleEarnings string `datastore:"shuffle_earnings" json:"shuffle_earnings"`
ShuffleRanking string `datastore:"shuffle_ranking" json:"shuffle_ranking"`
Skills []string `json:"skills"`
Synonyms []string `json:"synonyms"`
Workflows int64 `json:"workflows"`
Apps int64 `json:"apps"`
SpecializedApps []MinimizedApps `json:"specialized_apps"`
Verified bool `json:"verified"`
Social []string `json:"social"`
}
type ContributionCount struct {
Count int64 `datastore:"contribution_count" json:"contribution_count"`
}
type GithubContributions struct {
Core ContributionCount `datastore:"core" json:"core"`
Workflows ContributionCount `datastore:"workflows" json:"workflows"`
Apps ContributionCount `datastore:"apps" json:"apps"`
Docs ContributionCount `datastore:"docs" json:"docs"`
}
type LoginInfo struct {
IP string `json:"ip" datastore:"ip"`
Timestamp int64 `json:"timestamp" datastore:"timestamp"`
}
type PersonalInfo struct {
Firstname string `datastore:"firstname" json:"firstname"`
Lastname string `datastore:"lastname" json:"lastname"`
Role string `datastore:"role" json:"role"`
Tutorials []string `datastore:"tutorials" json:"tutorials"`
}
type UserGeoInfo struct {
City struct {
Name string `datastore:"name" json:"name"`
} `datastore:"city" json:"city"`
State struct {
Name string `datastore:"name" json:"name"`
} `datastore:"state" json:"state"`
Country struct {
Name string `datastore:"name" json:"name"`
ISOCode string `datastore:"iso_code" json:"iso_code"`
} `datastore:"country" json:"country"`
}
type User struct {
Username string `datastore:"Username" json:"username"`
Password string `datastore:"password,noindex" password:"password,omitempty"`
Session string `datastore:"session" json:"session,omitempty"`
Verified bool `datastore:"verified,noindex" json:"verified"`
SupportAccess bool `datastore:"support_access" json:"support_access"`
PrivateApps []WorkflowApp `datastore:"privateapps" json:"privateapps":`
Role string `datastore:"role" json:"role"`
Roles []string `datastore:"roles" json:"roles"`
VerificationToken string `datastore:"verification_token" json:"verification_token"`
ApiKey string `datastore:"apikey" json:"apikey"`
ResetReference string `datastore:"reset_reference" json:"reset_reference"`
Executions ExecutionInfo `datastore:"executions" json:"executions"`
Limits UserLimits `datastore:"limits" json:"limits,omitempty"`
MFA MFAInfo `datastore:"mfa_info,noindex" json:"mfa_info"`
Authentication []UserAuth `datastore:"authentication,noindex" json:"authentication"`
ResetTimeout int64 `datastore:"reset_timeout,noindex" json:"reset_timeout"`
Id string `datastore:"id" json:"id"`
Orgs []string `datastore:"orgs" json:"orgs"`
CreationTime int64 `datastore:"creation_time" json:"creation_time"`
ActiveOrg OrgMini `json:"active_org" datastore:"active_org"`
Active bool `datastore:"active" json:"active"`
FirstSetup bool `datastore:"first_setup" json:"first_setup"`
LoginType string `datastore:"login_type" json:"login_type"`
GeneratedUsername string `datastore:"generated_username" json:"generated_username"`
SessionLogin bool `datastore:"session_login" json:"session_login"` // Whether it's a login with session or API (used to verify access)
ValidatedSessionOrgs []string `datastore:"validated_session_orgs" json:"validated_session_orgs"` // Orgs that have been used in the current session for the user
UsersLastSession string `datastore:"users_last_session" json:"users_last_session"`
Theme string `datastore:"theme" json:"theme"`
PublicProfile PublicProfile `datastore:"public_profile" json:"public_profile"`
// Tracking logins and such
LoginInfo []LoginInfo `datastore:"login_info" json:"login_info"`
PersonalInfo PersonalInfo `datastore:"personal_info" json:"personal_info"`
Regions []string `datastore:"regions" json:"regions"`
UserGeoInfo UserGeoInfo `datastore:"user_geo_info" json:"user_geo_info"`
// Old web3 integration
EthInfo EthInfo `datastore:"eth_info" json:"eth_info"`
SSOInfos []SSOInfo `datastore:"sso_infos" json:"sso_infos"`
ProvisionedByOrg string `datastore:"provisioned_by_org" json:"provisioned_by_org"`
}
type SSOInfo struct {
// active info for 1 org at a time.
Sub string `json:"sub"`
OrgID string `json:"org_id"`
ClientID string `json:"client_id"`
CodeVerifier string `json:"code_verifier"` // PKCE code verifier
ChallengeExpiry time.Time `json:"challenge_expiry"`
}
type EthInfo struct {
Account string `datastore:"account" json:"account"`
Balance string `datastore:"balance" json:"balance"`
}
type Session struct {
Username string `datastore:"Username,noindex"`
Id string `datastore:"Id,noindex"`
UserId string `datastore:"user_id,noindex"`
Session string `datastore:"session,noindex"`
}
type Contact struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Title string `json:"title"`
Companyname string `json:"companyname"`
Phone string `json:"phone"`
Email string `json:"email"`
ValidateEmail string `json:"validate_email"`
Message string `json:"message"`
DealType string `json:"dealtype"`
DealCountry string `json:"dealcountry"`
Category string `json:"Category"`
Interests []string `json:"interests"`
LegalAgreementsAccepted bool `json:"legal_agreements_accepted"`
PocTermsAccepted bool `json:"poc_terms_accepted"`
}
type Translator struct {
Src struct {
Name string `json:"name" datastore:"name"`
Value string `json:"value" datastore:"value,noindex"`
Description string `json:"description" datastore:"description"`
Required string `json:"required" datastore:"required"`
Type string `json:"type" datastore:"type"`
Schema struct {
Type string `json:"type" datastore:"type"`
} `json:"schema" datastore:"schema"`
} `json:"src" datastore:"src"`
Dst struct {
Name string `json:"name" datastore:"name"`
Value string `json:"value" datastore:"value,noindex"`
Type string `json:"type" datastore:"type"`
Description string `json:"description" datastore:"description"`
Required string `json:"required" datastore:"required"`
Schema struct {
Type string `json:"type" datastore:"type"`
} `json:"schema" datastore:"schema"`
} `json:"dst" datastore:"dst"`
}
type Appconfig struct {
Key string `json:"key" datastore:"key"`
Value string `json:"value" datastore:"value,noindex"`
}
type ScheduleApp struct {
Foldername string `json:"foldername" datastore:"foldername,noindex"`
Name string `json:"name" datastore:"name,noindex"`
Id string `json:"id" datastore:"id,noindex"`
Description string `json:"description" datastore:"description,noindex"`
Action string `json:"action" datastore:"action,noindex"`
Config []Appconfig `json:"config,omitempty" datastore:"config,noindex"`
}
type AppInfo struct {
SourceApp ScheduleApp `json:"sourceapp,omitempty" datastore:"sourceapp,noindex"`
DestinationApp ScheduleApp `json:"destinationapp,omitempty" datastore:"destinationapp,noindex"`
}
type ScheduleOld struct {
Name string `json:"name" datastore:"name"`
Id string `json:"id" datastore:"id"`
StartNode string `json:"start_node" datastore:"start_node"`
Seconds int `json:"seconds" datastore:"seconds"`
WorkflowId string `json:"workflow_id" datastore:"workflow_id", `
Argument string `json:"argument" datastore:"argument"`
WrappedArgument string `json:"wrapped_argument" datastore:"wrapped_argument"`
AppInfo AppInfo `json:"appinfo" datastore:"appinfo,noindex"`
Finished bool `json:"finished" finished:"id"`
BaseAppLocation string `json:"base_app_location" datastore:"baseapplocation,noindex"`
Translator []Translator `json:"translator,omitempty" datastore:"translator"`
Org string `json:"org" datastore:"org"`
CreatedBy string `json:"createdby" datastore:"createdby"`
Availability string `json:"availability" datastore:"availability"`
CreationTime int64 `json:"creationtime" datastore:"creationtime,noindex"`
LastModificationtime int64 `json:"lastmodificationtime" datastore:"lastmodificationtime,noindex"`
LastRuntime int64 `json:"lastruntime" datastore:"lastruntime,noindex"`
Frequency string `json:"frequency" datastore:"frequency,noindex"`
Environment string `json:"environment" datastore:"environment"`
Status string `json:"status" datastore:"status"`
}
// Returned from /GET /schedules
type Schedules struct {
Schedules []ScheduleOld `json:"schedules"`
Success bool `json:"success"`
}
type ScheduleApps struct {
Apps []ApiYaml `json:"apps"`
Success bool `json:"success"`
}
// Hmm
type ApiYaml struct {
Name string `json:"name" yaml:"name" required:"true datastore:"name"`
Foldername string `json:"foldername" yaml:"foldername" required:"true datastore:"foldername"`
Id string `json:"id" yaml:"id",required:"true, datastore:"id"`
Description string `json:"description" datastore:"description" yaml:"description"`
AppVersion string `json:"app_version" yaml:"app_version",datastore:"app_version"`
ContactInfo struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Url string `json:"url" datastore:"url" yaml:"url"`
} `json:"contact_info" datastore:"contact_info" yaml:"contact_info"`
Types []string `json:"types" datastore:"types" yaml:"types"`
Input []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
InputParameters []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"inputparameters" datastore:"inputparameters" yaml:"inputparameters"`
OutputParameters []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"outputparameters" datastore:"outputparameters" yaml:"outputparameters"`
Config []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"config" datastore:"config" yaml:"config"`
} `json:"input" datastore:"input" yaml:"input"`
Output []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Config []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"config" datastore:"config" yaml:"config"`
InputParameters []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"inputparameters" datastore:"inputparameters" yaml:"inputparameters"`
OutputParameters []struct {
Name string `json:"name" datastore:"name" yaml:"name"`
Description string `json:"description" datastore:"description" yaml:"description"`
Required string `json:"required" datastore:"required" yaml:"required"`
Schema struct {
Type string `json:"type" datastore:"type" yaml:"type"`
} `json:"schema" datastore:"schema" yaml:"schema"`
} `json:"outputparameters" datastore:"outputparameters" yaml:"outputparameters"`
} `json:"output" datastore:"output" yaml:"output"`
}
type Hooks struct {
Hooks []Hook `json:"hooks"`
Success bool `json:"-"`
}
type Info struct {
Url string `json:"url" datastore:"url"`
Name string `json:"name" datastore:"name"`
Description string `json:"description" datastore:"description"`
}
// Actions to be done by webhooks etc
// Field is the actual field to use from json
type HookAction struct {
Type string `json:"type" datastore:"type"`
Name string `json:"name" datastore:"name"`
Id string `json:"id" datastore:"id"`
Field string `json:"field" datastore:"field"`
}
type Hook struct {
Id string `json:"id" datastore:"id"`
Start string `json:"start" datastore:"start"`
Info Info `json:"info" datastore:"info"`
Actions []HookAction `json:"actions" datastore:"actions,noindex"`
Type string `json:"type" datastore:"type"`
Owner string `json:"owner" datastore:"owner"`
Status string `json:"status" datastore:"status"`
Workflows []string `json:"workflows" datastore:"workflows"`
Running bool `json:"running" datastore:"running"`
OrgId string `json:"org_id" datastore:"org_id"`
Environment string `json:"environment" datastore:"environment"`
Auth string `json:"auth" datastore:"auth"`
CustomResponse string `json:"custom_response" datastore:"custom_response"`
Version string `json:"version" datastore:"version"`
VersionTimeout int `json:"version_timeout" datastore:"version_timeout"`
}
type RegionBody struct {
DstRegion string `json:"dst_region"`
SrcRegion string `json:"src_region"`
OrgId string `json:"org_id"`
}
type OrgBranding struct {
EnableChat bool `json:"enable_chat" datastore:"enable_chat"`
HomeUrl string `json:"home_url" datastore:"home_url"`
Theme string `json:"theme" datastore:"theme"`
DocumentationLink string `json:"documentation_link" datastore:"documentation_link"`
GlobalUser bool `json:"global_user" datastore:"global_user"` // Global user is true when the user is admin of both parent org and suborg.
SupportEmail string `json:"support_email" datastore:"support_email"`
LogoutUrl string `json:"logout_url" datastore:"logout_url"`
BrandColor string `json:"brand_color" datastore:"brand_color"`
BrandName string `json:"brand_name" datastore:"brand_name"`
}
// Used within a user
type OrgMini struct {
Name string `json:"name" datastore:"name"`
Id string `json:"id" datastore:"id"`
Users []UserMini `json:"users" datastore:"users"`
Role string `json:"role" datastore:"role"`
ChildOrgs []OrgMini `json:"child_orgs" datastore:"child_orgs"`
RegionUrl string `json:"region_url" datastore:"region_url"`
IsPartner bool `json:"is_partner" datastore:"is_partner"`
// Branding related
Image string `json:"image" datastore:"image,noindex"`
CreatorOrg string `json:"creator_org" datastore:"creator_org"`
Branding OrgBranding `json:"branding" datastore:"branding"`
}
type Priority struct {
Name string `json:"name" datastore:"name"`
Description string `json:"description" datastore:"description"`
Type string `json:"type" datastore:"type"`
Active bool `json:"active" datastore:"active"`
URL string `json:"url" datastore:"url"`
Severity int `json:"severity" datastore:"severity"` // 1 = high, 2 = mid, 3 = low
Time int64 `json:"time" datastore:"time"`
}
type LeadInfo struct {
Contacted bool `json:"contacted,omitempty" datastore:"contacted"`
Student bool `json:"student,omitempty" datastore:"student"`
Lead bool `json:"lead,omitempty" datastore:"lead"`
POV bool `json:"pov,omitempty" datastore:"pov"`
TestingShuffle bool `json:"testing_shuffle,omitempty" datastore:"testing_shuffle"`
DemoDone bool `json:"demo_done,omitempty" datastore:"demo_done"`
Customer bool `json:"customer,omitempty" datastore:"customer"`
OpenSource bool `json:"opensource,omitempty" datastore:"opensource"`
Internal bool `json:"internal,omitempty" datastore:"internal"`
SubOrg bool `json:"sub_org,omitempty" datastore:"sub_org"`
OldCustomer bool `json:"old_customer,omitempty" datastore:"old_customer"`
OldLead bool `json:"old_lead,omitempty" datastore:"old_lead"`
TechPartner bool `json:"tech_partner,omitempty" datastore:"tech_partner"`
IntegrationPartner bool `json:"integration_partner,omitempty" datastore:"integration_partner"`
DistributionPartner bool `json:"distribution_partner,omitempty" datastore:"distribution_partner"`
ServicePartner bool `json:"service_partner,omitempty" datastore:"service_partner"`
ChannelPartner bool `json:"channel_partner,omitempty" datastore:"channel_partner"`
Creator bool `json:"creator,omitempty" datastore:"creator"`
}
// Partners Structs
type PartnerType struct {
TechPartner bool `json:"tech_partner,omitempty" datastore:"tech_partner"`
IntegrationPartner bool `json:"integration_partner,omitempty" datastore:"integration_partner"`