@cloudcommerce/api 0.38.0 → 0.40.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @cloudcommerce/api@0.37.1 build /home/leo/code/ecomplus/cloud-commerce/packages/api
2
+ > @cloudcommerce/api@0.39.0 build /home/leo/code/ecomplus/cloud-commerce/packages/api
3
3
  > bash ../../scripts/build-lib.sh
4
4
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @cloudcommerce/api@0.37.1 test /home/leo/code/ecomplus/cloud-commerce/packages/api
2
+ > @cloudcommerce/api@0.39.0 test /home/leo/code/ecomplus/cloud-commerce/packages/api
3
3
  > tsc -p ../../tsconfig.test.json && vitest run
4
4
 
5
5
 
6
- RUN v1.0.4 /home/leo/code/ecomplus/cloud-commerce/packages/api
6
+ RUN v1.1.0 /home/leo/code/ecomplus/cloud-commerce/packages/api
7
7
 
8
8
  ✓ tests/index.test.ts > Read product and typecheck SKU
9
9
  ✓ tests/index.test.ts > 404 with different Store ID from env
@@ -13,6 +13,6 @@
13
13
 
14
14
  Test Files 1 passed (1)
15
15
  Tests 5 passed (5)
16
- Start at 19:07:56
17
- Duration 1.05s (transform 123ms, setup 0ms, collect 109ms, tests 424ms, environment 0ms, prepare 147ms)
16
+ Start at 04:29:39
17
+ Duration 1.41s (transform 118ms, setup 0ms, collect 107ms, tests 731ms, environment 0ms, prepare 195ms)
18
18
 
package/lib/api.d.ts CHANGED
@@ -59,7 +59,7 @@ declare const api: {
59
59
  _id: import("../types.d").ResourceId;
60
60
  };
61
61
  }>;
62
- put: <E_1 extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C_1 extends AbstractedConfig>(endpoint: E_1, body: RequestBody<{
62
+ put: <E_1 extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | (("search/v1" | `search/v1?${string}`) | "search/_els" | `search/_els?${string}`) | ("search/v1/history" | `search/v1/history?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C_1 extends AbstractedConfig>(endpoint: E_1, body: RequestBody<{
63
63
  endpoint: E_1;
64
64
  method: 'put';
65
65
  }>, config?: C_1 | undefined) => Promise<Response & {
@@ -103,7 +103,7 @@ declare const post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E
103
103
  _id: import("../types.d").ResourceId;
104
104
  };
105
105
  }>;
106
- declare const put: <E extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
106
+ declare const put: <E extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `stores/me/${string}` | `authentications/me/${string}` | `slugs/${string}` | (("search/v1" | `search/v1?${string}`) | "search/_els" | `search/_els?${string}`) | ("search/v1/history" | `search/v1/history?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
107
107
  endpoint: E;
108
108
  method: 'put';
109
109
  }>, config?: C | undefined) => Promise<Response & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.38.0",
4
+ "version": "0.40.0",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/api.js",
7
7
  "types": "lib/api.d.ts",
@@ -5,10 +5,25 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Installed API extension app
10
+ */
8
11
  export interface Applications {
12
+ /**
13
+ * Application ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
14
29
  * ID of application on marketplace
@@ -5,11 +5,25 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Authenticated API user
10
+ */
8
11
  export interface Authentications {
12
+ /**
13
+ * Authentication ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
12
24
  /**
25
+ * List of store IDs granted for this authentication [auto]
26
+ *
13
27
  * @maxItems 500
14
28
  */
15
29
  store_ids: number[];
package/types/brands.d.ts CHANGED
@@ -5,12 +5,29 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Brand object model
10
+ */
8
11
  export interface Brands {
12
+ /**
13
+ * Brand ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
29
+ * List of sales channels if brand not available in all channels
30
+ *
14
31
  * @maxItems 10
15
32
  */
16
33
  channel_ids?: string[];
package/types/carts.d.ts CHANGED
@@ -9,9 +9,21 @@
9
9
  * Shopping cart object model
10
10
  */
11
11
  export interface Carts {
12
+ /**
13
+ * Cart ID (ObjectID) [auto]
14
+ */
12
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
13
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
14
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
15
27
  store_id: number;
16
28
  /**
17
29
  * Whether cart was created by staff and is trusted
@@ -5,12 +5,29 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Category object model
10
+ */
8
11
  export interface Categories {
12
+ /**
13
+ * Category ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
29
+ * List of sales channels if category not available in all channels
30
+ *
14
31
  * @maxItems 10
15
32
  */
16
33
  channel_ids?: string[];
@@ -5,10 +5,25 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Collection object model
10
+ */
8
11
  export interface Collections {
12
+ /**
13
+ * Collection ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
14
29
  * Collection full name
@@ -9,9 +9,21 @@
9
9
  * Customer object model
10
10
  */
11
11
  export interface Customers {
12
+ /**
13
+ * Customer ID (ObjectID) [auto]
14
+ */
12
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
13
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
14
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
15
27
  store_id: number;
16
28
  /**
17
29
  * Whether customer was registered by staff and is trusted
package/types/grids.d.ts CHANGED
@@ -5,10 +5,25 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Grid object model
10
+ */
8
11
  export interface Grids {
12
+ /**
13
+ * Grid ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
14
29
  * Grid title
package/types/orders.d.ts CHANGED
@@ -9,9 +9,21 @@
9
9
  * Order object model
10
10
  */
11
11
  export interface Orders {
12
+ /**
13
+ * Order ID (ObjectID) [auto]
14
+ */
12
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
13
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
14
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
15
27
  store_id: number;
16
28
  /**
17
29
  * Whether order was created by staff and is trusted
@@ -70,6 +82,9 @@ export interface Orders {
70
82
  * User-Agent of the browser (if any) used by the customer
71
83
  */
72
84
  client_user_agent?: string;
85
+ /**
86
+ * Sales channel unique identifier or domain name
87
+ */
73
88
  channel_id?: string;
74
89
  /**
75
90
  * Channel type or source
@@ -5,12 +5,29 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Product object model
10
+ */
8
11
  export interface Products {
12
+ /**
13
+ * Product ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
29
+ * List of sales channels if product not available in all channels
30
+ *
14
31
  * @maxItems 10
15
32
  */
16
33
  channel_ids?: string[];
package/types/stores.d.ts CHANGED
@@ -5,10 +5,25 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * Head store and company info
10
+ */
8
11
  export interface Stores {
12
+ /**
13
+ * Store ID (ObjectID) [auto]
14
+ */
9
15
  _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
10
19
  created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
11
23
  updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
12
27
  store_id: number;
13
28
  /**
14
29
  * Store name
package/types.d.ts CHANGED
@@ -30,11 +30,15 @@ type ResourceAndFind = ResourceAndId
30
30
  | 'authentications/me';
31
31
  type ResourceOpQuery = Resource | `${Resource}?${string}`;
32
32
 
33
- type SearchOpQuery = 'search/v1'
34
- | `search/v1?${string}`
33
+ type SearchV1OpQuery = 'search/v1'
34
+ | `search/v1?${string}`;
35
+ type SearchOpQuery = SearchV1OpQuery
35
36
  | 'search/_els'
36
37
  | `search/_els?${string}`;
37
38
 
39
+ type SearchHistoryOpQuery = 'search/v1/history'
40
+ | `search/v1/history?${string}`;
41
+
38
42
  type EventsEndpoint = `events/${Resource}`
39
43
  | `events/${ResourceAndId}`
40
44
  | 'events/me';
@@ -44,6 +48,7 @@ type Endpoint = ResourceOpQuery
44
48
  | `${ResourceAndFind}/${string}`
45
49
  | `slugs/${string}`
46
50
  | SearchOpQuery
51
+ | SearchHistoryOpQuery
47
52
  | EventsEndpoint
48
53
  | 'login'
49
54
  | 'authenticate'
@@ -72,7 +77,10 @@ type Config = {
72
77
  buckets?: boolean,
73
78
  verbose?: boolean,
74
79
  concise?: boolean,
75
- params?: Record<string, string | number | boolean | string[] | number[]> | string,
80
+ params?: string | Record<
81
+ string,
82
+ string | number | boolean | string[] | number[] | undefined,
83
+ >,
76
84
  headers?: Headers | Record<string, string>,
77
85
  timeout?: number,
78
86
  maxRetries?: number,
@@ -284,9 +292,9 @@ type SearchItem<Fields extends null | string[] | '*' = '*'> = Omit<(
284
292
 
285
293
  type SearchResult<
286
294
  TEndpoint extends SearchOpQuery | 'v1' | 'els',
287
- Fields extends string[] | null = TEndpoint extends 'search/v1' | 'v1' ? null : '*',
295
+ Fields extends string[] | null = TEndpoint extends SearchV1OpQuery | 'v1' ? null : '*',
288
296
  > =
289
- TEndpoint extends 'search/v1' | `search/v1?${string}` | 'v1' ? {
297
+ TEndpoint extends SearchV1OpQuery | 'v1' ? {
290
298
  result: SearchItem<Fields>[],
291
299
  meta: BaseListResultMeta & {
292
300
  count?: number,
@@ -302,10 +310,10 @@ type SearchResult<
302
310
  avg: null | number,
303
311
  count: number,
304
312
  }>,
305
- 'brands/name'?: {
313
+ 'brands.name'?: {
306
314
  [key: string]: number,
307
315
  },
308
- 'categories/name'?: {
316
+ 'categories.name'?: {
309
317
  [key: string]: number,
310
318
  },
311
319
  specs?: {
@@ -325,6 +333,21 @@ type SearchResult<
325
333
  } :
326
334
  never;
327
335
 
336
+ type SearchHistoryResult = {
337
+ result: Array<{
338
+ terms: string[];
339
+ hits_count?: number;
340
+ counted_at?: string;
341
+ }>,
342
+ meta: {
343
+ offset: number,
344
+ limit: number,
345
+ query: {
346
+ terms?: any,
347
+ },
348
+ },
349
+ };
350
+
328
351
  type EventFieldsByEndpoint<TEndpoint extends EventsEndpoint> =
329
352
  TEndpoint extends `events/${Resource}` ? {
330
353
  resource_id: ResourceId,
@@ -358,7 +381,7 @@ type EventsResult<TEndpoint extends EventsEndpoint> = {
358
381
 
359
382
  type ResponseBody<
360
383
  TConfig extends Config,
361
- ListFields extends string[] | null = TConfig['endpoint'] extends Resource | 'search/v1'
384
+ ListFields extends string[] | null = TConfig['endpoint'] extends Resource | SearchV1OpQuery
362
385
  ? TConfig['params']['fields'] extends string ? '*'
363
386
  : TConfig['fields'] extends readonly string[] ? TConfig['fields']
364
387
  : null
@@ -380,10 +403,13 @@ type ResponseBody<
380
403
  TConfig['endpoint'] extends `orders/${ResourceId}` ? Orders :
381
404
  TConfig['endpoint'] extends `customers/${ResourceId}` ? Customers :
382
405
  TConfig['endpoint'] extends `stores/${ResourceId}` ? Stores :
406
+ TConfig['endpoint'] extends 'stores/me' ? Stores :
383
407
  TConfig['endpoint'] extends `applications/${ResourceId}` ? Applications :
384
408
  TConfig['endpoint'] extends `authentications/${ResourceId}` ? Authentications :
409
+ TConfig['endpoint'] extends 'authentications/me' ? Authentications :
385
410
  TConfig['endpoint'] extends ResourceOpQuery ? ResourceListResult<TConfig['endpoint'], ListFields> :
386
411
  TConfig['endpoint'] extends SearchOpQuery ? SearchResult<TConfig['endpoint'], ListFields> :
412
+ TConfig['endpoint'] extends SearchHistoryOpQuery ? SearchHistoryResult :
387
413
  TConfig['endpoint'] extends EventsEndpoint ? EventsResult<TConfig['endpoint']> :
388
414
  any;
389
415