@epilot/entity-client 4.8.0 → 4.8.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.
Files changed (2) hide show
  1. package/dist/openapi.d.ts +184 -43
  2. package/package.json +2 -2
package/dist/openapi.d.ts CHANGED
@@ -1382,21 +1382,6 @@ declare namespace Components {
1382
1382
  Entity;
1383
1383
  };
1384
1384
  }
1385
- /**
1386
- * example:
1387
- * {
1388
- * "type": "redirect",
1389
- * "route": "/app/pricing-hub/product/:entityId"
1390
- * }
1391
- */
1392
- export interface EntityParcelView {
1393
- view_type?: "parcel";
1394
- /**
1395
- * example:
1396
- * @epilot360/pricing-hub-app
1397
- */
1398
- import?: string;
1399
- }
1400
1385
  /**
1401
1386
  * The "type" of an Entity. Describes the shape. Includes Entity Attributes, Relations and Capabilities.
1402
1387
  */
@@ -1452,10 +1437,38 @@ declare namespace Components {
1452
1437
  */
1453
1438
  title_template?: string;
1454
1439
  ui_config?: {
1455
- table_view?: EntityViewConfig;
1456
- create_view?: EntityViewConfig;
1457
- edit_view?: EntityViewConfig;
1458
- single_view?: EntityViewConfig;
1440
+ table_view?: EntityDefaultTable | /**
1441
+ * example:
1442
+ * {
1443
+ * "type": "redirect",
1444
+ * "route": "/app/pricing-hub/product/:entityId"
1445
+ * }
1446
+ */
1447
+ RedirectEntityView | EntityViewDisabled;
1448
+ create_view?: EntityDefaultCreate | /**
1449
+ * example:
1450
+ * {
1451
+ * "type": "redirect",
1452
+ * "route": "/app/pricing-hub/product/:entityId"
1453
+ * }
1454
+ */
1455
+ RedirectEntityView | EntityViewDisabled;
1456
+ edit_view?: EntityDefaultEdit | /**
1457
+ * example:
1458
+ * {
1459
+ * "type": "redirect",
1460
+ * "route": "/app/pricing-hub/product/:entityId"
1461
+ * }
1462
+ */
1463
+ RedirectEntityView | EntityViewDisabled;
1464
+ single_view?: EntityDefaultEdit | /**
1465
+ * example:
1466
+ * {
1467
+ * "type": "redirect",
1468
+ * "route": "/app/pricing-hub/product/:entityId"
1469
+ * }
1470
+ */
1471
+ RedirectEntityView | EntityViewDisabled;
1459
1472
  list_item?: {
1460
1473
  summary_attributes?: (/**
1461
1474
  * Represents an expanded version of an attribute to be displayed in the list item summary.
@@ -1674,10 +1687,38 @@ declare namespace Components {
1674
1687
  */
1675
1688
  title_template?: string;
1676
1689
  ui_config?: {
1677
- table_view?: EntityViewConfig;
1678
- create_view?: EntityViewConfig;
1679
- edit_view?: EntityViewConfig;
1680
- single_view?: EntityViewConfig;
1690
+ table_view?: EntityDefaultTable | /**
1691
+ * example:
1692
+ * {
1693
+ * "type": "redirect",
1694
+ * "route": "/app/pricing-hub/product/:entityId"
1695
+ * }
1696
+ */
1697
+ RedirectEntityView | EntityViewDisabled;
1698
+ create_view?: EntityDefaultCreate | /**
1699
+ * example:
1700
+ * {
1701
+ * "type": "redirect",
1702
+ * "route": "/app/pricing-hub/product/:entityId"
1703
+ * }
1704
+ */
1705
+ RedirectEntityView | EntityViewDisabled;
1706
+ edit_view?: EntityDefaultEdit | /**
1707
+ * example:
1708
+ * {
1709
+ * "type": "redirect",
1710
+ * "route": "/app/pricing-hub/product/:entityId"
1711
+ * }
1712
+ */
1713
+ RedirectEntityView | EntityViewDisabled;
1714
+ single_view?: EntityDefaultEdit | /**
1715
+ * example:
1716
+ * {
1717
+ * "type": "redirect",
1718
+ * "route": "/app/pricing-hub/product/:entityId"
1719
+ * }
1720
+ */
1721
+ RedirectEntityView | EntityViewDisabled;
1681
1722
  list_item?: {
1682
1723
  summary_attributes?: (/**
1683
1724
  * Represents an expanded version of an attribute to be displayed in the list item summary.
@@ -1869,7 +1910,15 @@ declare namespace Components {
1869
1910
  */
1870
1911
  include_scores?: boolean;
1871
1912
  /**
1872
- * Aggregation
1913
+ * Aggregation supported by ElasticSearch allows summarizing data as metrics, statistics, or other analytics.
1914
+ * example:
1915
+ * {
1916
+ * "contact-count-per-tag": {
1917
+ * "terms": {
1918
+ * "field": "_tags.keyword"
1919
+ * }
1920
+ * }
1921
+ * }
1873
1922
  */
1874
1923
  aggs?: {
1875
1924
  [key: string]: any;
@@ -1898,6 +1947,25 @@ declare namespace Components {
1898
1947
  * }
1899
1948
  */
1900
1949
  EntityItem[];
1950
+ /**
1951
+ * example:
1952
+ * {
1953
+ * "contact-count-per-tag": {
1954
+ * "doc_count_error_upper_bound": 0,
1955
+ * "sum_other_doc_count": 23,
1956
+ * "buckets": [
1957
+ * {
1958
+ * "key": "automation",
1959
+ * "doc_count": 108
1960
+ * },
1961
+ * {
1962
+ * "key": "primary",
1963
+ * "doc_count": 66
1964
+ * }
1965
+ * ]
1966
+ * }
1967
+ * }
1968
+ */
1901
1969
  aggregations?: {
1902
1970
  [key: string]: any;
1903
1971
  };
@@ -1908,21 +1976,6 @@ declare namespace Components {
1908
1976
  * contact
1909
1977
  */
1910
1978
  export type EntitySlug = string;
1911
- export type EntityViewConfig = EntityDefaultCreate | EntityDefaultEdit | EntityDefaultTable | /**
1912
- * example:
1913
- * {
1914
- * "type": "redirect",
1915
- * "route": "/app/pricing-hub/product/:entityId"
1916
- * }
1917
- */
1918
- RedirectEntityView | /**
1919
- * example:
1920
- * {
1921
- * "type": "redirect",
1922
- * "route": "/app/pricing-hub/product/:entityId"
1923
- * }
1924
- */
1925
- EntityParcelView | EntityViewDisabled;
1926
1979
  export interface EntityViewDisabled {
1927
1980
  view_type?: "disabled";
1928
1981
  }
@@ -2049,6 +2102,14 @@ declare namespace Components {
2049
2102
  * }
2050
2103
  */
2051
2104
  RelationEntity)[];
2105
+ export interface GetRelationsRespWithPagination {
2106
+ /**
2107
+ * example:
2108
+ * 1
2109
+ */
2110
+ hits?: number;
2111
+ relations?: GetRelationsResp;
2112
+ }
2052
2113
  /**
2053
2114
  * Entity with relation data resolved into the attribute values
2054
2115
  * example:
@@ -3545,7 +3606,7 @@ declare namespace Components {
3545
3606
  * }
3546
3607
  */
3547
3608
  ui_config: {
3548
- [key: string]: any;
3609
+ [name: string]: any;
3549
3610
  };
3550
3611
  }
3551
3612
  /**
@@ -3614,7 +3675,7 @@ declare namespace Components {
3614
3675
  * }
3615
3676
  */
3616
3677
  ui_config: {
3617
- [key: string]: any;
3678
+ [name: string]: any;
3618
3679
  };
3619
3680
  }
3620
3681
  /**
@@ -3728,10 +3789,10 @@ declare namespace Components {
3728
3789
  */
3729
3790
  protected?: boolean;
3730
3791
  type?: "select" | "radio";
3731
- options?: ((string | null) | {
3792
+ options?: ({
3732
3793
  value: string;
3733
3794
  title?: string;
3734
- })[];
3795
+ } | (string | null))[];
3735
3796
  /**
3736
3797
  * Allow arbitrary input values in addition to provided options
3737
3798
  */
@@ -4707,6 +4768,54 @@ declare namespace Paths {
4707
4768
  export type $200 = Components.Schemas.GetRelationsResp;
4708
4769
  }
4709
4770
  }
4771
+ namespace GetRelationsV2 {
4772
+ namespace Parameters {
4773
+ /**
4774
+ * example:
4775
+ * [
4776
+ * "_id",
4777
+ * "_schema",
4778
+ * "_title"
4779
+ * ]
4780
+ */
4781
+ export type Fields = string[];
4782
+ export type From = number;
4783
+ export type Hydrate = boolean;
4784
+ export type Id = Components.Schemas.EntityId /* uuid */;
4785
+ export type IncludeReverse = boolean;
4786
+ export type Query = string;
4787
+ export type Size = number;
4788
+ export type Slug = /**
4789
+ * URL-friendly identifier for the entity schema
4790
+ * example:
4791
+ * contact
4792
+ */
4793
+ Components.Schemas.EntitySlug;
4794
+ }
4795
+ export interface PathParameters {
4796
+ slug: Parameters.Slug;
4797
+ id: Parameters.Id;
4798
+ }
4799
+ export interface QueryParameters {
4800
+ hydrate?: Parameters.Hydrate;
4801
+ query?: Parameters.Query;
4802
+ include_reverse?: Parameters.IncludeReverse;
4803
+ from?: Parameters.From;
4804
+ size?: Parameters.Size;
4805
+ fields?: /**
4806
+ * example:
4807
+ * [
4808
+ * "_id",
4809
+ * "_schema",
4810
+ * "_title"
4811
+ * ]
4812
+ */
4813
+ Parameters.Fields;
4814
+ }
4815
+ namespace Responses {
4816
+ export type $200 = Components.Schemas.GetRelationsRespWithPagination;
4817
+ }
4818
+ }
4710
4819
  namespace GetSavedView {
4711
4820
  namespace Parameters {
4712
4821
  export type Id = /* Generated uuid for a saved view */ Components.Schemas.SavedViewId /* uuid */;
@@ -5528,6 +5637,21 @@ export interface OperationMethods {
5528
5637
  data?: Paths.AddRelations.RequestBody,
5529
5638
  config?: AxiosRequestConfig
5530
5639
  ): OperationResponse<Paths.AddRelations.Responses.$200>
5640
+ /**
5641
+ * getRelationsV2 - getRelationsV2
5642
+ *
5643
+ * Returns 1st level direct relations for an entity with pagination.
5644
+ *
5645
+ * You can control whether to return the full entity or just the relation item with the `?hydrate` query param.
5646
+ *
5647
+ * Reverse relations i.e. entities referring to this entity are included with the `?include_reverse` query param.
5648
+ *
5649
+ */
5650
+ 'getRelationsV2'(
5651
+ parameters?: Parameters<Paths.GetRelationsV2.PathParameters & Paths.GetRelationsV2.QueryParameters> | null,
5652
+ data?: any,
5653
+ config?: AxiosRequestConfig
5654
+ ): OperationResponse<Paths.GetRelationsV2.Responses.$200>
5531
5655
  /**
5532
5656
  * updateRelation - updateRelation
5533
5657
  *
@@ -6104,6 +6228,23 @@ export interface PathsDictionary {
6104
6228
  config?: AxiosRequestConfig
6105
6229
  ): OperationResponse<Paths.AddRelations.Responses.$200>
6106
6230
  }
6231
+ ['/v2/entity/{slug}/{id}/relations']: {
6232
+ /**
6233
+ * getRelationsV2 - getRelationsV2
6234
+ *
6235
+ * Returns 1st level direct relations for an entity with pagination.
6236
+ *
6237
+ * You can control whether to return the full entity or just the relation item with the `?hydrate` query param.
6238
+ *
6239
+ * Reverse relations i.e. entities referring to this entity are included with the `?include_reverse` query param.
6240
+ *
6241
+ */
6242
+ 'get'(
6243
+ parameters?: Parameters<Paths.GetRelationsV2.PathParameters & Paths.GetRelationsV2.QueryParameters> | null,
6244
+ data?: any,
6245
+ config?: AxiosRequestConfig
6246
+ ): OperationResponse<Paths.GetRelationsV2.Responses.$200>
6247
+ }
6107
6248
  ['/v1/entity/{slug}/{id}/relations/{attribute}/{entity_id}']: {
6108
6249
  /**
6109
6250
  * updateRelation - updateRelation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-client",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
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",
@@ -25,7 +25,7 @@
25
25
  "typescript": "tsc",
26
26
  "bundle-definition": "webpack",
27
27
  "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/entity.yaml",
28
- "typegen": "echo /* eslint-disable */ > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
28
+ "typegen": "echo '/* eslint-disable */' > src/openapi.d.ts && typegen ./src/openapi.json >> src/openapi.d.ts",
29
29
  "build": "tsc && npm run bundle-definition",
30
30
  "build:watch": "npm run build && tsc -w",
31
31
  "release-alpha": "npm version prerelease --preid alpha",