@epilot/entity-client 4.1.7 → 4.3.0

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,10 @@
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"
28
32
  }
29
33
  ],
30
34
  "security": [
@@ -964,7 +968,7 @@
964
968
  "get": {
965
969
  "operationId": "getRelations",
966
970
  "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.",
971
+ "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
972
  "tags": [
969
973
  "Relations"
970
974
  ],
@@ -995,6 +999,15 @@
995
999
  "default": false,
996
1000
  "type": "boolean"
997
1001
  }
1002
+ },
1003
+ {
1004
+ "in": "query",
1005
+ "name": "include_reverse",
1006
+ "description": "When true, includes reverse relations in response (other entities pointing to this entity)",
1007
+ "schema": {
1008
+ "default": false,
1009
+ "type": "boolean"
1010
+ }
998
1011
  }
999
1012
  ],
1000
1013
  "responses": {
@@ -1048,7 +1061,7 @@
1048
1061
  "post": {
1049
1062
  "operationId": "addRelations",
1050
1063
  "summary": "addRelations",
1051
- "description": "It relates one or more entities to some parent entity, by providing meaning for relations via attribute field.",
1064
+ "description": "Relates one or more entities to parent entity by adding items to a relation attribute",
1052
1065
  "tags": [
1053
1066
  "Relations"
1054
1067
  ],
@@ -1119,7 +1132,7 @@
1119
1132
  "put": {
1120
1133
  "operationId": "updateRelation",
1121
1134
  "summary": "updateRelation",
1122
- "description": "It updates a relation between two entities.",
1135
+ "description": "Updates an existing relation between two entities.",
1123
1136
  "tags": [
1124
1137
  "Relations"
1125
1138
  ],
@@ -1200,7 +1213,7 @@
1200
1213
  "delete": {
1201
1214
  "operationId": "deleteRelation",
1202
1215
  "summary": "deleteRelation",
1203
- "description": "It deletes a relation between one entity and the other.",
1216
+ "description": "Removes relation between two entities",
1204
1217
  "tags": [
1205
1218
  "Relations"
1206
1219
  ],
@@ -1265,6 +1278,14 @@
1265
1278
  "schema": {
1266
1279
  "$ref": "#/components/schemas/ExportJobId"
1267
1280
  }
1281
+ },
1282
+ {
1283
+ "in": "query",
1284
+ "name": "is_template",
1285
+ "description": "Pass 'true' to generate import template",
1286
+ "schema": {
1287
+ "$ref": "#/components/schemas/IsTemplate"
1288
+ }
1268
1289
  }
1269
1290
  ],
1270
1291
  "requestBody": {
@@ -1282,6 +1303,203 @@
1282
1303
  }
1283
1304
  }
1284
1305
  }
1306
+ },
1307
+ "/v1/entity:import": {
1308
+ "post": {
1309
+ "operationId": "importEntities",
1310
+ "summary": "importEntities",
1311
+ "description": "import entity data from",
1312
+ "tags": [
1313
+ "Export"
1314
+ ],
1315
+ "parameters": [
1316
+ {
1317
+ "in": "query",
1318
+ "name": "job_id",
1319
+ "description": "Import Job Id to get the result",
1320
+ "schema": {
1321
+ "$ref": "#/components/schemas/ExportJobId"
1322
+ }
1323
+ }
1324
+ ],
1325
+ "requestBody": {
1326
+ "content": {
1327
+ "application/json": {
1328
+ "schema": {
1329
+ "$ref": "#/components/schemas/EntityImportParams"
1330
+ }
1331
+ }
1332
+ }
1333
+ },
1334
+ "responses": {
1335
+ "201": {
1336
+ "description": "created import url and download url"
1337
+ }
1338
+ }
1339
+ }
1340
+ },
1341
+ "/v1/entity/views": {
1342
+ "get": {
1343
+ "operationId": "listSavedViews",
1344
+ "summary": "listSavedViews",
1345
+ "description": "Get the Saved Views based on the schema",
1346
+ "tags": [
1347
+ "Saved Views"
1348
+ ],
1349
+ "responses": {
1350
+ "200": {
1351
+ "description": "Success",
1352
+ "content": {
1353
+ "application/json": {
1354
+ "schema": {
1355
+ "type": "object",
1356
+ "properties": {
1357
+ "results": {
1358
+ "type": "array",
1359
+ "items": {
1360
+ "$ref": "#/components/schemas/SavedViewItem"
1361
+ }
1362
+ }
1363
+ }
1364
+ }
1365
+ }
1366
+ }
1367
+ }
1368
+ }
1369
+ }
1370
+ },
1371
+ "/v1/entity/view": {
1372
+ "post": {
1373
+ "operationId": "createSavedView",
1374
+ "summary": "createSavedView",
1375
+ "description": "Creates a new saved view",
1376
+ "tags": [
1377
+ "Saved Views"
1378
+ ],
1379
+ "requestBody": {
1380
+ "content": {
1381
+ "application/json": {
1382
+ "schema": {
1383
+ "$ref": "#/components/schemas/SavedView"
1384
+ }
1385
+ }
1386
+ }
1387
+ },
1388
+ "responses": {
1389
+ "201": {
1390
+ "description": "Success",
1391
+ "content": {
1392
+ "application/json": {
1393
+ "schema": {
1394
+ "$ref": "#/components/schemas/SavedViewItem"
1395
+ }
1396
+ }
1397
+ }
1398
+ }
1399
+ }
1400
+ }
1401
+ },
1402
+ "/v1/entity/view/{id}": {
1403
+ "get": {
1404
+ "operationId": "getSavedView",
1405
+ "summary": "getSavedView",
1406
+ "description": "Gets Saved View configuration by id.",
1407
+ "tags": [
1408
+ "Saved Views"
1409
+ ],
1410
+ "parameters": [
1411
+ {
1412
+ "in": "path",
1413
+ "name": "id",
1414
+ "description": "View id",
1415
+ "required": true,
1416
+ "schema": {
1417
+ "$ref": "#/components/schemas/SavedViewId"
1418
+ }
1419
+ }
1420
+ ],
1421
+ "responses": {
1422
+ "200": {
1423
+ "description": "Success",
1424
+ "content": {
1425
+ "application/json": {
1426
+ "schema": {
1427
+ "type": "object",
1428
+ "properties": {
1429
+ "view": {
1430
+ "$ref": "#/components/schemas/SavedViewItem"
1431
+ }
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ }
1437
+ }
1438
+ },
1439
+ "put": {
1440
+ "operationId": "updateSavedView",
1441
+ "summary": "updateSavedView",
1442
+ "description": "Updates a saved view",
1443
+ "tags": [
1444
+ "Saved Views"
1445
+ ],
1446
+ "parameters": [
1447
+ {
1448
+ "in": "path",
1449
+ "name": "id",
1450
+ "description": "View id",
1451
+ "required": true,
1452
+ "schema": {
1453
+ "$ref": "#/components/schemas/SavedViewId"
1454
+ }
1455
+ }
1456
+ ],
1457
+ "requestBody": {
1458
+ "content": {
1459
+ "application/json": {
1460
+ "schema": {
1461
+ "$ref": "#/components/schemas/SavedView"
1462
+ }
1463
+ }
1464
+ }
1465
+ },
1466
+ "responses": {
1467
+ "200": {
1468
+ "description": "Success",
1469
+ "content": {
1470
+ "application/json": {
1471
+ "schema": {
1472
+ "$ref": "#/components/schemas/SavedViewItem"
1473
+ }
1474
+ }
1475
+ }
1476
+ }
1477
+ }
1478
+ },
1479
+ "delete": {
1480
+ "operationId": "deleteSavedView",
1481
+ "summary": "deleteSavedView",
1482
+ "description": "Deletes a saved view",
1483
+ "parameters": [
1484
+ {
1485
+ "in": "path",
1486
+ "name": "id",
1487
+ "description": "View id",
1488
+ "required": true,
1489
+ "schema": {
1490
+ "$ref": "#/components/schemas/SavedViewId"
1491
+ }
1492
+ }
1493
+ ],
1494
+ "tags": [
1495
+ "Saved Views"
1496
+ ],
1497
+ "responses": {
1498
+ "200": {
1499
+ "description": "List of all available saved views"
1500
+ }
1501
+ }
1502
+ }
1285
1503
  }
1286
1504
  },
1287
1505
  "components": {
@@ -1304,6 +1522,10 @@
1304
1522
  "description": "Export Job Id to get the result",
1305
1523
  "type": "string"
1306
1524
  },
1525
+ "IsTemplate": {
1526
+ "description": "Pass 'true' to generate import template",
1527
+ "type": "boolean"
1528
+ },
1307
1529
  "SchemaId": {
1308
1530
  "description": "Generated uuid for schema",
1309
1531
  "type": "string",
@@ -1333,7 +1555,7 @@
1333
1555
  "type": "array",
1334
1556
  "items": {
1335
1557
  "type": "string",
1336
- "example": "ecommerce_preview"
1558
+ "example": "360_features"
1337
1559
  }
1338
1560
  },
1339
1561
  "name": {
@@ -2360,6 +2582,14 @@
2360
2582
  "type": "boolean",
2361
2583
  "default": true,
2362
2584
  "description": "When enable_relation_tags is set to true the user will be able to set tags(labels) in each relation item."
2585
+ },
2586
+ "add_button_label": {
2587
+ "type": "string",
2588
+ "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."
2589
+ },
2590
+ "search_placeholder": {
2591
+ "type": "string",
2592
+ "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
2593
  }
2364
2594
  }
2365
2595
  }
@@ -3258,6 +3488,10 @@
3258
3488
  "items": {
3259
3489
  "type": "string"
3260
3490
  }
3491
+ },
3492
+ "reverse": {
3493
+ "description": "Whether this is a reverse relation",
3494
+ "type": "boolean"
3261
3495
  }
3262
3496
  },
3263
3497
  "required": [
@@ -3285,7 +3519,8 @@
3285
3519
  "size": {
3286
3520
  "type": "integer",
3287
3521
  "minimum": 1,
3288
- "default": 10
3522
+ "default": 10,
3523
+ "description": "Max search size is 1000 with higher values defaulting to 1000"
3289
3524
  },
3290
3525
  "hydrate": {
3291
3526
  "type": "boolean",
@@ -3303,12 +3538,47 @@
3303
3538
  "_title",
3304
3539
  "first_name"
3305
3540
  ]
3541
+ },
3542
+ "include_scores": {
3543
+ "type": "boolean",
3544
+ "default": false,
3545
+ "description": "Adds a `_score` number field to results that can be used to rank by match score"
3306
3546
  }
3307
3547
  },
3308
3548
  "required": [
3309
3549
  "q"
3310
3550
  ]
3311
3551
  },
3552
+ "EntityImportParams": {
3553
+ "type": "object",
3554
+ "properties": {
3555
+ "S3Reference": {
3556
+ "type": "object",
3557
+ "properties": {
3558
+ "bucket": {
3559
+ "type": "string",
3560
+ "example": "epilot-files-prod"
3561
+ },
3562
+ "key": {
3563
+ "type": "string",
3564
+ "example": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
3565
+ }
3566
+ },
3567
+ "required": [
3568
+ "bucket",
3569
+ "key"
3570
+ ]
3571
+ },
3572
+ "schema": {
3573
+ "type": "string",
3574
+ "example": "contact"
3575
+ }
3576
+ },
3577
+ "required": [
3578
+ "S3Reference",
3579
+ "schema"
3580
+ ]
3581
+ },
3312
3582
  "EntitySearchResults": {
3313
3583
  "type": "object",
3314
3584
  "properties": {
@@ -3567,6 +3837,101 @@
3567
3837
  "description": "Reference to blueprint",
3568
3838
  "type": "string",
3569
3839
  "format": "uuid"
3840
+ },
3841
+ "SavedViewId": {
3842
+ "description": "Generated uuid for a saved view",
3843
+ "type": "string",
3844
+ "format": "uuid"
3845
+ },
3846
+ "SavedViewItem": {
3847
+ "allOf": [
3848
+ {
3849
+ "type": "object",
3850
+ "properties": {
3851
+ "id": {
3852
+ "$ref": "#/components/schemas/SavedViewId"
3853
+ },
3854
+ "created_at": {
3855
+ "type": "string"
3856
+ },
3857
+ "updated_at": {
3858
+ "type": "string"
3859
+ }
3860
+ }
3861
+ },
3862
+ {
3863
+ "$ref": "#/components/schemas/SavedView"
3864
+ }
3865
+ ]
3866
+ },
3867
+ "SavedView": {
3868
+ "description": "A saved entity view",
3869
+ "type": "object",
3870
+ "properties": {
3871
+ "slug": {
3872
+ "type": "array",
3873
+ "description": "list of schemas a view can belong to",
3874
+ "items": {
3875
+ "$ref": "#/components/schemas/EntitySlug"
3876
+ }
3877
+ },
3878
+ "name": {
3879
+ "description": "User-friendly identifier for the saved view",
3880
+ "type": "string",
3881
+ "example": "View listing German customers"
3882
+ },
3883
+ "created_by": {
3884
+ "anyOf": [
3885
+ {
3886
+ "type": "object",
3887
+ "description": "A user that created the view",
3888
+ "properties": {
3889
+ "user_id": {
3890
+ "type": "string",
3891
+ "example": "10598"
3892
+ }
3893
+ }
3894
+ },
3895
+ {
3896
+ "type": "object",
3897
+ "description": "A system-created view",
3898
+ "properties": {
3899
+ "source": {
3900
+ "type": "string",
3901
+ "enum": [
3902
+ "SYSTEM",
3903
+ "BLUEPRINT"
3904
+ ]
3905
+ }
3906
+ },
3907
+ "additionalProperties": true
3908
+ }
3909
+ ]
3910
+ },
3911
+ "ui_config": {
3912
+ "type": "object",
3913
+ "example": {
3914
+ "filters": {
3915
+ "customer_name": "suresh test",
3916
+ "_tags": "360"
3917
+ },
3918
+ "table_layout": {
3919
+ "opportunity": {
3920
+ "page": 1,
3921
+ "sort": "_created_at:desc",
3922
+ "pageSize": 25,
3923
+ "columnSettings": []
3924
+ }
3925
+ }
3926
+ }
3927
+ }
3928
+ },
3929
+ "required": [
3930
+ "slug",
3931
+ "name",
3932
+ "created_by",
3933
+ "ui_config"
3934
+ ]
3570
3935
  }
3571
3936
  },
3572
3937
  "examples": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-client",
3
- "version": "4.1.7",
3
+ "version": "4.3.0",
4
4
  "description": "JavaScript client library for the epilot Core Entity API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -71,6 +71,5 @@
71
71
  "typescript": "^4.1.3",
72
72
  "webpack": "^5.18.0",
73
73
  "webpack-cli": "^4.4.0"
74
- },
75
- "gitHead": "1cd202255ce447f3167d54b2589f6a90386850cb"
74
+ }
76
75
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2022 epilot GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.