@pushwoosh/rpc-v2-http-api-data 0.2.79 → 0.2.81

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 (3) hide show
  1. package/catalog.d.ts +56 -0
  2. package/data.js +115 -0
  3. package/package.json +1 -1
package/catalog.d.ts CHANGED
@@ -5,6 +5,10 @@ export type CatalogService_UpsertProducts = RpcMethod<UpsertProductsRequest, Ups
5
5
  export type CatalogService_DeleteProducts = RpcMethod<DeleteProductsRequest, DeleteProductsResponse>;
6
6
  export type CatalogService_DeleteAllProducts = RpcMethod<DeleteAllProductsRequest, DeleteAllProductsResponse>;
7
7
  export type CatalogService_ListCategories = RpcMethod<ListCategoriesRequest, ListCategoriesResponse>;
8
+ export type CatalogService_GetFeed = RpcMethod<GetFeedRequest, GetFeedResponse>;
9
+ export type CatalogService_SetFeed = RpcMethod<SetFeedRequest, SetFeedResponse>;
10
+ export type CatalogService_DeleteFeed = RpcMethod<DeleteFeedRequest, DeleteFeedResponse>;
11
+ export type CatalogService_SyncFeed = RpcMethod<SyncFeedRequest, SyncFeedResponse>;
8
12
  /**
9
13
  * CatalogService manages the per-application product catalog used by email
10
14
  * product blocks. Proxies to the catalog backend (recommender-api).
@@ -22,6 +26,14 @@ export interface CatalogService {
22
26
  DeleteAllProducts: CatalogService_DeleteAllProducts;
23
27
  /** Returns the distinct product categories of an application (code XXXXX-XXXXX) catalog. Use to build category filters. */
24
28
  ListCategories: CatalogService_ListCategories;
29
+ /** Returns the merchant-feed URL of an application (code XXXXX-XXXXX) catalog and the last sync state. Empty url means no feed is connected. */
30
+ GetFeed: CatalogService_GetFeed;
31
+ /** Connects a merchant feed (JSON or Google Merchant XML, http(s) URL) to an application (code XXXXX-XXXXX) catalog; one feed per application. The feed is imported hourly; use sync_catalog_feed to import right away. */
32
+ SetFeed: CatalogService_SetFeed;
33
+ /** Disconnects the merchant feed from an application (code XXXXX-XXXXX) catalog. Already-imported products stay in the catalog. */
34
+ DeleteFeed: CatalogService_DeleteFeed;
35
+ /** Starts a merchant-feed sync of an application (code XXXXX-XXXXX) catalog in the background. Returns started=false when a sync is already running. Poll get_catalog_feed for the outcome. */
36
+ SyncFeed: CatalogService_SyncFeed;
25
37
  }
26
38
  export type Product = {
27
39
  /** Unique product id within the application catalog (SKU or external id). */
@@ -96,3 +108,47 @@ export type ListCategoriesRequest = {
96
108
  export type ListCategoriesResponse = {
97
109
  categories: string[];
98
110
  };
111
+ /** Last merchant-feed sync outcome; empty status means the feed never synced. */
112
+ export type FeedState = {
113
+ /** One of: syncing, ok, error. */
114
+ status: string;
115
+ startedAt: Date;
116
+ finishedAt: Date;
117
+ itemsUpserted: number;
118
+ /** Products that disappeared from the feed and were removed. */
119
+ itemsDeleted: number;
120
+ /** Feed entries without the required id+title. */
121
+ itemsSkipped: number;
122
+ /** The feed answered 304 Not Modified — catalog left as is. */
123
+ notModified: boolean;
124
+ error: string;
125
+ };
126
+ export type GetFeedRequest = {
127
+ /** Pushwoosh application code (XXXXX-XXXXX). */
128
+ applicationCode?: string;
129
+ };
130
+ export type GetFeedResponse = {
131
+ /** Empty when no feed is connected. */
132
+ url: string;
133
+ state: FeedState;
134
+ };
135
+ export type SetFeedRequest = {
136
+ /** Pushwoosh application code (XXXXX-XXXXX). */
137
+ applicationCode?: string;
138
+ /** http(s) URL of a JSON or Google Merchant XML feed. */
139
+ url?: string;
140
+ };
141
+ export type SetFeedResponse = {};
142
+ export type DeleteFeedRequest = {
143
+ /** Pushwoosh application code (XXXXX-XXXXX). */
144
+ applicationCode?: string;
145
+ };
146
+ export type DeleteFeedResponse = {};
147
+ export type SyncFeedRequest = {
148
+ /** Pushwoosh application code (XXXXX-XXXXX). */
149
+ applicationCode?: string;
150
+ };
151
+ export type SyncFeedResponse = {
152
+ /** False when a sync was already running (the running one continues). */
153
+ started: boolean;
154
+ };
package/data.js CHANGED
@@ -4899,6 +4899,30 @@ export const data = {
4899
4899
  "response": "pushwoosh.rpc_v2.catalog.ListCategoriesResponse",
4900
4900
  "method": "get",
4901
4901
  "path": "/api/catalog/categories"
4902
+ },
4903
+ "GetFeed": {
4904
+ "request": "pushwoosh.rpc_v2.catalog.GetFeedRequest",
4905
+ "response": "pushwoosh.rpc_v2.catalog.GetFeedResponse",
4906
+ "method": "get",
4907
+ "path": "/api/catalog/feed"
4908
+ },
4909
+ "SetFeed": {
4910
+ "request": "pushwoosh.rpc_v2.catalog.SetFeedRequest",
4911
+ "response": "pushwoosh.rpc_v2.catalog.SetFeedResponse",
4912
+ "method": "post",
4913
+ "path": "/api/catalog/feed"
4914
+ },
4915
+ "DeleteFeed": {
4916
+ "request": "pushwoosh.rpc_v2.catalog.DeleteFeedRequest",
4917
+ "response": "pushwoosh.rpc_v2.catalog.DeleteFeedResponse",
4918
+ "method": "post",
4919
+ "path": "/api/catalog/feed:delete"
4920
+ },
4921
+ "SyncFeed": {
4922
+ "request": "pushwoosh.rpc_v2.catalog.SyncFeedRequest",
4923
+ "response": "pushwoosh.rpc_v2.catalog.SyncFeedResponse",
4924
+ "method": "post",
4925
+ "path": "/api/catalog/feed:sync"
4902
4926
  }
4903
4927
  }
4904
4928
  },
@@ -5071,6 +5095,97 @@ export const data = {
5071
5095
  }
5072
5096
  }
5073
5097
  },
5098
+ "pushwoosh.rpc_v2.catalog.FeedState": {
5099
+ "type": "I",
5100
+ "fields": {
5101
+ "status": {
5102
+ "type": "string"
5103
+ },
5104
+ "startedAt": {
5105
+ "type": "Date"
5106
+ },
5107
+ "finishedAt": {
5108
+ "type": "Date"
5109
+ },
5110
+ "itemsUpserted": {
5111
+ "type": "number"
5112
+ },
5113
+ "itemsDeleted": {
5114
+ "type": "number"
5115
+ },
5116
+ "itemsSkipped": {
5117
+ "type": "number"
5118
+ },
5119
+ "notModified": {
5120
+ "type": "boolean"
5121
+ },
5122
+ "error": {
5123
+ "type": "string"
5124
+ }
5125
+ }
5126
+ },
5127
+ "pushwoosh.rpc_v2.catalog.GetFeedRequest": {
5128
+ "type": "I",
5129
+ "fields": {
5130
+ "applicationCode": {
5131
+ "type": "string"
5132
+ }
5133
+ }
5134
+ },
5135
+ "pushwoosh.rpc_v2.catalog.GetFeedResponse": {
5136
+ "type": "I",
5137
+ "fields": {
5138
+ "url": {
5139
+ "type": "string"
5140
+ },
5141
+ "state": {
5142
+ "type": "pushwoosh.rpc_v2.catalog.FeedState"
5143
+ }
5144
+ }
5145
+ },
5146
+ "pushwoosh.rpc_v2.catalog.SetFeedRequest": {
5147
+ "type": "I",
5148
+ "fields": {
5149
+ "applicationCode": {
5150
+ "type": "string"
5151
+ },
5152
+ "url": {
5153
+ "type": "string"
5154
+ }
5155
+ }
5156
+ },
5157
+ "pushwoosh.rpc_v2.catalog.SetFeedResponse": {
5158
+ "type": "I",
5159
+ "fields": {}
5160
+ },
5161
+ "pushwoosh.rpc_v2.catalog.DeleteFeedRequest": {
5162
+ "type": "I",
5163
+ "fields": {
5164
+ "applicationCode": {
5165
+ "type": "string"
5166
+ }
5167
+ }
5168
+ },
5169
+ "pushwoosh.rpc_v2.catalog.DeleteFeedResponse": {
5170
+ "type": "I",
5171
+ "fields": {}
5172
+ },
5173
+ "pushwoosh.rpc_v2.catalog.SyncFeedRequest": {
5174
+ "type": "I",
5175
+ "fields": {
5176
+ "applicationCode": {
5177
+ "type": "string"
5178
+ }
5179
+ }
5180
+ },
5181
+ "pushwoosh.rpc_v2.catalog.SyncFeedResponse": {
5182
+ "type": "I",
5183
+ "fields": {
5184
+ "started": {
5185
+ "type": "boolean"
5186
+ }
5187
+ }
5188
+ },
5074
5189
  "pushwoosh.rpc_v2.categories.CategoriesService": {
5075
5190
  "type": "S",
5076
5191
  "key": "categories",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.79",
3
+ "version": "0.2.81",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",