@gofynd/fdk-client-javascript 3.20.0 → 3.21.0

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 CHANGED
@@ -234,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
234
234
  The above code will log the curl command in the console
235
235
 
236
236
  ```bash
237
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.20.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
237
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.21.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
238
238
  Active Theme: Emerge
239
239
  ```
240
240
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,6 @@ declare class ApplicationClient {
23
23
  share: Share;
24
24
  theme: Theme;
25
25
  user: User;
26
- webhook: Webhook;
27
26
  /**
28
27
  * Sets the cookie for the application.
29
28
  *
@@ -80,4 +79,3 @@ import Payment = require("./Payment/PaymentApplicationClient");
80
79
  import Share = require("./Share/ShareApplicationClient");
81
80
  import Theme = require("./Theme/ThemeApplicationClient");
82
81
  import User = require("./User/UserApplicationClient");
83
- import Webhook = require("./Webhook/WebhookApplicationClient");
@@ -13,7 +13,6 @@ const Payment = require("./Payment/PaymentApplicationClient");
13
13
  const Share = require("./Share/ShareApplicationClient");
14
14
  const Theme = require("./Theme/ThemeApplicationClient");
15
15
  const User = require("./User/UserApplicationClient");
16
- const Webhook = require("./Webhook/WebhookApplicationClient");
17
16
  const { FDKClientValidationError } = require("../common/FDKError");
18
17
  const { Logger } = require("../common/Logger");
19
18
  const { convertStringToBase64 } = require("../common/utils");
@@ -49,7 +48,6 @@ class ApplicationClient {
49
48
  this.share = new Share(this.config);
50
49
  this.theme = new Theme(this.config);
51
50
  this.user = new User(this.config);
52
- this.webhook = new Webhook(this.config);
53
51
  }
54
52
 
55
53
  /**
@@ -625,6 +625,9 @@ export = CommunicationPlatformModel;
625
625
  * @property {string} [mobile]
626
626
  * @property {string} [country_code]
627
627
  * @property {string} [to]
628
+ * @property {Object} [additional_template_variables] - Additional key-value
629
+ * pairs for personalizing message content. Values can be of any type and will
630
+ * be substituted into the communication templates when rendering the message.
628
631
  */
629
632
  /**
630
633
  * @typedef SendOtpCommsReqSms
@@ -1666,6 +1669,12 @@ type SendOtpCommsReqData = {
1666
1669
  mobile?: string;
1667
1670
  country_code?: string;
1668
1671
  to?: string;
1672
+ /**
1673
+ * - Additional key-value
1674
+ * pairs for personalizing message content. Values can be of any type and will
1675
+ * be substituted into the communication templates when rendering the message.
1676
+ */
1677
+ additional_template_variables?: any;
1669
1678
  };
1670
1679
  /** @returns {SendOtpCommsReqSms} */
1671
1680
  declare function SendOtpCommsReqSms(): SendOtpCommsReqSms;
@@ -715,6 +715,9 @@ const Joi = require("joi");
715
715
  * @property {string} [mobile]
716
716
  * @property {string} [country_code]
717
717
  * @property {string} [to]
718
+ * @property {Object} [additional_template_variables] - Additional key-value
719
+ * pairs for personalizing message content. Values can be of any type and will
720
+ * be substituted into the communication templates when rendering the message.
718
721
  */
719
722
 
720
723
  /**
@@ -1940,6 +1943,7 @@ class CommunicationPlatformModel {
1940
1943
  mobile: Joi.string().allow(""),
1941
1944
  country_code: Joi.string().allow(""),
1942
1945
  to: Joi.string().allow(""),
1946
+ additional_template_variables: Joi.object().pattern(/\S/, Joi.any()),
1943
1947
  });
1944
1948
  }
1945
1949
 
@@ -1,19 +0,0 @@
1
- export = Webhook;
2
- declare class Webhook {
3
- constructor(_conf: any);
4
- _conf: any;
5
- _relativeUrls: {
6
- saveClickEvent: string;
7
- };
8
- _urls: {};
9
- updateUrls(urls: any): void;
10
- /**
11
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
12
- * @param {import("../ApplicationAPIClient").Options} - Options
13
- * @returns {Promise<ClickEventDetails>} - Success response
14
- * @name saveClickEvent
15
- * @summary: Capture and save click events from various sales channels
16
- * @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
17
- */
18
- saveClickEvent({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ClickEventDetails>;
19
- }
@@ -1,72 +0,0 @@
1
- const {
2
- FDKClientValidationError,
3
- FDKResponseValidationError,
4
- } = require("../../common/FDKError");
5
-
6
- const ApplicationAPIClient = require("../ApplicationAPIClient");
7
- const constructUrl = require("../constructUrl");
8
- const Paginator = require("../../common/Paginator");
9
- const { validateRequiredParams } = require("../../common/Validator");
10
-
11
- class Webhook {
12
- constructor(_conf) {
13
- this._conf = _conf;
14
- this._relativeUrls = {
15
- saveClickEvent:
16
- "/service/application/webhook/v1.0/click-analytics/events",
17
- };
18
- this._urls = Object.entries(this._relativeUrls).reduce(
19
- (urls, [method, relativeUrl]) => {
20
- urls[method] = `${_conf.domain}${relativeUrl}`;
21
- return urls;
22
- },
23
- {}
24
- );
25
- }
26
-
27
- updateUrls(urls) {
28
- this._urls = {
29
- ...this._urls,
30
- ...urls,
31
- };
32
- }
33
-
34
- /**
35
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
36
- * @param {import("../ApplicationAPIClient").Options} - Options
37
- * @returns {Promise<ClickEventDetails>} - Success response
38
- * @name saveClickEvent
39
- * @summary: Capture and save click events from various sales channels
40
- * @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
41
- */
42
- async saveClickEvent(
43
- { body, requestHeaders } = { requestHeaders: {} },
44
- { responseHeaders } = { responseHeaders: false }
45
- ) {
46
- const query_params = {};
47
-
48
- const xHeaders = {};
49
-
50
- const response = await ApplicationAPIClient.execute(
51
- this._conf,
52
- "post",
53
- constructUrl({
54
- url: this._urls["saveClickEvent"],
55
- params: {},
56
- }),
57
- query_params,
58
- body,
59
- { ...xHeaders, ...requestHeaders },
60
- { responseHeaders }
61
- );
62
-
63
- let responseData = response;
64
- if (responseHeaders) {
65
- responseData = response[0];
66
- }
67
-
68
- return response;
69
- }
70
- }
71
-
72
- module.exports = Webhook;