@crmcom/self-service-sdk 3.0.0-build.10 → 3.0.0-build.12
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/index.d.ts +1 -0
- package/package.json +1 -1
- package/rewards.js +17 -1
package/index.d.ts
CHANGED
|
@@ -389,6 +389,7 @@ export declare const rewards: {
|
|
|
389
389
|
getOfferDetail(offerId: string): Promise<SDKResult>;
|
|
390
390
|
getDonationDetail(donationId: string): Promise<SDKResult>;
|
|
391
391
|
getPassPlans(params?: { page?: number; size?: number }): Promise<SDKResult>;
|
|
392
|
+
getProductRewards(): Promise<SDKResult>;
|
|
392
393
|
};
|
|
393
394
|
|
|
394
395
|
// ============================================================================
|
package/package.json
CHANGED
package/rewards.js
CHANGED
|
@@ -16,7 +16,8 @@ export const rewards = {
|
|
|
16
16
|
signOutRewardScheme,
|
|
17
17
|
getOfferDetail,
|
|
18
18
|
getDonationDetail,
|
|
19
|
-
getPassPlans
|
|
19
|
+
getPassPlans,
|
|
20
|
+
getProductRewards
|
|
20
21
|
}
|
|
21
22
|
async function getRewards() {
|
|
22
23
|
try {
|
|
@@ -33,6 +34,21 @@ async function getRewards() {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
async function getProductRewards() {
|
|
38
|
+
try {
|
|
39
|
+
let id = httpUtil.getSession().sub;
|
|
40
|
+
|
|
41
|
+
let response = await httpUtil.get({
|
|
42
|
+
resourcePath: '/v2/product_rewards',
|
|
43
|
+
});
|
|
44
|
+
//check return code here instead of put as there would be different intepretation for different API
|
|
45
|
+
return createCommonResult(response);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
logger.error('Exception getProductRewards:', e);
|
|
48
|
+
return createResult(ErrorCodes.UNKNOWN, e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
36
52
|
async function getOffers({
|
|
37
53
|
countries,
|
|
38
54
|
include_total = true,
|