@gofynd/fdk-client-javascript 1.1.0 → 1.1.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.
- package/README.md +0 -1
- package/package.json +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +11 -2
- package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
- package/sdk/application/Content/ContentApplicationModel.js +0 -4
- package/sdk/application/Lead/LeadApplicationModel.js +1 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +0 -15
- package/sdk/application/Order/OrderApplicationClient.js +0 -68
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -17
- package/sdk/application/Order/OrderApplicationModel.js +0 -111
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -1
- package/sdk/application/Order/OrderApplicationValidator.js +0 -7
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/common/Constant.d.ts +0 -18
- package/sdk/common/Constant.js +0 -22
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +29 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +181 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +4 -0
- package/sdk/platform/Cart/CartPlatformModel.js +37 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +5 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +1 -1
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.js +3 -7
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +0 -183
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +0 -417
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +0 -10
- package/sdk/platform/Communication/CommunicationPlatformClient.js +0 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +4 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -22
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +0 -56
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +12 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +62 -2
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Content/ContentPlatformModel.js +0 -4
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
- package/sdk/platform/Discount/DiscountPlatformClient.js +1 -1
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +1 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +15 -0
- package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +1 -1
- package/sdk/platform/Lead/LeadPlatformModel.js +1 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -47
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +5 -201
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -3
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -26
- package/sdk/platform/Order/OrderPlatformClient.d.ts +51 -183
- package/sdk/platform/Order/OrderPlatformClient.js +243 -931
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4 -20
- package/sdk/platform/Order/OrderPlatformModel.js +38 -182
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +3 -12
- package/sdk/platform/Order/OrderPlatformValidator.js +19 -95
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +24 -10
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +111 -44
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +2 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +13 -5
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +12 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +12 -41
- package/sdk/platform/PlatformApplicationClient.js +13 -45
- package/sdk/platform/PlatformClient.d.ts +90 -264
- package/sdk/platform/PlatformClient.js +110 -316
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +11 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.js +61 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
- package/sdk/platform/Share/SharePlatformModel.js +11 -0
- package/sdk/platform/index.d.ts +0 -1
- package/sdk/platform/index.js +0 -2
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +0 -109
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +0 -558
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +0 -11
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +0 -56
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +0 -88
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +0 -361
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +0 -23
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +0 -169
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.d.ts +0 -7
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +0 -38
|
@@ -130,6 +130,67 @@ class Share {
|
|
|
130
130
|
return response;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* @param {Object} arg - Arg object.
|
|
135
|
+
* @param {string} arg.surlId - Short link ID for which click statistics are
|
|
136
|
+
* to be retrieved.
|
|
137
|
+
* @returns {Promise<ClickStatsResponse>} - Success response
|
|
138
|
+
* @summary: Get click statistics for a short link
|
|
139
|
+
* @description: Retrieve click statistics for a given short link ID.
|
|
140
|
+
*/
|
|
141
|
+
async getShortLinkClickStats({ surlId } = {}) {
|
|
142
|
+
const { error } = ShareValidator.getShortLinkClickStats().validate(
|
|
143
|
+
{ surlId },
|
|
144
|
+
{ abortEarly: false, allowUnknown: true }
|
|
145
|
+
);
|
|
146
|
+
if (error) {
|
|
147
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Showing warrnings if extra unknown parameters are found
|
|
151
|
+
const {
|
|
152
|
+
error: warrning,
|
|
153
|
+
} = ShareValidator.getShortLinkClickStats().validate(
|
|
154
|
+
{ surlId },
|
|
155
|
+
{ abortEarly: false, allowUnknown: false }
|
|
156
|
+
);
|
|
157
|
+
if (warrning) {
|
|
158
|
+
Logger({
|
|
159
|
+
level: "WARN",
|
|
160
|
+
message: "Parameter Validation warrnings for getShortLinkClickStats",
|
|
161
|
+
});
|
|
162
|
+
Logger({ level: "WARN", message: warrning });
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const query_params = {};
|
|
166
|
+
query_params["surl_id"] = surlId;
|
|
167
|
+
|
|
168
|
+
const response = await PlatformAPIClient.execute(
|
|
169
|
+
this.config,
|
|
170
|
+
"get",
|
|
171
|
+
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/click-stats`,
|
|
172
|
+
query_params,
|
|
173
|
+
undefined
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const {
|
|
177
|
+
error: res_error,
|
|
178
|
+
} = ShareModel.ClickStatsResponse().validate(response, {
|
|
179
|
+
abortEarly: false,
|
|
180
|
+
allowUnknown: false,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
if (res_error) {
|
|
184
|
+
Logger({
|
|
185
|
+
level: "WARN",
|
|
186
|
+
message: "Response Validation Warnnings for getShortLinkClickStats",
|
|
187
|
+
});
|
|
188
|
+
Logger({ level: "WARN", message: res_error });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return response;
|
|
192
|
+
}
|
|
193
|
+
|
|
133
194
|
/**
|
|
134
195
|
* @param {Object} arg - Arg object.
|
|
135
196
|
* @param {number} [arg.pageNo] - Current page number
|
|
@@ -14,6 +14,12 @@ class ShareValidator {
|
|
|
14
14
|
}).required();
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
static getShortLinkClickStats() {
|
|
18
|
+
return Joi.object({
|
|
19
|
+
surlId: Joi.string().allow("").required(),
|
|
20
|
+
}).required();
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
static getShortLinks() {
|
|
18
24
|
return Joi.object({
|
|
19
25
|
pageNo: Joi.number(),
|
|
@@ -12,6 +12,17 @@ class ShareModel {
|
|
|
12
12
|
source: Joi.string().allow(""),
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
static ClickStatsItem() {
|
|
16
|
+
return Joi.object({
|
|
17
|
+
display: Joi.string().allow(""),
|
|
18
|
+
total: Joi.number(),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
static ClickStatsResponse() {
|
|
22
|
+
return Joi.object({
|
|
23
|
+
click_stats: Joi.array().items(ShareModel.ClickStatsItem()).required(),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
15
26
|
static ErrorRes() {
|
|
16
27
|
return Joi.object({
|
|
17
28
|
message: Joi.string().allow(""),
|
package/sdk/platform/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export namespace PlatformModel {
|
|
|
18
18
|
const ConfigurationPlatformModel: typeof import("./Configuration/ConfigurationPlatformModel");
|
|
19
19
|
const CartPlatformModel: typeof import("./Cart/CartPlatformModel");
|
|
20
20
|
const RewardsPlatformModel: typeof import("./Rewards/RewardsPlatformModel");
|
|
21
|
-
const AnalyticsPlatformModel: typeof import("./Analytics/AnalyticsPlatformModel");
|
|
22
21
|
const DiscountPlatformModel: typeof import("./Discount/DiscountPlatformModel");
|
|
23
22
|
const PartnerPlatformModel: typeof import("./Partner/PartnerPlatformModel");
|
|
24
23
|
const WebhookPlatformModel: typeof import("./Webhook/WebhookPlatformModel");
|
package/sdk/platform/index.js
CHANGED
|
@@ -36,8 +36,6 @@ module.exports = {
|
|
|
36
36
|
|
|
37
37
|
RewardsPlatformModel: require("./Rewards/RewardsPlatformModel"),
|
|
38
38
|
|
|
39
|
-
AnalyticsPlatformModel: require("./Analytics/AnalyticsPlatformModel"),
|
|
40
|
-
|
|
41
39
|
DiscountPlatformModel: require("./Discount/DiscountPlatformModel"),
|
|
42
40
|
|
|
43
41
|
PartnerPlatformModel: require("./Partner/PartnerPlatformModel"),
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export = Analytics;
|
|
2
|
-
declare class Analytics {
|
|
3
|
-
constructor(config: any, applicationId: any);
|
|
4
|
-
config: any;
|
|
5
|
-
applicationId: any;
|
|
6
|
-
/**
|
|
7
|
-
* @param {Object} arg - Arg object.
|
|
8
|
-
* @param {string} arg.cartId - Cart Id
|
|
9
|
-
* @returns {Promise<AbandonCartDetail>} - Success response
|
|
10
|
-
* @summary: Get abandon carts details
|
|
11
|
-
* @description: Get abandon cart details
|
|
12
|
-
*/
|
|
13
|
-
getAbandonCartDetail({ cartId }?: {
|
|
14
|
-
cartId: string;
|
|
15
|
-
}): Promise<AbandonCartDetail>;
|
|
16
|
-
/**
|
|
17
|
-
* @param {Object} arg - Arg object.
|
|
18
|
-
* @param {string} arg.fromDate - From date
|
|
19
|
-
* @param {string} arg.toDate - To date
|
|
20
|
-
* @param {number} [arg.pageNo] - Current page number
|
|
21
|
-
* @param {number} [arg.pageSize] - Current page size
|
|
22
|
-
* @returns {Promise<AbandonCartsList>} - Success response
|
|
23
|
-
* @summary: Get abandon carts list
|
|
24
|
-
* @description: Get abandon carts list
|
|
25
|
-
*/
|
|
26
|
-
getAbandonCartList({ fromDate, toDate, pageNo, pageSize }?: {
|
|
27
|
-
fromDate: string;
|
|
28
|
-
toDate: string;
|
|
29
|
-
pageNo?: number;
|
|
30
|
-
pageSize?: number;
|
|
31
|
-
}): Promise<AbandonCartsList>;
|
|
32
|
-
/**
|
|
33
|
-
* @param {Object} arg - Arg object.
|
|
34
|
-
* @param {string} arg.companyId - Company Id
|
|
35
|
-
* @param {string} arg.applicationId - Application Id
|
|
36
|
-
* @param {string} arg.fromDate - From date
|
|
37
|
-
* @param {string} arg.toDate - To date
|
|
38
|
-
* @param {number} [arg.pageSize] - Current page size
|
|
39
|
-
* @summary: Get abandon carts list
|
|
40
|
-
* @description: Get abandon carts list
|
|
41
|
-
*/
|
|
42
|
-
getAbandonCartListPaginator({ companyId, applicationId, fromDate, toDate, pageSize, }?: {
|
|
43
|
-
companyId: string;
|
|
44
|
-
applicationId: string;
|
|
45
|
-
fromDate: string;
|
|
46
|
-
toDate: string;
|
|
47
|
-
pageSize?: number;
|
|
48
|
-
}): Paginator;
|
|
49
|
-
/**
|
|
50
|
-
* @param {Object} arg - Arg object.
|
|
51
|
-
* @param {string} arg.fromDate - From date
|
|
52
|
-
* @param {string} arg.toDate - To date
|
|
53
|
-
* @returns {Promise<string>} - Success response
|
|
54
|
-
* @summary: Get abandon carts csv
|
|
55
|
-
* @description: Get abandon carts csv
|
|
56
|
-
*/
|
|
57
|
-
getAbandonCartsCSV({ fromDate, toDate }?: {
|
|
58
|
-
fromDate: string;
|
|
59
|
-
toDate: string;
|
|
60
|
-
}): Promise<string>;
|
|
61
|
-
/**
|
|
62
|
-
* @param {Object} arg - Arg object.
|
|
63
|
-
* @param {string} arg.componentName - Component name
|
|
64
|
-
* @returns {Promise<StatsRes>} - Success response
|
|
65
|
-
* @summary: Get component statistics
|
|
66
|
-
* @description: Get component statistics
|
|
67
|
-
*/
|
|
68
|
-
getComponentStats({ componentName }?: {
|
|
69
|
-
componentName: string;
|
|
70
|
-
}): Promise<StatsRes>;
|
|
71
|
-
/**
|
|
72
|
-
* @param {Object} arg - Arg object.
|
|
73
|
-
* @param {string} arg.componentName - Component name
|
|
74
|
-
* @returns {Promise<string>} - Success response
|
|
75
|
-
* @summary: Get component statistics csv
|
|
76
|
-
* @description: Get component statistics csv
|
|
77
|
-
*/
|
|
78
|
-
getComponentStatsCSV({ componentName }?: {
|
|
79
|
-
componentName: string;
|
|
80
|
-
}): Promise<string>;
|
|
81
|
-
/**
|
|
82
|
-
* @param {Object} arg - Arg object.
|
|
83
|
-
* @param {string} arg.componentName - Component name
|
|
84
|
-
* @returns {Promise<string>} - Success response
|
|
85
|
-
* @summary: Get component statistics pdf
|
|
86
|
-
* @description: Get component statistics pdf
|
|
87
|
-
*/
|
|
88
|
-
getComponentStatsPDF({ componentName }?: {
|
|
89
|
-
componentName: string;
|
|
90
|
-
}): Promise<string>;
|
|
91
|
-
/**
|
|
92
|
-
* @param {Object} arg - Arg object.
|
|
93
|
-
* @param {string} arg.groupName - Group name
|
|
94
|
-
* @returns {Promise<StatsGroupComponents>} - Success response
|
|
95
|
-
* @summary: Get statistics group components
|
|
96
|
-
* @description: Get statistics group components
|
|
97
|
-
*/
|
|
98
|
-
getStatiscticsGroupComponents({ groupName }?: {
|
|
99
|
-
groupName: string;
|
|
100
|
-
}): Promise<StatsGroupComponents>;
|
|
101
|
-
/**
|
|
102
|
-
* @param {Object} arg - Arg object.
|
|
103
|
-
* @returns {Promise<StatsGroups>} - Success response
|
|
104
|
-
* @summary: Get statistics groups
|
|
105
|
-
* @description: Get statistics groups
|
|
106
|
-
*/
|
|
107
|
-
getStatiscticsGroups({}?: any): Promise<StatsGroups>;
|
|
108
|
-
}
|
|
109
|
-
import Paginator = require("../../common/Paginator");
|