Skip to content

Commit

Permalink
[Auto Generated] 1.4.2-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jigardafda committed Jan 19, 2024
1 parent 141f2d8 commit fb6414c
Show file tree
Hide file tree
Showing 22 changed files with 10,410 additions and 1,134 deletions.
11,175 changes: 10,296 additions & 879 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ console.log("Active Theme: ", response.information.name);
The above code will log the curl command in the console

```bash
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.0-beta.3' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 1.4.2-beta.1' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
Active Theme: Emerge
```

Expand Down
2 changes: 1 addition & 1 deletion dist/application.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions documentation/application/CART.md
Original file line number Diff line number Diff line change
Expand Up @@ -9424,7 +9424,9 @@ Success. Returns a success message and the coupon validity. Refer `PaymentCoupon
| applied_free_articles | [[AppliedFreeArticles](#AppliedFreeArticles)]? | yes | Applied free article for free gift item promotions |
| article_quantity | number? | yes | Quantity of article on which promotion is applicable |
| buy_rules | [[BuyRules](#BuyRules)]? | yes | Buy rules for promotions |
| code | string? | yes | Promotion code |
| discount_rules | [[DiscountRulesApp](#DiscountRulesApp)]? | yes | Discount rules for promotions |
| meta | string? | yes | Meta object for extra data |
| mrp_promotion | boolean? | yes | If applied promotion is applied on product MRP or ESP |
| offer_text | string? | yes | Offer text of current promotion |
| ownership | [Ownership](#Ownership)? | yes | Ownership of promotion |
Expand Down
2 changes: 2 additions & 0 deletions documentation/platform/CART.md
Original file line number Diff line number Diff line change
Expand Up @@ -13204,8 +13204,10 @@ Success. Returns a success message and the coupon validity. Refer `PaymentCoupon
| applied_free_articles | [[AppliedFreeArticles](#AppliedFreeArticles)]? | yes | Applied free article for free gift item promotions |
| article_quantity | number? | yes | Quantity of article on which promotion is applicable |
| buy_rules | [[BuyRules](#BuyRules)]? | yes | Buy rules for promotions |
| code | string? | yes | Promotion code |
| currency | [CartCurrency](#CartCurrency)? | yes | |
| discount_rules | [[DiscountRulesApp](#DiscountRulesApp)]? | yes | Discount rules for promotions |
| meta | string? | yes | Meta object for extra data |
| mrp_promotion | boolean? | yes | If applied promotion is applied on product MRP or ESP |
| offer_text | string? | yes | Offer text of current promotion |
| ownership | [Ownership2](#Ownership2)? | yes | Ownership of promotion |
Expand Down
13 changes: 2 additions & 11 deletions documentation/platform/ORDER.md
Original file line number Diff line number Diff line change
Expand Up @@ -9436,16 +9436,6 @@ Verify OTP
| resend_timer | number? | yes | |


---

#### [PostActivityHistory](#PostActivityHistory)

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| data | [PostHistoryData](#PostHistoryData) | no | |
| filters | [[PostHistoryFilters](#PostHistoryFilters)] | no | |


---

#### [PostHistoryData](#PostHistoryData)
Expand All @@ -9462,7 +9452,8 @@ Verify OTP

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| activity_history | [PostActivityHistory](#PostActivityHistory) | no | |
| data | [PostHistoryData](#PostHistoryData) | no | |
| filters | [[PostHistoryFilters](#PostHistoryFilters)] | no | |


---
Expand Down
2 changes: 1 addition & 1 deletion documentation/platform/SERVICEABILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3916,7 +3916,7 @@ Response status_code

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| channels | [ListViewChannels](#ListViewChannels) | no | |
| channels | [[ListViewChannels](#ListViewChannels)] | no | |
| company_id | number | no | |
| is_active | boolean | no | |
| name | string | no | |
Expand Down
44 changes: 1 addition & 43 deletions documentation/platform/WEBHOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -1462,25 +1462,6 @@ Success
| event_configs | [[EventConfig](#EventConfig)]? | yes | |


---

#### [EventConfigs](#EventConfigs)

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| created_on | string? | yes | |
| description | string? | yes | |
| display_name | string? | yes | |
| event_category | string? | yes | |
| event_name | string? | yes | |
| event_schema | string? | yes | |
| event_type | string? | yes | |
| id | number? | yes | |
| subscriber_event_mapping | [SubscriberEventMapping](#SubscriberEventMapping)? | yes | |
| updated_on | string? | yes | |
| version | string? | yes | |


---

#### [EventProcessReportObject](#EventProcessReportObject)
Expand Down Expand Up @@ -1755,29 +1736,6 @@ Success
| webhook_url | string? | yes | |


---

#### [SubscriberEventMapping](#SubscriberEventMapping)

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| created_on | string? | yes | |
| event_id | number? | yes | |
| id | number? | yes | |
| subscriber_id | number? | yes | |


---

#### [SubscriberFailureResponse](#SubscriberFailureResponse)

| Properties | Type | Nullable | Description |
| ---------- | ---- | -------- | ----------- |
| code | string? | yes | |
| message | string? | yes | |
| stack | string? | yes | |


---

#### [SubscriberResponse](#SubscriberResponse)
Expand All @@ -1789,7 +1747,7 @@ Success
| created_on | string? | yes | |
| custom_headers | string? | yes | |
| email_id | string? | yes | |
| event_configs | [[EventConfigs](#EventConfigs)]? | yes | |
| event_configs | [[EventConfig](#EventConfig)]? | yes | |
| id | number? | yes | |
| modified_by | string? | yes | |
| name | string? | yes | |
Expand Down
45 changes: 23 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gofynd/fdk-client-javascript",
"version": "1.4.0-beta.3",
"version": "1.4.2-beta.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 10 additions & 0 deletions sdk/application/Cart/CartApplicationModel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export = CartApplicationModel;
* @property {number} [article_quantity] - Quantity of article on which
* promotion is applicable
* @property {BuyRules[]} [buy_rules] - Buy rules for promotions
* @property {string} [code] - Promotion code
* @property {DiscountRulesApp[]} [discount_rules] - Discount rules for promotions
* @property {Object} [meta] - Meta object for extra data
* @property {boolean} [mrp_promotion] - If applied promotion is applied on
* product MRP or ESP
* @property {string} [offer_text] - Offer text of current promotion
Expand Down Expand Up @@ -1056,10 +1058,18 @@ type AppliedPromotion = {
* - Buy rules for promotions
*/
buy_rules?: BuyRules[];
/**
* - Promotion code
*/
code?: string;
/**
* - Discount rules for promotions
*/
discount_rules?: DiscountRulesApp[];
/**
* - Meta object for extra data
*/
meta?: any;
/**
* - If applied promotion is applied on
* product MRP or ESP
Expand Down
4 changes: 4 additions & 0 deletions sdk/application/Cart/CartApplicationModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ const Joi = require("joi");
* @property {number} [article_quantity] - Quantity of article on which
* promotion is applicable
* @property {BuyRules[]} [buy_rules] - Buy rules for promotions
* @property {string} [code] - Promotion code
* @property {DiscountRulesApp[]} [discount_rules] - Discount rules for promotions
* @property {Object} [meta] - Meta object for extra data
* @property {boolean} [mrp_promotion] - If applied promotion is applied on
* product MRP or ESP
* @property {string} [offer_text] - Offer text of current promotion
Expand Down Expand Up @@ -1129,9 +1131,11 @@ class CartApplicationModel {
),
article_quantity: Joi.number(),
buy_rules: Joi.array().items(CartApplicationModel.BuyRules()),
code: Joi.string().allow("").allow(null),
discount_rules: Joi.array().items(
CartApplicationModel.DiscountRulesApp()
),
meta: Joi.any(),
mrp_promotion: Joi.boolean(),
offer_text: Joi.string().allow(""),
ownership: CartApplicationModel.Ownership(),
Expand Down
39 changes: 29 additions & 10 deletions sdk/partner/OAuthClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,37 @@ class OAuthClient extends BaseOAuthClient {
}
}

async renewAccessToken(isOfflineToken = true) {
if (isOfflineToken) {
await this.getNewAccessToken();
} else {
res = await this.getAccesstokenObj({
grant_type: "refresh_token",
refresh_token: this.refreshToken,
});
res.expires_at =
res.expires_at || new Date().getTime() + res.expires_in * 1000;
async renewAccessToken(isOfflineToken = false) {
try {
Logger({ level: "INFO", message: "Renewing partner access token..." });
let res;
if (isOfflineToken) {
let requestCacheKey = `${this.config.apiKey}:${this.config.organizationId}`;
if (!refreshTokenRequestCache[requestCacheKey]) {
refreshTokenRequestCache[requestCacheKey] = this.getAccesstokenObj({
grant_type: "refresh_token",
refresh_token: this.refreshToken,
});
}
res = await refreshTokenRequestCache[requestCacheKey].finally(() => {
delete refreshTokenRequestCache[requestCacheKey];
});
} else {
res = await this.getAccesstokenObj({
grant_type: "refresh_token",
refresh_token: this.refreshToken,
});
}
this.setToken(res);
this.token_expires_at =
new Date().getTime() + this.token_expires_in * 1000;
Logger({ level: "INFO", message: "Done." });
return res;
} catch (error) {
if (error.isAxiosError) {
throw new FDKTokenIssueError(error.message);
}
throw error;
}
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/partner/PartnerAPIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class APIClient {
* @param {Options} options
*/
static async execute(conf, method, url, query, body, xHeaders, options) {
const token = await conf.oauthClient.getNewAccessToken();
const token = await conf.oauthClient.getAccessToken();

const extraHeaders = conf.extraHeaders.reduce((acc, curr) => {
acc = { ...acc, ...curr };
Expand Down
10 changes: 10 additions & 0 deletions sdk/platform/Cart/CartPlatformModel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ export = CartPlatformModel;
* @property {number} [article_quantity] - Quantity of article on which
* promotion is applicable
* @property {BuyRules[]} [buy_rules] - Buy rules for promotions
* @property {string} [code] - Promotion code
* @property {CartCurrency} [currency]
* @property {DiscountRulesApp[]} [discount_rules] - Discount rules for promotions
* @property {Object} [meta] - Meta object for extra data
* @property {boolean} [mrp_promotion] - If applied promotion is applied on
* product MRP or ESP
* @property {string} [offer_text] - Offer text of current promotion
Expand Down Expand Up @@ -1909,11 +1911,19 @@ type AppliedPromotion = {
* - Buy rules for promotions
*/
buy_rules?: BuyRules[];
/**
* - Promotion code
*/
code?: string;
currency?: CartCurrency;
/**
* - Discount rules for promotions
*/
discount_rules?: DiscountRulesApp[];
/**
* - Meta object for extra data
*/
meta?: any;
/**
* - If applied promotion is applied on
* product MRP or ESP
Expand Down
4 changes: 4 additions & 0 deletions sdk/platform/Cart/CartPlatformModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ const Joi = require("joi");
* @property {number} [article_quantity] - Quantity of article on which
* promotion is applicable
* @property {BuyRules[]} [buy_rules] - Buy rules for promotions
* @property {string} [code] - Promotion code
* @property {CartCurrency} [currency]
* @property {DiscountRulesApp[]} [discount_rules] - Discount rules for promotions
* @property {Object} [meta] - Meta object for extra data
* @property {boolean} [mrp_promotion] - If applied promotion is applied on
* product MRP or ESP
* @property {string} [offer_text] - Offer text of current promotion
Expand Down Expand Up @@ -2033,8 +2035,10 @@ class CartPlatformModel {
),
article_quantity: Joi.number(),
buy_rules: Joi.array().items(CartPlatformModel.BuyRules()),
code: Joi.string().allow("").allow(null),
currency: CartPlatformModel.CartCurrency(),
discount_rules: Joi.array().items(CartPlatformModel.DiscountRulesApp()),
meta: Joi.any(),
mrp_promotion: Joi.boolean(),
offer_text: Joi.string().allow(""),
ownership: CartPlatformModel.Ownership2(),
Expand Down
Loading

0 comments on commit fb6414c

Please sign in to comment.