@epilot/entity-client 2.4.3 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openapi.json CHANGED
@@ -819,6 +819,295 @@
819
819
  }
820
820
  }
821
821
  }
822
+ },
823
+ "/v1/entity/{slug}/{id}/relations": {
824
+ "get": {
825
+ "operationId": "getRelations",
826
+ "summary": "getRelations",
827
+ "description": "It loads 1st level relations for the mentioned entity. You can control whether entire related entity is loaded or not via hydrate param.",
828
+ "tags": [
829
+ "Relations"
830
+ ],
831
+ "parameters": [
832
+ {
833
+ "in": "path",
834
+ "name": "slug",
835
+ "description": "Entity Type",
836
+ "required": true,
837
+ "schema": {
838
+ "$ref": "#/components/schemas/EntitySlug"
839
+ }
840
+ },
841
+ {
842
+ "in": "path",
843
+ "name": "id",
844
+ "description": "Entity id",
845
+ "required": true,
846
+ "schema": {
847
+ "$ref": "#/components/schemas/EntityId"
848
+ }
849
+ },
850
+ {
851
+ "in": "query",
852
+ "name": "hydrate",
853
+ "description": "When true, expand relation items with full blown entities.",
854
+ "schema": {
855
+ "default": false,
856
+ "type": "boolean"
857
+ }
858
+ }
859
+ ],
860
+ "responses": {
861
+ "200": {
862
+ "description": "Success",
863
+ "content": {
864
+ "application/json": {
865
+ "schema": {
866
+ "$ref": "#/components/schemas/GetRelationsResp"
867
+ },
868
+ "example": [
869
+ {
870
+ "attribute": "contacts",
871
+ "entity_id": "ed27830b-984c-4bca-9b87-2849bb5789ca",
872
+ "_tags": [
873
+ "primary",
874
+ "billing"
875
+ ]
876
+ },
877
+ {
878
+ "attribute": "contacts",
879
+ "entity_id": "fadfc950-6e43-4e38-bae0-ffcf4b8b90e1"
880
+ },
881
+ {
882
+ "_id": "9924c4de-d3ed-4752-821d-fc0b9bd57c1b",
883
+ "order_number": "a34234jd",
884
+ "customer_email": "johndoe@epilot.cloud",
885
+ "billing_first_name": "john",
886
+ "billing_last_name": "doe",
887
+ "billing_company_name": "ePilot Gmbh",
888
+ "billing_vat": "234823948,",
889
+ "billing_email": "johndoe@nowhere.com",
890
+ "billing_phone": "1234234545,",
891
+ "billing_address": "wallstreet, 1",
892
+ "billing_contact": "villy or zilly",
893
+ "$relation": {
894
+ "attribute": "orders",
895
+ "entity_id": "9924c4de-d3ed-4752-821d-fc0b9bd57c1b",
896
+ "_tags": [
897
+ "solar_panel",
898
+ "one_time"
899
+ ]
900
+ }
901
+ }
902
+ ]
903
+ }
904
+ }
905
+ }
906
+ }
907
+ },
908
+ "post": {
909
+ "operationId": "addRelations",
910
+ "summary": "addRelations",
911
+ "description": "It relates one or more entities to some parent entity, by providing meaning for relations via attribute field.",
912
+ "tags": [
913
+ "Relations"
914
+ ],
915
+ "parameters": [
916
+ {
917
+ "in": "path",
918
+ "name": "slug",
919
+ "description": "Entity Type",
920
+ "required": true,
921
+ "schema": {
922
+ "$ref": "#/components/schemas/EntitySlug"
923
+ }
924
+ },
925
+ {
926
+ "in": "path",
927
+ "name": "id",
928
+ "description": "Entity id",
929
+ "required": true,
930
+ "schema": {
931
+ "$ref": "#/components/schemas/EntityId"
932
+ }
933
+ }
934
+ ],
935
+ "requestBody": {
936
+ "content": {
937
+ "application/json": {
938
+ "schema": {
939
+ "type": "array",
940
+ "items": {
941
+ "$ref": "#/components/schemas/RelationItem"
942
+ }
943
+ },
944
+ "example": [
945
+ {
946
+ "attribute": "contacts",
947
+ "entity_id": "e8878f62-2d3d-4c86-bfe7-01a4180ff048",
948
+ "_tags": [
949
+ "billing"
950
+ ]
951
+ },
952
+ {
953
+ "attribute": "contacts",
954
+ "entity_id": "ee8a2af9-fb36-4981-b848-4e65275851af"
955
+ },
956
+ {
957
+ "attribute": "opportunities",
958
+ "entity_id": "30990430-a53d-41a2-83db-2de072dc4dd4"
959
+ }
960
+ ]
961
+ }
962
+ }
963
+ },
964
+ "responses": {
965
+ "200": {
966
+ "description": "Success",
967
+ "content": {
968
+ "application/json": {
969
+ "schema": {
970
+ "$ref": "#/components/schemas/RelationItem"
971
+ }
972
+ }
973
+ }
974
+ }
975
+ }
976
+ }
977
+ },
978
+ "/v1/entity/{slug}/{id}/relations/{attribute}/{entity_id}": {
979
+ "put": {
980
+ "operationId": "updateRelation",
981
+ "summary": "updateRelation",
982
+ "description": "It updates a relation between two entities.",
983
+ "tags": [
984
+ "Relations"
985
+ ],
986
+ "parameters": [
987
+ {
988
+ "in": "path",
989
+ "name": "slug",
990
+ "description": "Entity Type",
991
+ "required": true,
992
+ "schema": {
993
+ "$ref": "#/components/schemas/EntitySlug"
994
+ }
995
+ },
996
+ {
997
+ "in": "path",
998
+ "name": "id",
999
+ "description": "Entity id",
1000
+ "required": true,
1001
+ "schema": {
1002
+ "$ref": "#/components/schemas/EntityId"
1003
+ }
1004
+ },
1005
+ {
1006
+ "in": "path",
1007
+ "name": "attribute",
1008
+ "description": "The attribute that express meaning",
1009
+ "required": true,
1010
+ "schema": {
1011
+ "type": "string"
1012
+ }
1013
+ },
1014
+ {
1015
+ "in": "path",
1016
+ "name": "entity_id",
1017
+ "description": "The attribute that express meaning",
1018
+ "required": true,
1019
+ "schema": {
1020
+ "type": "string"
1021
+ }
1022
+ }
1023
+ ],
1024
+ "requestBody": {
1025
+ "content": {
1026
+ "application/json": {
1027
+ "schema": {
1028
+ "type": "object",
1029
+ "properties": {
1030
+ "_tags": {
1031
+ "type": "array",
1032
+ "items": {
1033
+ "type": "string"
1034
+ }
1035
+ }
1036
+ }
1037
+ },
1038
+ "example": {
1039
+ "_tags": [
1040
+ "billing",
1041
+ "prepaid"
1042
+ ]
1043
+ }
1044
+ }
1045
+ }
1046
+ },
1047
+ "responses": {
1048
+ "200": {
1049
+ "description": "Success",
1050
+ "content": {
1051
+ "application/json": {
1052
+ "schema": {
1053
+ "$ref": "#/components/schemas/RelationItem"
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+ },
1060
+ "delete": {
1061
+ "operationId": "deleteRelation",
1062
+ "summary": "deleteRelation",
1063
+ "description": "It deletes a relation between one entity and the other.",
1064
+ "tags": [
1065
+ "Relations"
1066
+ ],
1067
+ "parameters": [
1068
+ {
1069
+ "in": "path",
1070
+ "name": "slug",
1071
+ "description": "Entity Type",
1072
+ "required": true,
1073
+ "schema": {
1074
+ "$ref": "#/components/schemas/EntitySlug"
1075
+ }
1076
+ },
1077
+ {
1078
+ "in": "path",
1079
+ "name": "id",
1080
+ "description": "Entity id",
1081
+ "required": true,
1082
+ "schema": {
1083
+ "$ref": "#/components/schemas/EntityId"
1084
+ }
1085
+ },
1086
+ {
1087
+ "in": "path",
1088
+ "name": "attribute",
1089
+ "description": "The attribute that express meaning",
1090
+ "required": true,
1091
+ "schema": {
1092
+ "type": "string"
1093
+ }
1094
+ },
1095
+ {
1096
+ "in": "path",
1097
+ "name": "entity_id",
1098
+ "description": "The attribute that express meaning",
1099
+ "required": true,
1100
+ "schema": {
1101
+ "type": "string"
1102
+ }
1103
+ }
1104
+ ],
1105
+ "responses": {
1106
+ "204": {
1107
+ "description": "Relation deleted with success."
1108
+ }
1109
+ }
1110
+ }
822
1111
  }
823
1112
  },
824
1113
  "components": {
@@ -950,6 +1239,10 @@
950
1239
  }
951
1240
  }
952
1241
  },
1242
+ "dialog_config": {
1243
+ "type": "object",
1244
+ "additionalProperties": true
1245
+ },
953
1246
  "attributes": {
954
1247
  "description": "An ordered list of attributes the entity contains",
955
1248
  "type": "array",
@@ -999,6 +1292,9 @@
999
1292
  "label": "Image"
1000
1293
  }
1001
1294
  ]
1295
+ },
1296
+ "explicit_search_mappings": {
1297
+ "$ref": "#/components/schemas/SearchMappings"
1002
1298
  }
1003
1299
  },
1004
1300
  "required": [
@@ -2200,6 +2496,55 @@
2200
2496
  }
2201
2497
  ]
2202
2498
  },
2499
+ "GetRelationsResp": {
2500
+ "type": "array",
2501
+ "items": {
2502
+ "anyOf": [
2503
+ {
2504
+ "$ref": "#/components/schemas/RelationItem"
2505
+ },
2506
+ {
2507
+ "$ref": "#/components/schemas/RelationEntity"
2508
+ }
2509
+ ]
2510
+ }
2511
+ },
2512
+ "RelationEntity": {
2513
+ "allOf": [
2514
+ {
2515
+ "$ref": "#/components/schemas/BaseEntity"
2516
+ },
2517
+ {
2518
+ "type": "object",
2519
+ "properties": {
2520
+ "$relation": {
2521
+ "$ref": "#/components/schemas/RelationItem"
2522
+ }
2523
+ }
2524
+ }
2525
+ ]
2526
+ },
2527
+ "RelationItem": {
2528
+ "type": "object",
2529
+ "properties": {
2530
+ "entity_id": {
2531
+ "$ref": "#/components/schemas/EntityId"
2532
+ },
2533
+ "attribute": {
2534
+ "type": "string"
2535
+ },
2536
+ "_tags": {
2537
+ "type": "array",
2538
+ "items": {
2539
+ "type": "string"
2540
+ }
2541
+ }
2542
+ },
2543
+ "required": [
2544
+ "entity_id",
2545
+ "attribute"
2546
+ ]
2547
+ },
2203
2548
  "EntitySearchParams": {
2204
2549
  "type": "object",
2205
2550
  "properties": {
@@ -2238,14 +2583,6 @@
2238
2583
  "_title",
2239
2584
  "first_name"
2240
2585
  ]
2241
- },
2242
- "expand": {
2243
- "deprecated": true,
2244
- "type": "array",
2245
- "description": "Deprecated. Use hydrate=true instead",
2246
- "items": {
2247
- "type": "string"
2248
- }
2249
2586
  }
2250
2587
  },
2251
2588
  "required": [
@@ -2267,6 +2604,42 @@
2267
2604
  }
2268
2605
  }
2269
2606
  },
2607
+ "SearchMappings": {
2608
+ "description": "Advanced: explicit Elasticsearch index mapping definitions for entity data\n",
2609
+ "example": {
2610
+ "image": {
2611
+ "type": "keyword",
2612
+ "index": false
2613
+ }
2614
+ },
2615
+ "type": "object",
2616
+ "additionalProperties": {
2617
+ "type": "object",
2618
+ "properties": {
2619
+ "index": {
2620
+ "type": "boolean",
2621
+ "default": true
2622
+ },
2623
+ "type": {
2624
+ "type": "string",
2625
+ "enum": [
2626
+ "keyword",
2627
+ "text",
2628
+ "boolean",
2629
+ "integer",
2630
+ "long",
2631
+ "float",
2632
+ "date",
2633
+ "flattened",
2634
+ "nested"
2635
+ ]
2636
+ },
2637
+ "fields": {
2638
+ "additionalProperties": true
2639
+ }
2640
+ }
2641
+ }
2642
+ },
2270
2643
  "ActivityId": {
2271
2644
  "type": "string",
2272
2645
  "format": "ulid",
@@ -2367,9 +2740,17 @@
2367
2740
  "entity": {
2368
2741
  "$ref": "#/components/schemas/EntityId"
2369
2742
  },
2743
+ "org": {
2744
+ "type": "string",
2745
+ "example": "123"
2746
+ },
2370
2747
  "operation": {
2371
2748
  "type": "string",
2372
- "example": "updateEntity"
2749
+ "enum": [
2750
+ "createEntity",
2751
+ "updateEntity",
2752
+ "deleteEntity"
2753
+ ]
2373
2754
  },
2374
2755
  "params": {
2375
2756
  "type": "object",
@@ -2403,7 +2784,8 @@
2403
2784
  },
2404
2785
  "required": [
2405
2786
  "entity",
2406
- "name"
2787
+ "org",
2788
+ "operation"
2407
2789
  ]
2408
2790
  },
2409
2791
  "ActivityItem": {