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

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 ADDED
@@ -0,0 +1,98 @@
1
+ import { RpcMethod } from './commonTypes';
2
+ export type CatalogService_ListProducts = RpcMethod<ListProductsRequest, ListProductsResponse>;
3
+ export type CatalogService_GetProducts = RpcMethod<GetProductsRequest, GetProductsResponse>;
4
+ export type CatalogService_UpsertProducts = RpcMethod<UpsertProductsRequest, UpsertProductsResponse>;
5
+ export type CatalogService_DeleteProducts = RpcMethod<DeleteProductsRequest, DeleteProductsResponse>;
6
+ export type CatalogService_DeleteAllProducts = RpcMethod<DeleteAllProductsRequest, DeleteAllProductsResponse>;
7
+ export type CatalogService_ListCategories = RpcMethod<ListCategoriesRequest, ListCategoriesResponse>;
8
+ /**
9
+ * CatalogService manages the per-application product catalog used by email
10
+ * product blocks. Proxies to the catalog backend (recommender-api).
11
+ */
12
+ export interface CatalogService {
13
+ /** Lists products of an application (code XXXXX-XXXXX) catalog with a title search, category filter, sorting and pagination. Returns one page and the total match count. Use to browse or search the product catalog. */
14
+ ListProducts: CatalogService_ListProducts;
15
+ /** 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. */
16
+ GetProducts: CatalogService_GetProducts;
17
+ /** 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. */
18
+ UpsertProducts: CatalogService_UpsertProducts;
19
+ /** Deletes products from an application (code XXXXX-XXXXX) catalog by product IDs. Returns the number of deleted products. */
20
+ DeleteProducts: CatalogService_DeleteProducts;
21
+ /** Deletes ALL products of an application (code XXXXX-XXXXX) catalog. Irreversible; use only when the user explicitly asks to clear the whole catalog. */
22
+ DeleteAllProducts: CatalogService_DeleteAllProducts;
23
+ /** Returns the distinct product categories of an application (code XXXXX-XXXXX) catalog. Use to build category filters. */
24
+ ListCategories: CatalogService_ListCategories;
25
+ }
26
+ export type Product = {
27
+ /** Unique product id within the application catalog (SKU or external id). */
28
+ id: string;
29
+ title: string;
30
+ description: string;
31
+ imageUrl: string;
32
+ /** Product page URL. */
33
+ url: string;
34
+ price: number;
35
+ category: string;
36
+ sku: string;
37
+ currentStock: number;
38
+ /** ISO 4217 code, e.g. "USD". */
39
+ currency: string;
40
+ /** Discounted price; 0 means no sale. */
41
+ salePrice: number;
42
+ };
43
+ export type ListProductsRequest = {
44
+ /** Pushwoosh application code (XXXXX-XXXXX). */
45
+ applicationCode?: string;
46
+ /** Case-insensitive substring match on title. */
47
+ search?: string;
48
+ category?: string;
49
+ /** One of: title, price, category, sku, stock; default title. */
50
+ sortBy?: string;
51
+ sortDesc?: boolean;
52
+ /** 0-based page number. */
53
+ page?: number;
54
+ /** Defaults to 50, capped at 500. */
55
+ pageSize?: number;
56
+ };
57
+ export type ListProductsResponse = {
58
+ products: Product[];
59
+ /** Total matching products regardless of pagination. */
60
+ total: number;
61
+ };
62
+ export type GetProductsRequest = {
63
+ /** Pushwoosh application code (XXXXX-XXXXX). */
64
+ applicationCode?: string;
65
+ productIds?: string[];
66
+ };
67
+ export type GetProductsResponse = {
68
+ products: Product[];
69
+ };
70
+ export type UpsertProductsRequest = {
71
+ /** Pushwoosh application code (XXXXX-XXXXX). */
72
+ applicationCode?: string;
73
+ products?: Product[];
74
+ };
75
+ export type UpsertProductsResponse = {
76
+ inserted: number;
77
+ updated: number;
78
+ };
79
+ export type DeleteProductsRequest = {
80
+ /** Pushwoosh application code (XXXXX-XXXXX). */
81
+ applicationCode?: string;
82
+ productIds?: string[];
83
+ };
84
+ export type DeleteProductsResponse = {
85
+ deleted: number;
86
+ };
87
+ export type DeleteAllProductsRequest = {
88
+ /** Pushwoosh application code (XXXXX-XXXXX). */
89
+ applicationCode?: string;
90
+ };
91
+ export type DeleteAllProductsResponse = {};
92
+ export type ListCategoriesRequest = {
93
+ /** Pushwoosh application code (XXXXX-XXXXX). */
94
+ applicationCode?: string;
95
+ };
96
+ export type ListCategoriesResponse = {
97
+ categories: string[];
98
+ };
package/catalog.js ADDED
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};
package/data.js CHANGED
@@ -4860,6 +4860,217 @@ export const data = {
4860
4860
  "type": "I",
4861
4861
  "fields": {}
4862
4862
  },
4863
+ "pushwoosh.rpc_v2.catalog.CatalogService": {
4864
+ "type": "S",
4865
+ "key": "catalog",
4866
+ "methods": {
4867
+ "ListProducts": {
4868
+ "request": "pushwoosh.rpc_v2.catalog.ListProductsRequest",
4869
+ "response": "pushwoosh.rpc_v2.catalog.ListProductsResponse",
4870
+ "method": "get",
4871
+ "path": "/api/catalog/products"
4872
+ },
4873
+ "GetProducts": {
4874
+ "request": "pushwoosh.rpc_v2.catalog.GetProductsRequest",
4875
+ "response": "pushwoosh.rpc_v2.catalog.GetProductsResponse",
4876
+ "method": "post",
4877
+ "path": "/api/catalog/products:get"
4878
+ },
4879
+ "UpsertProducts": {
4880
+ "request": "pushwoosh.rpc_v2.catalog.UpsertProductsRequest",
4881
+ "response": "pushwoosh.rpc_v2.catalog.UpsertProductsResponse",
4882
+ "method": "post",
4883
+ "path": "/api/catalog/products"
4884
+ },
4885
+ "DeleteProducts": {
4886
+ "request": "pushwoosh.rpc_v2.catalog.DeleteProductsRequest",
4887
+ "response": "pushwoosh.rpc_v2.catalog.DeleteProductsResponse",
4888
+ "method": "post",
4889
+ "path": "/api/catalog/products:delete"
4890
+ },
4891
+ "DeleteAllProducts": {
4892
+ "request": "pushwoosh.rpc_v2.catalog.DeleteAllProductsRequest",
4893
+ "response": "pushwoosh.rpc_v2.catalog.DeleteAllProductsResponse",
4894
+ "method": "post",
4895
+ "path": "/api/catalog/products:delete-all"
4896
+ },
4897
+ "ListCategories": {
4898
+ "request": "pushwoosh.rpc_v2.catalog.ListCategoriesRequest",
4899
+ "response": "pushwoosh.rpc_v2.catalog.ListCategoriesResponse",
4900
+ "method": "get",
4901
+ "path": "/api/catalog/categories"
4902
+ }
4903
+ }
4904
+ },
4905
+ "pushwoosh.rpc_v2.catalog.Product": {
4906
+ "type": "I",
4907
+ "fields": {
4908
+ "id": {
4909
+ "type": "string"
4910
+ },
4911
+ "title": {
4912
+ "type": "string"
4913
+ },
4914
+ "description": {
4915
+ "type": "string"
4916
+ },
4917
+ "imageUrl": {
4918
+ "type": "string"
4919
+ },
4920
+ "url": {
4921
+ "type": "string"
4922
+ },
4923
+ "price": {
4924
+ "type": "number"
4925
+ },
4926
+ "category": {
4927
+ "type": "string"
4928
+ },
4929
+ "sku": {
4930
+ "type": "string"
4931
+ },
4932
+ "currentStock": {
4933
+ "type": "number"
4934
+ },
4935
+ "currency": {
4936
+ "type": "string"
4937
+ },
4938
+ "salePrice": {
4939
+ "type": "number"
4940
+ }
4941
+ }
4942
+ },
4943
+ "pushwoosh.rpc_v2.catalog.ListProductsRequest": {
4944
+ "type": "I",
4945
+ "fields": {
4946
+ "applicationCode": {
4947
+ "type": "string"
4948
+ },
4949
+ "search": {
4950
+ "type": "string"
4951
+ },
4952
+ "category": {
4953
+ "type": "string"
4954
+ },
4955
+ "sortBy": {
4956
+ "type": "string"
4957
+ },
4958
+ "sortDesc": {
4959
+ "type": "boolean"
4960
+ },
4961
+ "page": {
4962
+ "type": "number"
4963
+ },
4964
+ "pageSize": {
4965
+ "type": "number"
4966
+ }
4967
+ }
4968
+ },
4969
+ "pushwoosh.rpc_v2.catalog.ListProductsResponse": {
4970
+ "type": "I",
4971
+ "fields": {
4972
+ "products": {
4973
+ "type": "pushwoosh.rpc_v2.catalog.Product",
4974
+ "array": true
4975
+ },
4976
+ "total": {
4977
+ "type": "number"
4978
+ }
4979
+ }
4980
+ },
4981
+ "pushwoosh.rpc_v2.catalog.GetProductsRequest": {
4982
+ "type": "I",
4983
+ "fields": {
4984
+ "applicationCode": {
4985
+ "type": "string"
4986
+ },
4987
+ "productIds": {
4988
+ "type": "string",
4989
+ "array": true
4990
+ }
4991
+ }
4992
+ },
4993
+ "pushwoosh.rpc_v2.catalog.GetProductsResponse": {
4994
+ "type": "I",
4995
+ "fields": {
4996
+ "products": {
4997
+ "type": "pushwoosh.rpc_v2.catalog.Product",
4998
+ "array": true
4999
+ }
5000
+ }
5001
+ },
5002
+ "pushwoosh.rpc_v2.catalog.UpsertProductsRequest": {
5003
+ "type": "I",
5004
+ "fields": {
5005
+ "applicationCode": {
5006
+ "type": "string"
5007
+ },
5008
+ "products": {
5009
+ "type": "pushwoosh.rpc_v2.catalog.Product",
5010
+ "array": true
5011
+ }
5012
+ }
5013
+ },
5014
+ "pushwoosh.rpc_v2.catalog.UpsertProductsResponse": {
5015
+ "type": "I",
5016
+ "fields": {
5017
+ "inserted": {
5018
+ "type": "number"
5019
+ },
5020
+ "updated": {
5021
+ "type": "number"
5022
+ }
5023
+ }
5024
+ },
5025
+ "pushwoosh.rpc_v2.catalog.DeleteProductsRequest": {
5026
+ "type": "I",
5027
+ "fields": {
5028
+ "applicationCode": {
5029
+ "type": "string"
5030
+ },
5031
+ "productIds": {
5032
+ "type": "string",
5033
+ "array": true
5034
+ }
5035
+ }
5036
+ },
5037
+ "pushwoosh.rpc_v2.catalog.DeleteProductsResponse": {
5038
+ "type": "I",
5039
+ "fields": {
5040
+ "deleted": {
5041
+ "type": "number"
5042
+ }
5043
+ }
5044
+ },
5045
+ "pushwoosh.rpc_v2.catalog.DeleteAllProductsRequest": {
5046
+ "type": "I",
5047
+ "fields": {
5048
+ "applicationCode": {
5049
+ "type": "string"
5050
+ }
5051
+ }
5052
+ },
5053
+ "pushwoosh.rpc_v2.catalog.DeleteAllProductsResponse": {
5054
+ "type": "I",
5055
+ "fields": {}
5056
+ },
5057
+ "pushwoosh.rpc_v2.catalog.ListCategoriesRequest": {
5058
+ "type": "I",
5059
+ "fields": {
5060
+ "applicationCode": {
5061
+ "type": "string"
5062
+ }
5063
+ }
5064
+ },
5065
+ "pushwoosh.rpc_v2.catalog.ListCategoriesResponse": {
5066
+ "type": "I",
5067
+ "fields": {
5068
+ "categories": {
5069
+ "type": "string",
5070
+ "array": true
5071
+ }
5072
+ }
5073
+ },
4863
5074
  "pushwoosh.rpc_v2.categories.CategoriesService": {
4864
5075
  "type": "S",
4865
5076
  "key": "categories",
package/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import { ApplicationsGroupsService as pushwoosh_rpc_v2_applications_groups_Appli
15
15
  import { ApplicationsInfoService as pushwoosh_rpc_v2_applications_info_ApplicationsInfoService } from './applications_info';
16
16
  import { ApplicationsStatisticsService as pushwoosh_rpc_v2_applications_statistics_ApplicationsStatisticsService } from './applications_statistics';
17
17
  import { CampaignsService as pushwoosh_rpc_v2_campaigns_CampaignsService } from './campaigns';
18
+ import { CatalogService as pushwoosh_rpc_v2_catalog_CatalogService } from './catalog';
18
19
  import { CategoriesService as pushwoosh_rpc_v2_categories_CategoriesService } from './categories';
19
20
  import { MessagingService as pushwoosh_channels_messagingApi_v2_MessagingService } from './pushwoosh_channels_messagingApi_v2';
20
21
  import { CloudPagesService as pushwoosh_rpc_v2_cloud_pages_CloudPagesService } from './cloud_pages';
@@ -81,6 +82,7 @@ export type API = {
81
82
  applicationsInfo: pushwoosh_rpc_v2_applications_info_ApplicationsInfoService;
82
83
  applicationsStatistics: pushwoosh_rpc_v2_applications_statistics_ApplicationsStatisticsService;
83
84
  campaigns: pushwoosh_rpc_v2_campaigns_CampaignsService;
85
+ catalog: pushwoosh_rpc_v2_catalog_CatalogService;
84
86
  categories: pushwoosh_rpc_v2_categories_CategoriesService;
85
87
  messaging: pushwoosh_channels_messagingApi_v2_MessagingService;
86
88
  cloudPages: pushwoosh_rpc_v2_cloud_pages_CloudPagesService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.77",
3
+ "version": "0.2.79",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",