@pushwoosh/rpc-v2-http-api-data 0.2.137 → 0.2.139
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/catalog.d.ts +35 -0
- package/data.js +67 -0
- package/package.json +1 -1
package/catalog.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RpcMethod } from './commonTypes';
|
|
2
2
|
export type CatalogService_ListProducts = RpcMethod<ListProductsRequest, ListProductsResponse>;
|
|
3
3
|
export type CatalogService_GetProducts = RpcMethod<GetProductsRequest, GetProductsResponse>;
|
|
4
|
+
export type CatalogService_PreviewFeed = RpcMethod<PreviewFeedRequest, PreviewFeedResponse>;
|
|
4
5
|
export type CatalogService_UpsertProducts = RpcMethod<UpsertProductsRequest, UpsertProductsResponse>;
|
|
5
6
|
export type CatalogService_DeleteProducts = RpcMethod<DeleteProductsRequest, DeleteProductsResponse>;
|
|
6
7
|
export type CatalogService_DeleteAllProducts = RpcMethod<DeleteAllProductsRequest, DeleteAllProductsResponse>;
|
|
@@ -18,6 +19,8 @@ export interface CatalogService {
|
|
|
18
19
|
ListProducts: CatalogService_ListProducts;
|
|
19
20
|
/** Returns catalog products of an application (code XXXXX-XXXXX) by product IDs. Use to re-read specific products, e.g. to refresh product blocks in an email template. */
|
|
20
21
|
GetProducts: CatalogService_GetProducts;
|
|
22
|
+
/** Returns the product rows a catalog rule would put into a message, ranked the way the send-time products feed ranks them. Use to preview a recommendation rule before saving a preset: the plain catalog list is ordered by the catalog, not by the strategy. Per-recipient strategies (also_bought, recently_viewed) are not previewable and answer FAILED_PRECONDITION. */
|
|
23
|
+
PreviewFeed: CatalogService_PreviewFeed;
|
|
21
24
|
/** Inserts or updates products of an application (code XXXXX-XXXXX) catalog, matched by product id; at most 1000 per request. Returns inserted and updated counts. Use to add products manually or import them from a CSV file. */
|
|
22
25
|
UpsertProducts: CatalogService_UpsertProducts;
|
|
23
26
|
/** Deletes products from an application (code XXXXX-XXXXX) catalog by product IDs. Returns the number of deleted products. */
|
|
@@ -71,6 +74,38 @@ export type ListProductsResponse = {
|
|
|
71
74
|
/** Total matching products regardless of pagination. */
|
|
72
75
|
total: number;
|
|
73
76
|
};
|
|
77
|
+
export type PreviewFeedRequest = {
|
|
78
|
+
/** Pushwoosh application code (XXXXX-XXXXX). */
|
|
79
|
+
applicationCode?: string;
|
|
80
|
+
category?: string;
|
|
81
|
+
/** One of: newest, price_asc, price_desc, title; default newest. */
|
|
82
|
+
sort?: string;
|
|
83
|
+
/** Rows to return, 1..50; defaults to 10. */
|
|
84
|
+
limit?: number;
|
|
85
|
+
/**
|
|
86
|
+
* One of: newest, bestsellers_7d, bestsellers_30d, back_in_stock, price_drop, or empty for
|
|
87
|
+
* the plain rule; per-recipient ones (also_bought, recently_viewed) are rejected for now.
|
|
88
|
+
*/
|
|
89
|
+
strategy?: string;
|
|
90
|
+
};
|
|
91
|
+
export type PreviewFeedItem = {
|
|
92
|
+
id: string;
|
|
93
|
+
title: string;
|
|
94
|
+
description: string;
|
|
95
|
+
imageUrl: string;
|
|
96
|
+
/** Product page URL, without the click-attribution parameters the send adds. */
|
|
97
|
+
url: string;
|
|
98
|
+
/** Display string, formatted the way the feed formats it, e.g. "$12.99". */
|
|
99
|
+
priceFormatted: string;
|
|
100
|
+
/** Empty unless the product is on sale. */
|
|
101
|
+
oldPriceFormatted: string;
|
|
102
|
+
category: string;
|
|
103
|
+
};
|
|
104
|
+
export type PreviewFeedResponse = {
|
|
105
|
+
items: PreviewFeedItem[];
|
|
106
|
+
/** The strategy yielded nothing and the plain catalog rule answered instead. */
|
|
107
|
+
fellBack: boolean;
|
|
108
|
+
};
|
|
74
109
|
export type GetProductsRequest = {
|
|
75
110
|
/** Pushwoosh application code (XXXXX-XXXXX). */
|
|
76
111
|
applicationCode?: string;
|
package/data.js
CHANGED
|
@@ -6703,6 +6703,12 @@ export const data = {
|
|
|
6703
6703
|
"method": "post",
|
|
6704
6704
|
"path": "/api/catalog/products:get"
|
|
6705
6705
|
},
|
|
6706
|
+
"PreviewFeed": {
|
|
6707
|
+
"request": "pushwoosh.rpc_v2.catalog.PreviewFeedRequest",
|
|
6708
|
+
"response": "pushwoosh.rpc_v2.catalog.PreviewFeedResponse",
|
|
6709
|
+
"method": "post",
|
|
6710
|
+
"path": "/api/catalog/products:preview"
|
|
6711
|
+
},
|
|
6706
6712
|
"UpsertProducts": {
|
|
6707
6713
|
"request": "pushwoosh.rpc_v2.catalog.UpsertProductsRequest",
|
|
6708
6714
|
"response": "pushwoosh.rpc_v2.catalog.UpsertProductsResponse",
|
|
@@ -6829,6 +6835,67 @@ export const data = {
|
|
|
6829
6835
|
}
|
|
6830
6836
|
}
|
|
6831
6837
|
},
|
|
6838
|
+
"pushwoosh.rpc_v2.catalog.PreviewFeedRequest": {
|
|
6839
|
+
"type": "I",
|
|
6840
|
+
"fields": {
|
|
6841
|
+
"applicationCode": {
|
|
6842
|
+
"type": "string"
|
|
6843
|
+
},
|
|
6844
|
+
"category": {
|
|
6845
|
+
"type": "string"
|
|
6846
|
+
},
|
|
6847
|
+
"sort": {
|
|
6848
|
+
"type": "string"
|
|
6849
|
+
},
|
|
6850
|
+
"limit": {
|
|
6851
|
+
"type": "number"
|
|
6852
|
+
},
|
|
6853
|
+
"strategy": {
|
|
6854
|
+
"type": "string"
|
|
6855
|
+
}
|
|
6856
|
+
}
|
|
6857
|
+
},
|
|
6858
|
+
"pushwoosh.rpc_v2.catalog.PreviewFeedItem": {
|
|
6859
|
+
"type": "I",
|
|
6860
|
+
"fields": {
|
|
6861
|
+
"id": {
|
|
6862
|
+
"type": "string"
|
|
6863
|
+
},
|
|
6864
|
+
"title": {
|
|
6865
|
+
"type": "string"
|
|
6866
|
+
},
|
|
6867
|
+
"description": {
|
|
6868
|
+
"type": "string"
|
|
6869
|
+
},
|
|
6870
|
+
"imageUrl": {
|
|
6871
|
+
"type": "string"
|
|
6872
|
+
},
|
|
6873
|
+
"url": {
|
|
6874
|
+
"type": "string"
|
|
6875
|
+
},
|
|
6876
|
+
"priceFormatted": {
|
|
6877
|
+
"type": "string"
|
|
6878
|
+
},
|
|
6879
|
+
"oldPriceFormatted": {
|
|
6880
|
+
"type": "string"
|
|
6881
|
+
},
|
|
6882
|
+
"category": {
|
|
6883
|
+
"type": "string"
|
|
6884
|
+
}
|
|
6885
|
+
}
|
|
6886
|
+
},
|
|
6887
|
+
"pushwoosh.rpc_v2.catalog.PreviewFeedResponse": {
|
|
6888
|
+
"type": "I",
|
|
6889
|
+
"fields": {
|
|
6890
|
+
"items": {
|
|
6891
|
+
"type": "pushwoosh.rpc_v2.catalog.PreviewFeedItem",
|
|
6892
|
+
"array": true
|
|
6893
|
+
},
|
|
6894
|
+
"fellBack": {
|
|
6895
|
+
"type": "boolean"
|
|
6896
|
+
}
|
|
6897
|
+
}
|
|
6898
|
+
},
|
|
6832
6899
|
"pushwoosh.rpc_v2.catalog.GetProductsRequest": {
|
|
6833
6900
|
"type": "I",
|
|
6834
6901
|
"fields": {
|