@epilot/entity-client 4.10.0 → 4.10.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
@@ -25,6 +25,14 @@
25
25
  {
26
26
  "name": "Export",
27
27
  "description": "Export and Import entities via files"
28
+ },
29
+ {
30
+ "name": "Saved Views",
31
+ "description": "Saved Views for Entities"
32
+ },
33
+ {
34
+ "name": "Taxonomy",
35
+ "description": "Entity classification with Taxonomies"
28
36
  }
29
37
  ],
30
38
  "security": [
@@ -40,12 +48,12 @@
40
48
  "get": {
41
49
  "operationId": "listSchemas",
42
50
  "summary": "listSchemas",
43
- "description": "Get the latest version of local schema",
51
+ "description": "Get the latest versions of all schemas",
44
52
  "parameters": [
45
53
  {
46
54
  "in": "query",
47
55
  "name": "unpublished",
48
- "description": "Includes the unpublished version of unpublished schema",
56
+ "description": "Return unpublished draft schemas",
49
57
  "schema": {
50
58
  "type": "boolean",
51
59
  "default": false
@@ -77,41 +85,11 @@
77
85
  }
78
86
  }
79
87
  },
80
- "/v1/entity/schemas/blueprints": {
81
- "get": {
82
- "operationId": "listSchemaBlueprints",
83
- "summary": "listSchemaBlueprints",
84
- "description": "List canonical versions of all available schemas",
85
- "tags": [
86
- "Schemas"
87
- ],
88
- "responses": {
89
- "200": {
90
- "description": "Success",
91
- "content": {
92
- "application/json": {
93
- "schema": {
94
- "type": "object",
95
- "properties": {
96
- "results": {
97
- "type": "array",
98
- "items": {
99
- "$ref": "#/components/schemas/EntitySchemaItem"
100
- }
101
- }
102
- }
103
- }
104
- }
105
- }
106
- }
107
- }
108
- }
109
- },
110
- "/v1/entity/schemas/{slug}/versions": {
88
+ "/v1/entity/schemas/{slug}": {
111
89
  "get": {
112
- "operationId": "getSchemaVersions",
113
- "summary": "getSchemaVersions",
114
- "description": "Get all versions of this schema ordered by the latest versions including drafts.",
90
+ "operationId": "getSchema",
91
+ "summary": "getSchema",
92
+ "description": "By default gets the latest version of the Schema and to get the specific version of schema pass the id.",
115
93
  "tags": [
116
94
  "Schemas"
117
95
  ],
@@ -123,6 +101,13 @@
123
101
  "schema": {
124
102
  "$ref": "#/components/schemas/EntitySlug"
125
103
  }
104
+ },
105
+ {
106
+ "in": "query",
107
+ "name": "id",
108
+ "schema": {
109
+ "$ref": "#/components/schemas/SchemaId"
110
+ }
126
111
  }
127
112
  ],
128
113
  "responses": {
@@ -131,33 +116,17 @@
131
116
  "content": {
132
117
  "application/json": {
133
118
  "schema": {
134
- "type": "object",
135
- "properties": {
136
- "versions": {
137
- "type": "array",
138
- "items": {
139
- "$ref": "#/components/schemas/EntitySchemaItem"
140
- }
141
- },
142
- "drafts": {
143
- "type": "array",
144
- "items": {
145
- "$ref": "#/components/schemas/EntitySchemaItem"
146
- }
147
- }
148
- }
119
+ "$ref": "#/components/schemas/EntitySchemaItem"
149
120
  }
150
121
  }
151
122
  }
152
123
  }
153
124
  }
154
- }
155
- },
156
- "/v1/entity/schemas/{slug}": {
157
- "get": {
158
- "operationId": "getSchema",
159
- "summary": "getSchema",
160
- "description": "By default gets the latest version of the Schema and to get the specific version of schema pass the id.",
125
+ },
126
+ "put": {
127
+ "operationId": "putSchema",
128
+ "summary": "putSchema",
129
+ "description": "Create or update a schema with a new version",
161
130
  "tags": [
162
131
  "Schemas"
163
132
  ],
@@ -172,12 +141,22 @@
172
141
  },
173
142
  {
174
143
  "in": "query",
175
- "name": "id",
144
+ "name": "draft",
176
145
  "schema": {
177
- "$ref": "#/components/schemas/SchemaId"
146
+ "default": false,
147
+ "type": "boolean"
178
148
  }
179
149
  }
180
150
  ],
151
+ "requestBody": {
152
+ "content": {
153
+ "application/json": {
154
+ "schema": {
155
+ "$ref": "#/components/schemas/EntitySchema"
156
+ }
157
+ }
158
+ }
159
+ },
181
160
  "responses": {
182
161
  "200": {
183
162
  "description": "Success",
@@ -191,10 +170,10 @@
191
170
  }
192
171
  }
193
172
  },
194
- "put": {
195
- "operationId": "createNewSchemaVersion",
196
- "summary": "createNewSchemaVersion",
197
- "description": "Create new version of the schema and default draft is false.",
173
+ "delete": {
174
+ "operationId": "deleteSchema",
175
+ "summary": "deleteSchema",
176
+ "description": "Delete a schema, or a specific version of a schema",
198
177
  "tags": [
199
178
  "Schemas"
200
179
  ],
@@ -206,42 +185,96 @@
206
185
  "schema": {
207
186
  "$ref": "#/components/schemas/EntitySlug"
208
187
  }
209
- },
188
+ }
189
+ ],
190
+ "responses": {
191
+ "204": {
192
+ "description": "Success"
193
+ }
194
+ }
195
+ }
196
+ },
197
+ "/v1/entity/schemas/{slug}/versions": {
198
+ "get": {
199
+ "operationId": "getSchemaVersions",
200
+ "summary": "getSchemaVersions",
201
+ "description": "Get all versions of this schema ordered by the latest versions including drafts.",
202
+ "tags": [
203
+ "Schemas"
204
+ ],
205
+ "parameters": [
210
206
  {
211
- "in": "query",
212
- "name": "draft",
207
+ "in": "path",
208
+ "name": "slug",
209
+ "required": true,
213
210
  "schema": {
214
- "default": false,
215
- "type": "boolean"
211
+ "$ref": "#/components/schemas/EntitySlug"
216
212
  }
217
213
  }
218
214
  ],
219
- "requestBody": {
220
- "content": {
221
- "application/json": {
222
- "schema": {
223
- "$ref": "#/components/schemas/EntitySchema"
215
+ "responses": {
216
+ "200": {
217
+ "description": "Success",
218
+ "content": {
219
+ "application/json": {
220
+ "schema": {
221
+ "type": "object",
222
+ "properties": {
223
+ "versions": {
224
+ "type": "array",
225
+ "items": {
226
+ "$ref": "#/components/schemas/EntitySchemaItem"
227
+ }
228
+ },
229
+ "drafts": {
230
+ "type": "array",
231
+ "items": {
232
+ "$ref": "#/components/schemas/EntitySchemaItem"
233
+ }
234
+ }
235
+ }
236
+ }
224
237
  }
225
238
  }
226
239
  }
227
- },
240
+ }
241
+ }
242
+ },
243
+ "/v1/entity/schemas/blueprints": {
244
+ "get": {
245
+ "operationId": "listSchemaBlueprints",
246
+ "summary": "listSchemaBlueprints",
247
+ "description": "List canonical versions of all available schemas",
248
+ "tags": [
249
+ "Schemas"
250
+ ],
228
251
  "responses": {
229
252
  "200": {
230
253
  "description": "Success",
231
254
  "content": {
232
255
  "application/json": {
233
256
  "schema": {
234
- "$ref": "#/components/schemas/EntitySchemaItem"
257
+ "type": "object",
258
+ "properties": {
259
+ "results": {
260
+ "type": "array",
261
+ "items": {
262
+ "$ref": "#/components/schemas/EntitySchemaItem"
263
+ }
264
+ }
265
+ }
235
266
  }
236
267
  }
237
268
  }
238
269
  }
239
270
  }
240
- },
241
- "delete": {
242
- "operationId": "deleteSchemaById",
243
- "summary": "deleteSchemaById",
244
- "description": "Delete schema by Id",
271
+ }
272
+ },
273
+ "/v1/entity/schemas/{slug}/taxonomy/{taxonomySlug}": {
274
+ "get": {
275
+ "operationId": "listTaxonomyClassificationsForSchema",
276
+ "summary": "listTaxonomyClassificationsForSchema",
277
+ "description": "List taxonomy classifications for a given schema",
245
278
  "tags": [
246
279
  "Schemas"
247
280
  ],
@@ -255,17 +288,46 @@
255
288
  }
256
289
  },
257
290
  {
258
- "in": "query",
259
- "name": "id",
291
+ "in": "path",
292
+ "name": "taxonomySlug",
260
293
  "required": true,
261
294
  "schema": {
262
- "$ref": "#/components/schemas/SchemaId"
295
+ "$ref": "#/components/schemas/TaxonomySlug"
296
+ }
297
+ },
298
+ {
299
+ "in": "query",
300
+ "name": "query",
301
+ "schema": {
302
+ "type": "string"
303
+ }
304
+ },
305
+ {
306
+ "in": "query",
307
+ "name": "size",
308
+ "schema": {
309
+ "type": "number"
263
310
  }
264
311
  }
265
312
  ],
266
313
  "responses": {
267
- "204": {
268
- "description": "Success"
314
+ "200": {
315
+ "description": "List of taxonomy classifications",
316
+ "content": {
317
+ "application/json": {
318
+ "schema": {
319
+ "type": "object",
320
+ "properties": {
321
+ "results": {
322
+ "type": "array",
323
+ "items": {
324
+ "$ref": "#/components/schemas/TaxonomyClassification"
325
+ }
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
269
331
  }
270
332
  }
271
333
  }
@@ -332,6 +394,16 @@
332
394
  "schema": {
333
395
  "$ref": "#/components/schemas/ActivityId"
334
396
  }
397
+ },
398
+ {
399
+ "in": "query",
400
+ "name": "async",
401
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
402
+ "required": false,
403
+ "schema": {
404
+ "type": "boolean",
405
+ "default": false
406
+ }
335
407
  }
336
408
  ],
337
409
  "requestBody": {
@@ -428,6 +500,16 @@
428
500
  "type": "boolean",
429
501
  "default": false
430
502
  }
503
+ },
504
+ {
505
+ "in": "query",
506
+ "name": "async",
507
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
508
+ "required": false,
509
+ "schema": {
510
+ "type": "boolean",
511
+ "default": false
512
+ }
431
513
  }
432
514
  ],
433
515
  "requestBody": {
@@ -580,6 +662,16 @@
580
662
  "schema": {
581
663
  "$ref": "#/components/schemas/ActivityId"
582
664
  }
665
+ },
666
+ {
667
+ "in": "query",
668
+ "name": "async",
669
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
670
+ "required": false,
671
+ "schema": {
672
+ "type": "boolean",
673
+ "default": false
674
+ }
583
675
  }
584
676
  ],
585
677
  "requestBody": {
@@ -605,10 +697,10 @@
605
697
  }
606
698
  }
607
699
  },
608
- "delete": {
609
- "operationId": "deleteEntity",
610
- "summary": "deleteEntity",
611
- "description": "Deletes an Entity\n\n## Activity\n\nIf no `activity_id` query parameter is provided, implicitly creates Activity of type `EntityDeleted`\n",
700
+ "patch": {
701
+ "operationId": "patchEntity",
702
+ "summary": "patchEntity",
703
+ "description": "Partially updates an entity with the passed in entity data.\n\n- If an _updated_at is passed and the server contains a newer version of the entity a `409` Error is returned\n\n## Activity\n\nIf no `activity_id` query parameter is provided, implicitly creates Activity of type `EntityUpdated`\n\n## Relations\n\nTo create a relation, store a property that defines a `$relation` array.\n\nExample:\n\n```json\n{\n \"contacts\": {\n \"$relation\": [\n { \"entity_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\" }\n ]\n }\n}\n```\n\nThe items in `$relation` support two properties:\n- `entity_id` - The ID of the entity to link\n- `_tags` - Tags or labels for the relation (optional)\n",
612
704
  "tags": [
613
705
  "Entities"
614
706
  ],
@@ -616,7 +708,7 @@
616
708
  {
617
709
  "in": "path",
618
710
  "name": "slug",
619
- "description": "Entity Type",
711
+ "description": "Entity Schema",
620
712
  "required": true,
621
713
  "schema": {
622
714
  "$ref": "#/components/schemas/EntitySlug"
@@ -625,6 +717,7 @@
625
717
  {
626
718
  "in": "path",
627
719
  "name": "id",
720
+ "description": "Entity Id",
628
721
  "required": true,
629
722
  "schema": {
630
723
  "$ref": "#/components/schemas/EntityId"
@@ -638,28 +731,110 @@
638
731
  "schema": {
639
732
  "$ref": "#/components/schemas/ActivityId"
640
733
  }
641
- }
642
- ],
643
- "responses": {
644
- "200": {
645
- "description": "Success"
646
- }
647
- }
648
- }
649
- },
650
- "/v1/entity:autocomplete": {
651
- "get": {
652
- "operationId": "autocomplete",
653
- "summary": "autocomplete",
654
- "description": "Autocomplete entity attributes\n",
655
- "tags": [
656
- "Entities"
657
- ],
658
- "parameters": [
734
+ },
659
735
  {
660
- "name": "input",
661
736
  "in": "query",
662
- "description": "Input to autocomplete",
737
+ "name": "dry_run",
738
+ "description": "Dry Run mode = returns the patch result but doesn't perform the patch.",
739
+ "required": false,
740
+ "schema": {
741
+ "type": "boolean",
742
+ "default": false
743
+ }
744
+ },
745
+ {
746
+ "in": "query",
747
+ "name": "async",
748
+ "description": "Don't wait for the patch entity to become available in Search API. Useful for large migrations",
749
+ "required": false,
750
+ "schema": {
751
+ "type": "boolean",
752
+ "default": false
753
+ }
754
+ }
755
+ ],
756
+ "requestBody": {
757
+ "content": {
758
+ "application/json": {
759
+ "schema": {
760
+ "$ref": "#/components/schemas/Entity"
761
+ },
762
+ "example": {}
763
+ }
764
+ },
765
+ "required": true
766
+ },
767
+ "responses": {
768
+ "200": {
769
+ "description": "Entity was updated",
770
+ "content": {
771
+ "application/json": {
772
+ "schema": {
773
+ "$ref": "#/components/schemas/EntityItem"
774
+ }
775
+ }
776
+ }
777
+ },
778
+ "409": {
779
+ "description": "Conflict: newer version exists"
780
+ }
781
+ }
782
+ },
783
+ "delete": {
784
+ "operationId": "deleteEntity",
785
+ "summary": "deleteEntity",
786
+ "description": "Deletes an Entity\n\n## Activity\n\nIf no `activity_id` query parameter is provided, implicitly creates Activity of type `EntityDeleted`\n",
787
+ "tags": [
788
+ "Entities"
789
+ ],
790
+ "parameters": [
791
+ {
792
+ "in": "path",
793
+ "name": "slug",
794
+ "description": "Entity Type",
795
+ "required": true,
796
+ "schema": {
797
+ "$ref": "#/components/schemas/EntitySlug"
798
+ }
799
+ },
800
+ {
801
+ "in": "path",
802
+ "name": "id",
803
+ "required": true,
804
+ "schema": {
805
+ "$ref": "#/components/schemas/EntityId"
806
+ }
807
+ },
808
+ {
809
+ "in": "query",
810
+ "name": "activity_id",
811
+ "description": "Activity to include in event feed",
812
+ "required": false,
813
+ "schema": {
814
+ "$ref": "#/components/schemas/ActivityId"
815
+ }
816
+ }
817
+ ],
818
+ "responses": {
819
+ "200": {
820
+ "description": "Success"
821
+ }
822
+ }
823
+ }
824
+ },
825
+ "/v1/entity:autocomplete": {
826
+ "get": {
827
+ "operationId": "autocomplete",
828
+ "summary": "autocomplete",
829
+ "description": "Autocomplete entity attributes\n",
830
+ "tags": [
831
+ "Entities"
832
+ ],
833
+ "parameters": [
834
+ {
835
+ "name": "input",
836
+ "in": "query",
837
+ "description": "Input to autocomplete",
663
838
  "schema": {
664
839
  "type": "string"
665
840
  }
@@ -797,6 +972,27 @@
797
972
  "schema": {
798
973
  "$ref": "#/components/schemas/ActivityId"
799
974
  }
975
+ },
976
+ {
977
+ "in": "query",
978
+ "name": "operations_size",
979
+ "description": "Maximum number of operations to include in response (default: 10)\n",
980
+ "schema": {
981
+ "type": "integer",
982
+ "minimum": 0,
983
+ "maximum": 1000,
984
+ "default": 25
985
+ }
986
+ },
987
+ {
988
+ "in": "query",
989
+ "name": "operations_from",
990
+ "description": "Pagination offset for operations\n",
991
+ "schema": {
992
+ "type": "integer",
993
+ "minimum": 0,
994
+ "default": 0
995
+ }
800
996
  }
801
997
  ],
802
998
  "responses": {
@@ -964,7 +1160,7 @@
964
1160
  "get": {
965
1161
  "operationId": "getRelations",
966
1162
  "summary": "getRelations",
967
- "description": "It loads 1st level relations for the mentioned entity. You can control whether entire related entity is loaded or not via hydrate param.",
1163
+ "description": "Returns 1st level direct relations for an entity.\n\nYou can control whether to return the full entity or just the relation item with the `?hydrate` query param.\n\nReverse relations i.e. entities referring to this entity are included with the `?include_reverse` query param.\n",
968
1164
  "tags": [
969
1165
  "Relations"
970
1166
  ],
@@ -995,6 +1191,15 @@
995
1191
  "default": false,
996
1192
  "type": "boolean"
997
1193
  }
1194
+ },
1195
+ {
1196
+ "in": "query",
1197
+ "name": "include_reverse",
1198
+ "description": "When true, includes reverse relations in response (other entities pointing to this entity)",
1199
+ "schema": {
1200
+ "default": false,
1201
+ "type": "boolean"
1202
+ }
998
1203
  }
999
1204
  ],
1000
1205
  "responses": {
@@ -1048,7 +1253,7 @@
1048
1253
  "post": {
1049
1254
  "operationId": "addRelations",
1050
1255
  "summary": "addRelations",
1051
- "description": "It relates one or more entities to some parent entity, by providing meaning for relations via attribute field.",
1256
+ "description": "Relates one or more entities to parent entity by adding items to a relation attribute",
1052
1257
  "tags": [
1053
1258
  "Relations"
1054
1259
  ],
@@ -1070,6 +1275,16 @@
1070
1275
  "schema": {
1071
1276
  "$ref": "#/components/schemas/EntityId"
1072
1277
  }
1278
+ },
1279
+ {
1280
+ "in": "query",
1281
+ "name": "async",
1282
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
1283
+ "required": false,
1284
+ "schema": {
1285
+ "type": "boolean",
1286
+ "default": false
1287
+ }
1073
1288
  }
1074
1289
  ],
1075
1290
  "requestBody": {
@@ -1115,11 +1330,115 @@
1115
1330
  }
1116
1331
  }
1117
1332
  },
1333
+ "/v2/entity/{slug}/{id}/relations": {
1334
+ "get": {
1335
+ "operationId": "getRelationsV2",
1336
+ "summary": "getRelationsV2",
1337
+ "description": "Returns 1st level direct relations for an entity with pagination.\n\nYou can control whether to return the full entity or just the relation item with the `?hydrate` query param.\n\nReverse relations i.e. entities referring to this entity are included with the `?include_reverse` query param.\n",
1338
+ "tags": [
1339
+ "Relations"
1340
+ ],
1341
+ "parameters": [
1342
+ {
1343
+ "in": "path",
1344
+ "name": "slug",
1345
+ "description": "Entity Type",
1346
+ "required": true,
1347
+ "schema": {
1348
+ "$ref": "#/components/schemas/EntitySlug"
1349
+ }
1350
+ },
1351
+ {
1352
+ "in": "path",
1353
+ "name": "id",
1354
+ "description": "Entity id",
1355
+ "required": true,
1356
+ "schema": {
1357
+ "$ref": "#/components/schemas/EntityId"
1358
+ }
1359
+ },
1360
+ {
1361
+ "in": "query",
1362
+ "name": "hydrate",
1363
+ "description": "When true, expand relation items with full blown entities.",
1364
+ "schema": {
1365
+ "default": false,
1366
+ "type": "boolean"
1367
+ }
1368
+ },
1369
+ {
1370
+ "in": "query",
1371
+ "name": "query",
1372
+ "description": "Input to filter search results",
1373
+ "schema": {
1374
+ "type": "string"
1375
+ }
1376
+ },
1377
+ {
1378
+ "in": "query",
1379
+ "name": "include_reverse",
1380
+ "description": "When true, includes reverse relations in response (other entities pointing to this entity)",
1381
+ "schema": {
1382
+ "default": false,
1383
+ "type": "boolean"
1384
+ }
1385
+ },
1386
+ {
1387
+ "in": "query",
1388
+ "name": "from",
1389
+ "description": "Starting page number",
1390
+ "schema": {
1391
+ "type": "integer",
1392
+ "minimum": 0,
1393
+ "default": 0
1394
+ }
1395
+ },
1396
+ {
1397
+ "in": "query",
1398
+ "name": "size",
1399
+ "description": "Number of results to return per page",
1400
+ "schema": {
1401
+ "type": "integer",
1402
+ "minimum": 1,
1403
+ "default": 50
1404
+ }
1405
+ },
1406
+ {
1407
+ "in": "query",
1408
+ "name": "fields",
1409
+ "description": "List of entity fields to include in results",
1410
+ "schema": {
1411
+ "type": "array",
1412
+ "items": {
1413
+ "type": "string"
1414
+ },
1415
+ "example": [
1416
+ "_id",
1417
+ "_schema",
1418
+ "_title"
1419
+ ]
1420
+ }
1421
+ }
1422
+ ],
1423
+ "responses": {
1424
+ "200": {
1425
+ "description": "Success",
1426
+ "content": {
1427
+ "application/json": {
1428
+ "schema": {
1429
+ "$ref": "#/components/schemas/GetRelationsRespWithPagination"
1430
+ }
1431
+ }
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ },
1118
1437
  "/v1/entity/{slug}/{id}/relations/{attribute}/{entity_id}": {
1119
1438
  "put": {
1120
1439
  "operationId": "updateRelation",
1121
1440
  "summary": "updateRelation",
1122
- "description": "It updates a relation between two entities.",
1441
+ "description": "Updates an existing relation between two entities.",
1123
1442
  "tags": [
1124
1443
  "Relations"
1125
1444
  ],
@@ -1159,6 +1478,16 @@
1159
1478
  "schema": {
1160
1479
  "type": "string"
1161
1480
  }
1481
+ },
1482
+ {
1483
+ "in": "query",
1484
+ "name": "async",
1485
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
1486
+ "required": false,
1487
+ "schema": {
1488
+ "type": "boolean",
1489
+ "default": false
1490
+ }
1162
1491
  }
1163
1492
  ],
1164
1493
  "requestBody": {
@@ -1200,7 +1529,7 @@
1200
1529
  "delete": {
1201
1530
  "operationId": "deleteRelation",
1202
1531
  "summary": "deleteRelation",
1203
- "description": "It deletes a relation between one entity and the other.",
1532
+ "description": "Removes relation between two entities",
1204
1533
  "tags": [
1205
1534
  "Relations"
1206
1535
  ],
@@ -1240,6 +1569,16 @@
1240
1569
  "schema": {
1241
1570
  "type": "string"
1242
1571
  }
1572
+ },
1573
+ {
1574
+ "in": "query",
1575
+ "name": "async",
1576
+ "description": "Don't wait for updated entity to become available in Search API. Useful for large migrations",
1577
+ "required": false,
1578
+ "schema": {
1579
+ "type": "boolean",
1580
+ "default": false
1581
+ }
1243
1582
  }
1244
1583
  ],
1245
1584
  "responses": {
@@ -1265,6 +1604,22 @@
1265
1604
  "schema": {
1266
1605
  "$ref": "#/components/schemas/ExportJobId"
1267
1606
  }
1607
+ },
1608
+ {
1609
+ "in": "query",
1610
+ "name": "is_template",
1611
+ "description": "Pass 'true' to generate import template",
1612
+ "schema": {
1613
+ "$ref": "#/components/schemas/IsTemplate"
1614
+ }
1615
+ },
1616
+ {
1617
+ "in": "query",
1618
+ "name": "language",
1619
+ "description": "Export headers translation language",
1620
+ "schema": {
1621
+ "$ref": "#/components/schemas/Language"
1622
+ }
1268
1623
  }
1269
1624
  ],
1270
1625
  "requestBody": {
@@ -1282,28 +1637,473 @@
1282
1637
  }
1283
1638
  }
1284
1639
  }
1285
- }
1286
- },
1287
- "components": {
1288
- "securitySchemes": {
1289
- "EpilotAuth": {
1290
- "type": "http",
1291
- "scheme": "bearer",
1292
- "description": "Authorization header with epilot OAuth2 bearer token",
1293
- "bearerFormat": "JWT"
1294
- },
1295
- "EpilotOrg": {
1296
- "description": "Overrides the target organization to allow shared tenantaccess",
1297
- "name": "x-epilot-org-id",
1298
- "in": "header",
1299
- "type": "apiKey"
1300
- }
1640
+ },
1641
+ "/v1/entity:import": {
1642
+ "post": {
1643
+ "operationId": "importEntities",
1644
+ "summary": "importEntities",
1645
+ "description": "import entity data from",
1646
+ "tags": [
1647
+ "Export"
1648
+ ],
1649
+ "parameters": [
1650
+ {
1651
+ "in": "query",
1652
+ "name": "job_id",
1653
+ "description": "Import Job Id to get the result",
1654
+ "schema": {
1655
+ "$ref": "#/components/schemas/ExportJobId"
1656
+ }
1657
+ }
1658
+ ],
1659
+ "requestBody": {
1660
+ "content": {
1661
+ "application/json": {
1662
+ "schema": {
1663
+ "$ref": "#/components/schemas/EntityImportParams"
1664
+ }
1665
+ }
1666
+ }
1667
+ },
1668
+ "responses": {
1669
+ "201": {
1670
+ "description": "created import url and download url"
1671
+ }
1672
+ }
1673
+ }
1674
+ },
1675
+ "/v1/entity/views": {
1676
+ "get": {
1677
+ "operationId": "listSavedViews",
1678
+ "summary": "listSavedViews",
1679
+ "description": "Get the Saved Views based on the schema",
1680
+ "tags": [
1681
+ "Saved Views"
1682
+ ],
1683
+ "responses": {
1684
+ "200": {
1685
+ "description": "Success",
1686
+ "content": {
1687
+ "application/json": {
1688
+ "schema": {
1689
+ "type": "object",
1690
+ "properties": {
1691
+ "results": {
1692
+ "type": "array",
1693
+ "items": {
1694
+ "$ref": "#/components/schemas/SavedViewItem"
1695
+ }
1696
+ }
1697
+ }
1698
+ }
1699
+ }
1700
+ }
1701
+ }
1702
+ }
1703
+ }
1704
+ },
1705
+ "/v1/entity/view": {
1706
+ "post": {
1707
+ "operationId": "createSavedView",
1708
+ "summary": "createSavedView",
1709
+ "description": "Creates a new saved view",
1710
+ "tags": [
1711
+ "Saved Views"
1712
+ ],
1713
+ "requestBody": {
1714
+ "content": {
1715
+ "application/json": {
1716
+ "schema": {
1717
+ "$ref": "#/components/schemas/SavedView"
1718
+ }
1719
+ }
1720
+ }
1721
+ },
1722
+ "responses": {
1723
+ "201": {
1724
+ "description": "Success",
1725
+ "content": {
1726
+ "application/json": {
1727
+ "schema": {
1728
+ "$ref": "#/components/schemas/SavedViewItem"
1729
+ }
1730
+ }
1731
+ }
1732
+ }
1733
+ }
1734
+ }
1735
+ },
1736
+ "/v1/entity/view/{id}": {
1737
+ "get": {
1738
+ "operationId": "getSavedView",
1739
+ "summary": "getSavedView",
1740
+ "description": "Gets Saved View configuration by id.",
1741
+ "tags": [
1742
+ "Saved Views"
1743
+ ],
1744
+ "parameters": [
1745
+ {
1746
+ "in": "path",
1747
+ "name": "id",
1748
+ "description": "View id",
1749
+ "required": true,
1750
+ "schema": {
1751
+ "$ref": "#/components/schemas/SavedViewId"
1752
+ }
1753
+ }
1754
+ ],
1755
+ "responses": {
1756
+ "200": {
1757
+ "description": "Success",
1758
+ "content": {
1759
+ "application/json": {
1760
+ "schema": {
1761
+ "type": "object",
1762
+ "properties": {
1763
+ "view": {
1764
+ "$ref": "#/components/schemas/SavedViewItem"
1765
+ }
1766
+ }
1767
+ }
1768
+ }
1769
+ }
1770
+ }
1771
+ }
1772
+ },
1773
+ "put": {
1774
+ "operationId": "updateSavedView",
1775
+ "summary": "updateSavedView",
1776
+ "description": "Updates a saved view",
1777
+ "tags": [
1778
+ "Saved Views"
1779
+ ],
1780
+ "parameters": [
1781
+ {
1782
+ "in": "path",
1783
+ "name": "id",
1784
+ "description": "View id",
1785
+ "required": true,
1786
+ "schema": {
1787
+ "$ref": "#/components/schemas/SavedViewId"
1788
+ }
1789
+ }
1790
+ ],
1791
+ "requestBody": {
1792
+ "content": {
1793
+ "application/json": {
1794
+ "schema": {
1795
+ "$ref": "#/components/schemas/SavedView"
1796
+ }
1797
+ }
1798
+ }
1799
+ },
1800
+ "responses": {
1801
+ "200": {
1802
+ "description": "Success",
1803
+ "content": {
1804
+ "application/json": {
1805
+ "schema": {
1806
+ "$ref": "#/components/schemas/SavedViewItem"
1807
+ }
1808
+ }
1809
+ }
1810
+ }
1811
+ }
1812
+ },
1813
+ "delete": {
1814
+ "operationId": "deleteSavedView",
1815
+ "summary": "deleteSavedView",
1816
+ "description": "Deletes a saved view",
1817
+ "parameters": [
1818
+ {
1819
+ "in": "path",
1820
+ "name": "id",
1821
+ "description": "View id",
1822
+ "required": true,
1823
+ "schema": {
1824
+ "$ref": "#/components/schemas/SavedViewId"
1825
+ }
1826
+ }
1827
+ ],
1828
+ "tags": [
1829
+ "Saved Views"
1830
+ ],
1831
+ "responses": {
1832
+ "200": {
1833
+ "description": "List of all available saved views"
1834
+ }
1835
+ }
1836
+ }
1837
+ },
1838
+ "/v1/entity/listTaxonomies": {
1839
+ "get": {
1840
+ "operationId": "listTaxonomies",
1841
+ "summary": "listTaxonomies",
1842
+ "description": "List taxonomies in an organisation",
1843
+ "tags": [
1844
+ "Taxonomy"
1845
+ ],
1846
+ "responses": {
1847
+ "200": {
1848
+ "description": "Returns list of taxonomies in an organisation",
1849
+ "content": {
1850
+ "application/json": {
1851
+ "schema": {
1852
+ "type": "object",
1853
+ "properties": {
1854
+ "results": {
1855
+ "type": "array",
1856
+ "items": {
1857
+ "$ref": "#/components/schemas/Taxonomy"
1858
+ }
1859
+ }
1860
+ }
1861
+ }
1862
+ }
1863
+ }
1864
+ }
1865
+ }
1866
+ }
1867
+ },
1868
+ "/v1/entity/taxonomies/{taxonomySlug}": {
1869
+ "get": {
1870
+ "operationId": "getTaxonomy",
1871
+ "summary": "getTaxonomy",
1872
+ "description": "Get taxonomy by slug",
1873
+ "tags": [
1874
+ "Taxonomy"
1875
+ ],
1876
+ "parameters": [
1877
+ {
1878
+ "in": "path",
1879
+ "name": "taxonomySlug",
1880
+ "description": "Taxonomy slug to return taxonomy for",
1881
+ "schema": {
1882
+ "$ref": "#/components/schemas/TaxonomySlug"
1883
+ },
1884
+ "required": true
1885
+ }
1886
+ ],
1887
+ "responses": {
1888
+ "200": {
1889
+ "description": "Taxonomy",
1890
+ "content": {
1891
+ "application/json": {
1892
+ "schema": {
1893
+ "$ref": "#/components/schemas/Taxonomy"
1894
+ }
1895
+ }
1896
+ }
1897
+ }
1898
+ }
1899
+ }
1900
+ },
1901
+ "/v1/entity/taxonomies/{taxonomySlug}:autocomplete": {
1902
+ "get": {
1903
+ "operationId": "taxonomyAutocomplete",
1904
+ "summary": "taxonomyAutocomplete",
1905
+ "description": "Taxonomies autocomplete",
1906
+ "tags": [
1907
+ "Taxonomy"
1908
+ ],
1909
+ "parameters": [
1910
+ {
1911
+ "in": "path",
1912
+ "name": "taxonomySlug",
1913
+ "description": "Limit results to slug",
1914
+ "schema": {
1915
+ "type": "string"
1916
+ },
1917
+ "required": true
1918
+ },
1919
+ {
1920
+ "in": "query",
1921
+ "name": "query",
1922
+ "description": "Input to autocomplete",
1923
+ "schema": {
1924
+ "type": "string"
1925
+ }
1926
+ },
1927
+ {
1928
+ "in": "query",
1929
+ "name": "size",
1930
+ "description": "Minimum number of results to return",
1931
+ "schema": {
1932
+ "type": "number"
1933
+ }
1934
+ }
1935
+ ],
1936
+ "responses": {
1937
+ "200": {
1938
+ "description": "Taxonomy classifications",
1939
+ "content": {
1940
+ "application/json": {
1941
+ "schema": {
1942
+ "type": "object",
1943
+ "properties": {
1944
+ "results": {
1945
+ "type": "array",
1946
+ "items": {
1947
+ "$ref": "#/components/schemas/TaxonomyClassification"
1948
+ }
1949
+ }
1950
+ }
1951
+ }
1952
+ }
1953
+ }
1954
+ }
1955
+ }
1956
+ }
1957
+ },
1958
+ "/v1/entity/taxonomies/classifications:search": {
1959
+ "post": {
1960
+ "operationId": "taxonomiesClassificationsSearch",
1961
+ "summary": "taxonomiesClassificationsSearch",
1962
+ "description": "List taxonomy classifications in an organisation based on taxonomy slug",
1963
+ "tags": [
1964
+ "Taxonomy"
1965
+ ],
1966
+ "parameters": [
1967
+ {
1968
+ "in": "query",
1969
+ "name": "taxonomySlug",
1970
+ "description": "Taxonomy slug",
1971
+ "schema": {
1972
+ "type": "string"
1973
+ },
1974
+ "required": true
1975
+ }
1976
+ ],
1977
+ "requestBody": {
1978
+ "content": {
1979
+ "application/json": {
1980
+ "schema": {
1981
+ "type": "object",
1982
+ "properties": {
1983
+ "classificationIds": {
1984
+ "type": "array",
1985
+ "items": {
1986
+ "$ref": "#/components/schemas/ClassificationId"
1987
+ }
1988
+ }
1989
+ }
1990
+ }
1991
+ }
1992
+ }
1993
+ },
1994
+ "responses": {
1995
+ "200": {
1996
+ "description": "Returns list of taxonomy classifications",
1997
+ "content": {
1998
+ "application/json": {
1999
+ "schema": {
2000
+ "type": "object",
2001
+ "properties": {
2002
+ "results": {
2003
+ "type": "array",
2004
+ "items": {
2005
+ "$ref": "#/components/schemas/TaxonomyClassification"
2006
+ }
2007
+ }
2008
+ }
2009
+ }
2010
+ }
2011
+ }
2012
+ }
2013
+ }
2014
+ }
2015
+ },
2016
+ "/v1/entity/taxonomies/{taxonomySlug}/classifications": {
2017
+ "post": {
2018
+ "operationId": "updateClassificationsForTaxonomy",
2019
+ "summary": "updateClassificationsForTaxonomy",
2020
+ "description": "Update taxonomies in an organisation based in taxonomy slug",
2021
+ "tags": [
2022
+ "Taxonomy"
2023
+ ],
2024
+ "parameters": [
2025
+ {
2026
+ "in": "path",
2027
+ "name": "taxonomySlug",
2028
+ "description": "Taxonomy slug",
2029
+ "schema": {
2030
+ "type": "string"
2031
+ },
2032
+ "required": true
2033
+ }
2034
+ ],
2035
+ "requestBody": {
2036
+ "content": {
2037
+ "application/json": {
2038
+ "schema": {
2039
+ "$ref": "#/components/schemas/ClassificationsUpdate"
2040
+ }
2041
+ }
2042
+ }
2043
+ },
2044
+ "responses": {
2045
+ "200": {
2046
+ "description": "Taxonomies classifications",
2047
+ "content": {
2048
+ "application/json": {
2049
+ "schema": {
2050
+ "type": "object",
2051
+ "properties": {
2052
+ "created": {
2053
+ "type": "array",
2054
+ "items": {
2055
+ "$ref": "#/components/schemas/TaxonomyClassification"
2056
+ }
2057
+ },
2058
+ "updated": {
2059
+ "type": "array",
2060
+ "items": {
2061
+ "$ref": "#/components/schemas/TaxonomyClassification"
2062
+ }
2063
+ },
2064
+ "deleted": {
2065
+ "type": "object",
2066
+ "items": {
2067
+ "$ref": "#/components/schemas/ClassificationId"
2068
+ }
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+ }
2074
+ }
2075
+ }
2076
+ }
2077
+ }
2078
+ },
2079
+ "components": {
2080
+ "securitySchemes": {
2081
+ "EpilotAuth": {
2082
+ "type": "http",
2083
+ "scheme": "bearer",
2084
+ "description": "Authorization header with epilot OAuth2 bearer token",
2085
+ "bearerFormat": "JWT"
2086
+ },
2087
+ "EpilotOrg": {
2088
+ "description": "Overrides the target organization to allow shared tenantaccess",
2089
+ "name": "x-epilot-org-id",
2090
+ "in": "header",
2091
+ "type": "apiKey"
2092
+ }
1301
2093
  },
1302
2094
  "schemas": {
1303
2095
  "ExportJobId": {
1304
2096
  "description": "Export Job Id to get the result",
1305
2097
  "type": "string"
1306
2098
  },
2099
+ "Language": {
2100
+ "description": "Export headers translation Language",
2101
+ "type": "string"
2102
+ },
2103
+ "IsTemplate": {
2104
+ "description": "Pass 'true' to generate import template",
2105
+ "type": "boolean"
2106
+ },
1307
2107
  "SchemaId": {
1308
2108
  "description": "Generated uuid for schema",
1309
2109
  "type": "string",
@@ -1333,7 +2133,7 @@
1333
2133
  "type": "array",
1334
2134
  "items": {
1335
2135
  "type": "string",
1336
- "example": "ecommerce_preview"
2136
+ "example": "360_features"
1337
2137
  }
1338
2138
  },
1339
2139
  "name": {
@@ -1366,16 +2166,56 @@
1366
2166
  "type": "object",
1367
2167
  "properties": {
1368
2168
  "table_view": {
1369
- "$ref": "#/components/schemas/EntityViewConfig"
2169
+ "anyOf": [
2170
+ {
2171
+ "$ref": "#/components/schemas/EntityDefaultTable"
2172
+ },
2173
+ {
2174
+ "$ref": "#/components/schemas/RedirectEntityView"
2175
+ },
2176
+ {
2177
+ "$ref": "#/components/schemas/EntityViewDisabled"
2178
+ }
2179
+ ]
1370
2180
  },
1371
2181
  "create_view": {
1372
- "$ref": "#/components/schemas/EntityViewConfig"
2182
+ "anyOf": [
2183
+ {
2184
+ "$ref": "#/components/schemas/EntityDefaultCreate"
2185
+ },
2186
+ {
2187
+ "$ref": "#/components/schemas/RedirectEntityView"
2188
+ },
2189
+ {
2190
+ "$ref": "#/components/schemas/EntityViewDisabled"
2191
+ }
2192
+ ]
1373
2193
  },
1374
2194
  "edit_view": {
1375
- "$ref": "#/components/schemas/EntityViewConfig"
2195
+ "anyOf": [
2196
+ {
2197
+ "$ref": "#/components/schemas/EntityDefaultEdit"
2198
+ },
2199
+ {
2200
+ "$ref": "#/components/schemas/RedirectEntityView"
2201
+ },
2202
+ {
2203
+ "$ref": "#/components/schemas/EntityViewDisabled"
2204
+ }
2205
+ ]
1376
2206
  },
1377
2207
  "single_view": {
1378
- "$ref": "#/components/schemas/EntityViewConfig"
2208
+ "anyOf": [
2209
+ {
2210
+ "$ref": "#/components/schemas/EntityDefaultEdit"
2211
+ },
2212
+ {
2213
+ "$ref": "#/components/schemas/RedirectEntityView"
2214
+ },
2215
+ {
2216
+ "$ref": "#/components/schemas/EntityViewDisabled"
2217
+ }
2218
+ ]
1379
2219
  },
1380
2220
  "list_item": {
1381
2221
  "type": "object",
@@ -1459,6 +2299,12 @@
1459
2299
  "type": "string"
1460
2300
  }
1461
2301
  }
2302
+ },
2303
+ "_purpose": {
2304
+ "type": "array",
2305
+ "items": {
2306
+ "$ref": "#/components/schemas/ClassificationId"
2307
+ }
1462
2308
  }
1463
2309
  },
1464
2310
  "required": [
@@ -1481,16 +2327,16 @@
1481
2327
  },
1482
2328
  "layout_settings": {
1483
2329
  "type": "object",
1484
- "description": "Custom grid definitions for the layout",
1485
- "additionalProperties": {
1486
- "type": "object",
1487
- "properties": {
1488
- "grid_gap": {
1489
- "type": "string"
1490
- },
1491
- "grid_template_columns": {
1492
- "type": "string"
1493
- }
2330
+ "description": "Custom grid definitions for the layout. These settings are composed by managed and un-managed properties:\n- Managed Properties: are interpreted and transformed into layout styles\n- Un-managed Properties: are appended as styles into the attribute mounting node\n",
2331
+ "additionalProperties": true,
2332
+ "properties": {
2333
+ "grid_gap": {
2334
+ "type": "string",
2335
+ "description": "Defines the grid gap for the mounting node of the attribute."
2336
+ },
2337
+ "grid_template_columns": {
2338
+ "type": "string",
2339
+ "description": "Defines the grid column template for the mounting node of the attribute."
1494
2340
  }
1495
2341
  }
1496
2342
  },
@@ -1672,6 +2518,9 @@
1672
2518
  },
1673
2519
  {
1674
2520
  "$ref": "#/components/schemas/InternalUserAttribute"
2521
+ },
2522
+ {
2523
+ "$ref": "#/components/schemas/PurposeAttribute"
1675
2524
  }
1676
2525
  ]
1677
2526
  },
@@ -1708,34 +2557,19 @@
1708
2557
  "type": "boolean",
1709
2558
  "default": false
1710
2559
  },
1711
- "default_value": {
1712
- "oneOf": [
1713
- {
1714
- "type": "string"
1715
- },
1716
- {
1717
- "type": "object",
1718
- "additionalProperties": true
1719
- },
1720
- {
1721
- "type": "integer"
1722
- },
1723
- {
1724
- "type": "number"
1725
- },
1726
- {
1727
- "type": "boolean"
1728
- },
1729
- {
1730
- "type": "array"
1731
- }
1732
- ]
1733
- },
2560
+ "default_value": {},
1734
2561
  "group": {
2562
+ "description": "Which group the attribute should appear in. Accepts group ID or group name",
1735
2563
  "type": "string"
1736
2564
  },
2565
+ "order": {
2566
+ "description": "Attribute sort order (ascending) in group",
2567
+ "type": "integer",
2568
+ "example": 0
2569
+ },
1737
2570
  "layout": {
1738
- "type": "string"
2571
+ "type": "string",
2572
+ "example": "full_width"
1739
2573
  },
1740
2574
  "hide_label": {
1741
2575
  "type": "boolean",
@@ -1749,6 +2583,12 @@
1749
2583
  "type": "string",
1750
2584
  "description": "Defines the conditional rendering expression for showing this field.\nWhen a valid expression is parsed, their evaluation defines the visibility of this attribute.\nNote: Empty or invalid expression have no effect on the field visibility.\n"
1751
2585
  },
2586
+ "_purpose": {
2587
+ "type": "array",
2588
+ "items": {
2589
+ "$ref": "#/components/schemas/ClassificationId"
2590
+ }
2591
+ },
1752
2592
  "constraints": {
1753
2593
  "type": "object",
1754
2594
  "description": "A set of constraints applicable to the attribute.\nThese constraints should and will be enforced by the attribute renderer.\n",
@@ -1781,6 +2621,29 @@
1781
2621
  "description": "Setting to `true` prevents the attribute from being modified / deleted",
1782
2622
  "type": "boolean",
1783
2623
  "default": true
2624
+ },
2625
+ "info_helpers": {
2626
+ "description": "A set of configurations meant to document and assist the user in filling the attribute.",
2627
+ "type": "object",
2628
+ "properties": {
2629
+ "hint_text": {
2630
+ "type": "string",
2631
+ "description": "The text to be displayed in the attribute hint helper.\nWhen specified it overrides the `hint_text_key` configuration.\n"
2632
+ },
2633
+ "hint_text_key": {
2634
+ "type": "string",
2635
+ "description": "The key of the hint text to be displayed in the attribute hint helper.\nThe key should be a valid i18n key.\n"
2636
+ },
2637
+ "hint_custom_component": {
2638
+ "type": "string",
2639
+ "description": "The name of the custom component to be used as the hint helper.\nThe component should be registered in the `@epilot360/entity-ui` on the index of the components directory.\nWhen specified it overrides the `hint_text` or `hint_text_key` configuration.\n"
2640
+ },
2641
+ "hint_tooltip_placement": {
2642
+ "type": "string",
2643
+ "description": "The placement of the hint tooltip.\nThe value should be a valid `@mui/core` tooltip placement.\n",
2644
+ "example": "top"
2645
+ }
2646
+ }
1784
2647
  }
1785
2648
  },
1786
2649
  "required": [
@@ -1926,10 +2789,6 @@
1926
2789
  "type": "array",
1927
2790
  "items": {
1928
2791
  "anyOf": [
1929
- {
1930
- "type": "string",
1931
- "nullable": true
1932
- },
1933
2792
  {
1934
2793
  "type": "object",
1935
2794
  "properties": {
@@ -1943,6 +2802,10 @@
1943
2802
  "required": [
1944
2803
  "value"
1945
2804
  ]
2805
+ },
2806
+ {
2807
+ "type": "string",
2808
+ "nullable": true
1946
2809
  }
1947
2810
  ]
1948
2811
  }
@@ -2235,13 +3098,20 @@
2235
3098
  "has_one"
2236
3099
  ]
2237
3100
  },
2238
- "delete_mode": {
2239
- "type": "string",
2240
- "enum": [
2241
- "cascade"
2242
- ]
3101
+ "reverse_attributes": {
3102
+ "description": "Map of schema slug to target relation attribute",
3103
+ "type": "object",
3104
+ "additionalProperties": {
3105
+ "type": "string",
3106
+ "example": "contact.account"
3107
+ },
3108
+ "example": {
3109
+ "contact": "account",
3110
+ "opportunity": "customer"
3111
+ }
2243
3112
  },
2244
3113
  "relation_affinity_mode": {
3114
+ "description": "Weak relation attributes are kept when duplicating an entity. Strong relation attributes are discarded when duplicating an entity.",
2245
3115
  "type": "string",
2246
3116
  "enum": [
2247
3117
  "weak",
@@ -2360,6 +3230,14 @@
2360
3230
  "type": "boolean",
2361
3231
  "default": true,
2362
3232
  "description": "When enable_relation_tags is set to true the user will be able to set tags(labels) in each relation item."
3233
+ },
3234
+ "add_button_label": {
3235
+ "type": "string",
3236
+ "description": "Optional label for the add button. The translated value for add_button_lable is used, if found else the string is used as is."
3237
+ },
3238
+ "search_placeholder": {
3239
+ "type": "string",
3240
+ "description": "Optional placeholder text for the relation search input. The translated value for search_placeholder is used, if found else the string is used as is."
2363
3241
  }
2364
3242
  }
2365
3243
  }
@@ -2489,6 +3367,28 @@
2489
3367
  }
2490
3368
  ]
2491
3369
  },
3370
+ "PurposeAttribute": {
3371
+ "allOf": [
3372
+ {
3373
+ "$ref": "#/components/schemas/BaseAttribute"
3374
+ },
3375
+ {
3376
+ "$ref": "#/components/schemas/TaxonomyClassification"
3377
+ },
3378
+ {
3379
+ "type": "object",
3380
+ "description": "Entity Taxonomy",
3381
+ "properties": {
3382
+ "type": {
3383
+ "type": "string",
3384
+ "enum": [
3385
+ "purpose"
3386
+ ]
3387
+ }
3388
+ }
3389
+ }
3390
+ ]
3391
+ },
2492
3392
  "RepeatableAttribute": {
2493
3393
  "allOf": [
2494
3394
  {
@@ -2505,6 +3405,7 @@
2505
3405
  "type": "boolean"
2506
3406
  },
2507
3407
  "relation_affinity_mode": {
3408
+ "description": "Weak repeatable attributes are kept when duplicating an entity. Strong repeatable attributes are discarded when duplicating an entity.",
2508
3409
  "type": "string",
2509
3410
  "enum": [
2510
3411
  "weak",
@@ -2675,41 +3576,6 @@
2675
3576
  }
2676
3577
  ]
2677
3578
  },
2678
- "Attachment": {
2679
- "type": "object",
2680
- "deprecated": true,
2681
- "properties": {
2682
- "key": {
2683
- "type": "string"
2684
- },
2685
- "mime": {
2686
- "type": "string"
2687
- },
2688
- "name": {
2689
- "type": "string"
2690
- },
2691
- "size": {
2692
- "type": "number"
2693
- },
2694
- "image_url": {
2695
- "type": "string"
2696
- },
2697
- "download_url": {
2698
- "type": "string"
2699
- },
2700
- "alt_text": {
2701
- "type": "string"
2702
- }
2703
- },
2704
- "required": [
2705
- "key",
2706
- "mime",
2707
- "name",
2708
- "size",
2709
- "image_url",
2710
- "download_url"
2711
- ]
2712
- },
2713
3579
  "SummaryAttribute": {
2714
3580
  "description": "Represents an expanded version of an attribute to be displayed in the list item summary.\nThis configuration can be used in the following way:\n```js\n{\n \"label\": \"Price components\"\n \"value\": \"{{item.prices.length}} price components\"\n \"show_as_tag\": true\n \"render_condition\": \"is_composite_price = \"true\"\"\n}\n```\nThe value field supports handlebar expressions from which you can pick any field from the entity state.\n",
2715
3581
  "type": "object",
@@ -2773,6 +3639,12 @@
2773
3639
  "$ref": "#/components/schemas/Attribute"
2774
3640
  }
2775
3641
  },
3642
+ "_purpose": {
3643
+ "type": "array",
3644
+ "items": {
3645
+ "$ref": "#/components/schemas/ClassificationId"
3646
+ }
3647
+ },
2776
3648
  "ui_hooks": {
2777
3649
  "type": "array",
2778
3650
  "items": {
@@ -2871,28 +3743,6 @@
2871
3743
  "name"
2872
3744
  ]
2873
3745
  },
2874
- "EntityViewConfig": {
2875
- "anyOf": [
2876
- {
2877
- "$ref": "#/components/schemas/EntityDefaultCreate"
2878
- },
2879
- {
2880
- "$ref": "#/components/schemas/EntityDefaultEdit"
2881
- },
2882
- {
2883
- "$ref": "#/components/schemas/EntityDefaultOverview"
2884
- },
2885
- {
2886
- "$ref": "#/components/schemas/RedirectEntityView"
2887
- },
2888
- {
2889
- "$ref": "#/components/schemas/EntityParcelView"
2890
- },
2891
- {
2892
- "$ref": "#/components/schemas/EntityViewDisabled"
2893
- }
2894
- ]
2895
- },
2896
3746
  "EntityViewDisabled": {
2897
3747
  "type": "object",
2898
3748
  "properties": {
@@ -2904,7 +3754,7 @@
2904
3754
  }
2905
3755
  }
2906
3756
  },
2907
- "EntityDefaultOverview": {
3757
+ "EntityDefaultTable": {
2908
3758
  "type": "object",
2909
3759
  "properties": {
2910
3760
  "view_type": {
@@ -2962,7 +3812,7 @@
2962
3812
  },
2963
3813
  "uri": {
2964
3814
  "type": "string",
2965
- "format": "uri"
3815
+ "format": "uri-reference"
2966
3816
  }
2967
3817
  }
2968
3818
  }
@@ -2977,9 +3827,45 @@
2977
3827
  "type": "string"
2978
3828
  }
2979
3829
  },
3830
+ "navbar_actions": {
3831
+ "type": "array",
3832
+ "items": {
3833
+ "type": "object",
3834
+ "properties": {
3835
+ "type": {
3836
+ "type": "string"
3837
+ },
3838
+ "options": {
3839
+ "type": "array",
3840
+ "items": {
3841
+ "type": "object",
3842
+ "properties": {
3843
+ "label": {
3844
+ "type": "string"
3845
+ },
3846
+ "params": {
3847
+ "type": "object"
3848
+ }
3849
+ },
3850
+ "required": [
3851
+ "label"
3852
+ ]
3853
+ }
3854
+ }
3855
+ },
3856
+ "required": [
3857
+ "type"
3858
+ ]
3859
+ }
3860
+ },
3861
+ "enable_thumbnails": {
3862
+ "description": "Enable the thumbnail column",
3863
+ "type": "boolean",
3864
+ "default": false
3865
+ },
2980
3866
  "classic_view": {
2981
3867
  "type": "string",
2982
- "format": "uri"
3868
+ "format": "uri-reference"
2983
3869
  }
2984
3870
  }
2985
3871
  },
@@ -3058,92 +3944,177 @@
3058
3944
  "route": "/app/pricing-hub/product/:entityId"
3059
3945
  }
3060
3946
  },
3061
- "EntityParcelView": {
3062
- "type": "object",
3063
- "properties": {
3064
- "view_type": {
3065
- "type": "string",
3066
- "enum": [
3067
- "parcel"
3068
- ]
3069
- },
3070
- "import": {
3071
- "type": "string",
3072
- "example": "@epilot360/pricing-hub-app"
3073
- }
3074
- },
3075
- "example": {
3076
- "type": "redirect",
3077
- "route": "/app/pricing-hub/product/:entityId"
3078
- }
3079
- },
3080
3947
  "EntityId": {
3081
3948
  "type": "string",
3082
3949
  "format": "uuid"
3083
3950
  },
3084
3951
  "BaseEntity": {
3952
+ "allOf": [
3953
+ {
3954
+ "$ref": "#/components/schemas/Entity"
3955
+ },
3956
+ {
3957
+ "required": [
3958
+ "_id",
3959
+ "_title",
3960
+ "_org",
3961
+ "_schema",
3962
+ "_created_at",
3963
+ "_updated_at"
3964
+ ]
3965
+ }
3966
+ ]
3967
+ },
3968
+ "Entity": {
3085
3969
  "type": "object",
3970
+ "additionalProperties": true,
3086
3971
  "properties": {
3087
3972
  "_id": {
3088
3973
  "$ref": "#/components/schemas/EntityId"
3089
3974
  },
3090
- "_title": {
3091
- "type": "string",
3092
- "description": "Title of entity"
3093
- },
3094
3975
  "_org": {
3095
3976
  "type": "string",
3096
3977
  "description": "Organization Id the entity belongs to"
3097
3978
  },
3979
+ "_owners": {
3980
+ "type": "array",
3981
+ "items": {
3982
+ "$ref": "#/components/schemas/EntityOwner"
3983
+ }
3984
+ },
3098
3985
  "_schema": {
3099
3986
  "$ref": "#/components/schemas/EntitySlug"
3100
3987
  },
3988
+ "_title": {
3989
+ "type": "string",
3990
+ "description": "Title of entity",
3991
+ "nullable": true
3992
+ },
3101
3993
  "_tags": {
3102
3994
  "type": "array",
3103
3995
  "items": {
3104
3996
  "type": "string"
3105
- }
3997
+ },
3998
+ "nullable": true
3106
3999
  },
3107
4000
  "_created_at": {
3108
4001
  "type": "string",
3109
- "format": "date-time"
4002
+ "format": "date-time",
4003
+ "nullable": true
3110
4004
  },
3111
4005
  "_updated_at": {
3112
4006
  "type": "string",
3113
- "format": "date-time"
4007
+ "format": "date-time",
4008
+ "nullable": true
4009
+ },
4010
+ "_acl": {
4011
+ "$ref": "#/components/schemas/EntityAcl"
3114
4012
  }
3115
4013
  },
3116
- "required": [
3117
- "_id",
3118
- "_title",
3119
- "_org",
3120
- "_schema",
3121
- "_created_at",
3122
- "_updated_at"
3123
- ],
3124
4014
  "example": {
3125
4015
  "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3126
4016
  "_org": "123",
4017
+ "_owners": [
4018
+ {
4019
+ "org_id": "123",
4020
+ "user_id": "123"
4021
+ }
4022
+ ],
3127
4023
  "_schema": "contact",
3128
4024
  "_tags": [
3129
4025
  "example",
3130
4026
  "mock"
3131
4027
  ],
3132
4028
  "_created_at": "2021-02-09T12:41:43.662Z",
3133
- "_updated_at": "2021-02-09T12:41:43.662Z"
4029
+ "_updated_at": "2021-02-09T12:41:43.662Z",
4030
+ "_acl": {
4031
+ "view": [
4032
+ "org:456",
4033
+ "org:789"
4034
+ ],
4035
+ "edit": [
4036
+ "org:456"
4037
+ ],
4038
+ "delete": [
4039
+ "org:456"
4040
+ ]
4041
+ }
3134
4042
  }
3135
4043
  },
3136
- "Entity": {
4044
+ "EntityOwner": {
4045
+ "description": "The user / organization owning this entity.\n\nNote: Owner implicitly has access to the entity regardless of ACLs.\n",
4046
+ "type": "object",
4047
+ "properties": {
4048
+ "org_id": {
4049
+ "type": "string",
4050
+ "example": "123"
4051
+ },
4052
+ "user_id": {
4053
+ "type": "string",
4054
+ "example": "123"
4055
+ }
4056
+ },
4057
+ "required": [
4058
+ "org_id"
4059
+ ]
4060
+ },
4061
+ "EntityAcl": {
4062
+ "description": "Access control list (ACL) for an entity. Defines sharing access to external orgs or users.",
3137
4063
  "type": "object",
3138
- "properties": {},
4064
+ "properties": {
4065
+ "view": {
4066
+ "type": "array",
4067
+ "items": {
4068
+ "type": "string",
4069
+ "example": "org:456"
4070
+ }
4071
+ },
4072
+ "edit": {
4073
+ "type": "array",
4074
+ "items": {
4075
+ "type": "string",
4076
+ "example": "org:456"
4077
+ }
4078
+ },
4079
+ "delete": {
4080
+ "type": "array",
4081
+ "items": {
4082
+ "type": "string",
4083
+ "example": "org:456"
4084
+ }
4085
+ }
4086
+ },
3139
4087
  "additionalProperties": true
3140
4088
  },
3141
4089
  "HydratedEntity": {
3142
4090
  "type": "object",
3143
4091
  "description": "Entity with relation data resolved into the attribute values",
3144
- "properties": {},
4092
+ "properties": {
4093
+ "_relations": {
4094
+ "type": "array",
4095
+ "items": {
4096
+ "type": "object",
4097
+ "properties": {
4098
+ "entity_id": {
4099
+ "$ref": "#/components/schemas/EntityId"
4100
+ }
4101
+ },
4102
+ "required": [
4103
+ "entity_id"
4104
+ ]
4105
+ }
4106
+ }
4107
+ },
3145
4108
  "additionalProperties": true,
4109
+ "required": [
4110
+ "_relations"
4111
+ ],
3146
4112
  "example": {
4113
+ "_relations": [
4114
+ {
4115
+ "entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
4116
+ }
4117
+ ],
3147
4118
  "status": "active",
3148
4119
  "customer_number": "abc123",
3149
4120
  "email": [
@@ -3229,6 +4200,18 @@
3229
4200
  ]
3230
4201
  }
3231
4202
  },
4203
+ "GetRelationsRespWithPagination": {
4204
+ "type": "object",
4205
+ "properties": {
4206
+ "hits": {
4207
+ "type": "number",
4208
+ "example": 1
4209
+ },
4210
+ "relations": {
4211
+ "$ref": "#/components/schemas/GetRelationsResp"
4212
+ }
4213
+ }
4214
+ },
3232
4215
  "RelationEntity": {
3233
4216
  "allOf": [
3234
4217
  {
@@ -3258,6 +4241,10 @@
3258
4241
  "items": {
3259
4242
  "type": "string"
3260
4243
  }
4244
+ },
4245
+ "reverse": {
4246
+ "description": "Whether this is a reverse relation",
4247
+ "type": "boolean"
3261
4248
  }
3262
4249
  },
3263
4250
  "required": [
@@ -3284,8 +4271,9 @@
3284
4271
  },
3285
4272
  "size": {
3286
4273
  "type": "integer",
3287
- "minimum": 1,
3288
- "default": 10
4274
+ "minimum": 0,
4275
+ "default": 10,
4276
+ "description": "Max search size is 1000 with higher values defaulting to 1000"
3289
4277
  },
3290
4278
  "hydrate": {
3291
4279
  "type": "boolean",
@@ -3303,12 +4291,58 @@
3303
4291
  "_title",
3304
4292
  "first_name"
3305
4293
  ]
4294
+ },
4295
+ "include_scores": {
4296
+ "type": "boolean",
4297
+ "default": false,
4298
+ "description": "Adds a `_score` number field to results that can be used to rank by match score"
4299
+ },
4300
+ "aggs": {
4301
+ "type": "object",
4302
+ "description": "Aggregation supported by ElasticSearch allows summarizing data as metrics, statistics, or other analytics.",
4303
+ "example": {
4304
+ "contact-count-per-tag": {
4305
+ "terms": {
4306
+ "field": "_tags.keyword"
4307
+ }
4308
+ }
4309
+ }
3306
4310
  }
3307
4311
  },
3308
4312
  "required": [
3309
4313
  "q"
3310
4314
  ]
3311
4315
  },
4316
+ "EntityImportParams": {
4317
+ "type": "object",
4318
+ "properties": {
4319
+ "S3Reference": {
4320
+ "type": "object",
4321
+ "properties": {
4322
+ "bucket": {
4323
+ "type": "string",
4324
+ "example": "epilot-files-prod"
4325
+ },
4326
+ "key": {
4327
+ "type": "string",
4328
+ "example": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
4329
+ }
4330
+ },
4331
+ "required": [
4332
+ "bucket",
4333
+ "key"
4334
+ ]
4335
+ },
4336
+ "schema": {
4337
+ "type": "string",
4338
+ "example": "contact"
4339
+ }
4340
+ },
4341
+ "required": [
4342
+ "S3Reference",
4343
+ "schema"
4344
+ ]
4345
+ },
3312
4346
  "EntitySearchResults": {
3313
4347
  "type": "object",
3314
4348
  "properties": {
@@ -3321,6 +4355,25 @@
3321
4355
  "items": {
3322
4356
  "$ref": "#/components/schemas/EntityItem"
3323
4357
  }
4358
+ },
4359
+ "aggregations": {
4360
+ "type": "object",
4361
+ "example": {
4362
+ "contact-count-per-tag": {
4363
+ "doc_count_error_upper_bound": 0,
4364
+ "sum_other_doc_count": 23,
4365
+ "buckets": [
4366
+ {
4367
+ "key": "automation",
4368
+ "doc_count": 108
4369
+ },
4370
+ {
4371
+ "key": "primary",
4372
+ "doc_count": 66
4373
+ }
4374
+ ]
4375
+ }
4376
+ }
3324
4377
  }
3325
4378
  }
3326
4379
  },
@@ -3553,6 +4606,11 @@
3553
4606
  {
3554
4607
  "type": "object",
3555
4608
  "properties": {
4609
+ "operations_total": {
4610
+ "type": "integer",
4611
+ "description": "Count of total operations attached to this activity",
4612
+ "example": 1
4613
+ },
3556
4614
  "operations": {
3557
4615
  "type": "array",
3558
4616
  "items": {
@@ -3567,6 +4625,203 @@
3567
4625
  "description": "Reference to blueprint",
3568
4626
  "type": "string",
3569
4627
  "format": "uuid"
4628
+ },
4629
+ "SavedViewId": {
4630
+ "description": "Generated uuid for a saved view",
4631
+ "type": "string",
4632
+ "format": "uuid"
4633
+ },
4634
+ "SavedViewItem": {
4635
+ "allOf": [
4636
+ {
4637
+ "type": "object",
4638
+ "properties": {
4639
+ "id": {
4640
+ "$ref": "#/components/schemas/SavedViewId"
4641
+ },
4642
+ "created_at": {
4643
+ "type": "string"
4644
+ },
4645
+ "updated_at": {
4646
+ "type": "string"
4647
+ }
4648
+ }
4649
+ },
4650
+ {
4651
+ "$ref": "#/components/schemas/SavedView"
4652
+ }
4653
+ ]
4654
+ },
4655
+ "SavedView": {
4656
+ "description": "A saved entity view",
4657
+ "type": "object",
4658
+ "properties": {
4659
+ "slug": {
4660
+ "type": "array",
4661
+ "description": "list of schemas a view can belong to",
4662
+ "items": {
4663
+ "$ref": "#/components/schemas/EntitySlug"
4664
+ }
4665
+ },
4666
+ "name": {
4667
+ "description": "User-friendly identifier for the saved view",
4668
+ "type": "string",
4669
+ "example": "View listing German"
4670
+ },
4671
+ "org": {
4672
+ "description": "Organisation ID a view belongs to",
4673
+ "type": "string",
4674
+ "example": "66"
4675
+ },
4676
+ "shared": {
4677
+ "description": "boolean property for if a view is shared with organisation",
4678
+ "type": "boolean",
4679
+ "example": true
4680
+ },
4681
+ "created_by": {
4682
+ "anyOf": [
4683
+ {
4684
+ "type": "object",
4685
+ "description": "A user that created the view",
4686
+ "properties": {
4687
+ "user_id": {
4688
+ "type": "string",
4689
+ "example": "10598"
4690
+ }
4691
+ }
4692
+ },
4693
+ {
4694
+ "type": "object",
4695
+ "description": "A system-created view",
4696
+ "properties": {
4697
+ "source": {
4698
+ "type": "string",
4699
+ "enum": [
4700
+ "SYSTEM",
4701
+ "BLUEPRINT"
4702
+ ]
4703
+ }
4704
+ },
4705
+ "additionalProperties": true
4706
+ }
4707
+ ]
4708
+ },
4709
+ "ui_config": {
4710
+ "type": "object",
4711
+ "additionalProperties": true,
4712
+ "example": {
4713
+ "filters": {
4714
+ "customer_name": "suresh test",
4715
+ "_tags": "360"
4716
+ },
4717
+ "table_layout": {
4718
+ "opportunity": {
4719
+ "page": 1,
4720
+ "sort": "_created_at:desc",
4721
+ "pageSize": 25,
4722
+ "columnSettings": []
4723
+ }
4724
+ }
4725
+ }
4726
+ }
4727
+ },
4728
+ "required": [
4729
+ "slug",
4730
+ "name",
4731
+ "created_by",
4732
+ "ui_config"
4733
+ ]
4734
+ },
4735
+ "Taxonomy": {
4736
+ "type": "object",
4737
+ "properties": {
4738
+ "slug": {
4739
+ "$ref": "#/components/schemas/TaxonomySlug"
4740
+ },
4741
+ "name": {
4742
+ "type": "string",
4743
+ "description": "A human friendly name of a Taxonomy e.g. Purpose, Product Category, Folder, Tag",
4744
+ "example": "Purpose"
4745
+ },
4746
+ "plural": {
4747
+ "type": "string",
4748
+ "description": "Plural name of a Taxonomy e.g. Purposes, Product Categories, Folders, Tags",
4749
+ "example": "Purposes"
4750
+ },
4751
+ "created_at": {
4752
+ "type": "string",
4753
+ "format": "date-time"
4754
+ },
4755
+ "updated_at": {
4756
+ "type": "string",
4757
+ "format": "date-time"
4758
+ }
4759
+ },
4760
+ "required": [
4761
+ "slug",
4762
+ "name"
4763
+ ]
4764
+ },
4765
+ "TaxonomyClassification": {
4766
+ "type": "object",
4767
+ "properties": {
4768
+ "id": {
4769
+ "$ref": "#/components/schemas/ClassificationId"
4770
+ },
4771
+ "name": {
4772
+ "type": "string",
4773
+ "example": "Wallbox PV"
4774
+ },
4775
+ "parents": {
4776
+ "type": "array",
4777
+ "items": {
4778
+ "$ref": "#/components/schemas/ClassificationId"
4779
+ }
4780
+ },
4781
+ "created_at": {
4782
+ "type": "string",
4783
+ "format": "date-time"
4784
+ },
4785
+ "updated_at": {
4786
+ "type": "string",
4787
+ "format": "date-time"
4788
+ }
4789
+ },
4790
+ "required": [
4791
+ "name"
4792
+ ]
4793
+ },
4794
+ "ClassificationId": {
4795
+ "type": "string",
4796
+ "format": "uuid"
4797
+ },
4798
+ "TaxonomySlug": {
4799
+ "type": "string",
4800
+ "description": "URL-friendly name for taxonomy",
4801
+ "example": "purpose"
4802
+ },
4803
+ "ClassificationsUpdate": {
4804
+ "type": "object",
4805
+ "properties": {
4806
+ "create": {
4807
+ "type": "array",
4808
+ "items": {
4809
+ "$ref": "#/components/schemas/TaxonomyClassification"
4810
+ }
4811
+ },
4812
+ "update": {
4813
+ "type": "array",
4814
+ "items": {
4815
+ "$ref": "#/components/schemas/TaxonomyClassification"
4816
+ }
4817
+ },
4818
+ "delete": {
4819
+ "type": "array",
4820
+ "items": {
4821
+ "$ref": "#/components/schemas/ClassificationId"
4822
+ }
4823
+ }
4824
+ }
3570
4825
  }
3571
4826
  },
3572
4827
  "examples": {