@gofynd/fdk-client-javascript 1.3.3 → 1.3.4-beta.2
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 +1 -1
- package/package.json +1 -1
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +18 -1
- package/sdk/application/Catalog/CatalogApplicationModel.js +20 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +23 -9
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +21 -7
- package/sdk/application/User/UserApplicationClient.d.ts +56 -0
- package/sdk/application/User/UserApplicationClient.js +385 -0
- package/sdk/application/User/UserApplicationModel.d.ts +93 -1
- package/sdk/application/User/UserApplicationModel.js +110 -0
- package/sdk/application/User/UserApplicationValidator.d.ts +66 -1
- package/sdk/application/User/UserApplicationValidator.js +68 -0
- package/sdk/common/AxiosHelper.js +10 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +96 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +177 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +139 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +158 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +6 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +33 -0
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/PartnerConfig.js +3 -5
- package/sdk/partner/index.d.ts +1 -0
- package/sdk/partner/index.js +2 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +11 -79
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +12 -8
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -9
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +37 -27
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -56
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +22 -11
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +24 -10
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +4 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +832 -150
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +940 -138
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +1 -1
- package/sdk/platform/Order/OrderPlatformModel.d.ts +10 -2
- package/sdk/platform/Order/OrderPlatformModel.js +10 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +4 -4
- package/sdk/platform/Order/OrderPlatformValidator.js +4 -4
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +42 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +241 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +41 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +40 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +72 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +54 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +12 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +79 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -1
- package/sdk/platform/User/UserPlatformApplicationValidator.js +14 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +63 -1
- package/sdk/platform/User/UserPlatformModel.js +44 -0
|
@@ -41,6 +41,12 @@ class User {
|
|
|
41
41
|
logout: "/service/application/user/authentication/v1.0/logout",
|
|
42
42
|
registerWithForm:
|
|
43
43
|
"/service/application/user/authentication/v1.0/register/form",
|
|
44
|
+
resetForgotPassword:
|
|
45
|
+
"/service/application/user/authentication/v1.0/login/password/forgot",
|
|
46
|
+
sendForgotOTPOnEmail:
|
|
47
|
+
"/service/application/user/authentication/v1.0/otp/forgot/email/send",
|
|
48
|
+
sendForgotOTPOnMobile:
|
|
49
|
+
"/service/application/user/authentication/v1.0/otp/forgot/mobile/send",
|
|
44
50
|
sendOTPOnEmail:
|
|
45
51
|
"/service/application/user/authentication/v1.0/otp/email/send",
|
|
46
52
|
sendOTPOnMobile:
|
|
@@ -61,10 +67,14 @@ class User {
|
|
|
61
67
|
updatePassword: "/service/application/user/authentication/v1.0/password",
|
|
62
68
|
updateProfile: "/service/application/user/profile/v1.0/detail",
|
|
63
69
|
verifyEmail: "/service/application/user/authentication/v1.0/verify/email",
|
|
70
|
+
verifyEmailForgotOTP:
|
|
71
|
+
"/service/application/user/authentication/v1.0/otp/forgot/email/verify",
|
|
64
72
|
verifyEmailOTP:
|
|
65
73
|
"/service/application/user/authentication/v1.0/otp/email/verify",
|
|
66
74
|
verifyMobile:
|
|
67
75
|
"/service/application/user/authentication/v1.0/verify/mobile",
|
|
76
|
+
verifyMobileForgotOTP:
|
|
77
|
+
"/service/application/user/authentication/v1.0/otp/forgot/mobile/verify",
|
|
68
78
|
verifyMobileOTP:
|
|
69
79
|
"/service/application/user/authentication/v1.0/otp/mobile/verify",
|
|
70
80
|
};
|
|
@@ -1591,6 +1601,231 @@ class User {
|
|
|
1591
1601
|
return response;
|
|
1592
1602
|
}
|
|
1593
1603
|
|
|
1604
|
+
/**
|
|
1605
|
+
* @param {UserApplicationValidator.ResetForgotPasswordParam} arg - Arg object.
|
|
1606
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1607
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1608
|
+
* @returns {Promise<UserApplicationModel.ResetForgotPasswordSuccess>} -
|
|
1609
|
+
* Success response
|
|
1610
|
+
* @name resetForgotPassword
|
|
1611
|
+
* @summary: Reset forgot Password
|
|
1612
|
+
* @description: Use this API to reset a password using the code sent on email or SMS. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/resetForgotPassword/).
|
|
1613
|
+
*/
|
|
1614
|
+
async resetForgotPassword(
|
|
1615
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
1616
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1617
|
+
) {
|
|
1618
|
+
const { error } = UserApplicationValidator.resetForgotPassword().validate(
|
|
1619
|
+
{ body },
|
|
1620
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1621
|
+
);
|
|
1622
|
+
if (error) {
|
|
1623
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1627
|
+
const {
|
|
1628
|
+
error: warrning,
|
|
1629
|
+
} = UserApplicationValidator.resetForgotPassword().validate(
|
|
1630
|
+
{ body },
|
|
1631
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1632
|
+
);
|
|
1633
|
+
if (warrning) {
|
|
1634
|
+
Logger({
|
|
1635
|
+
level: "WARN",
|
|
1636
|
+
message: `Parameter Validation warrnings for application > User > resetForgotPassword \n ${warrning}`,
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
const query_params = {};
|
|
1641
|
+
|
|
1642
|
+
const xHeaders = {};
|
|
1643
|
+
|
|
1644
|
+
const response = await ApplicationAPIClient.execute(
|
|
1645
|
+
this._conf,
|
|
1646
|
+
"post",
|
|
1647
|
+
constructUrl({
|
|
1648
|
+
url: this._urls["resetForgotPassword"],
|
|
1649
|
+
params: {},
|
|
1650
|
+
}),
|
|
1651
|
+
query_params,
|
|
1652
|
+
body,
|
|
1653
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1654
|
+
{ responseHeaders }
|
|
1655
|
+
);
|
|
1656
|
+
|
|
1657
|
+
let responseData = response;
|
|
1658
|
+
if (responseHeaders) {
|
|
1659
|
+
responseData = response[0];
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
const {
|
|
1663
|
+
error: res_error,
|
|
1664
|
+
} = UserApplicationModel.ResetForgotPasswordSuccess().validate(
|
|
1665
|
+
responseData,
|
|
1666
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1667
|
+
);
|
|
1668
|
+
|
|
1669
|
+
if (res_error) {
|
|
1670
|
+
Logger({
|
|
1671
|
+
level: "WARN",
|
|
1672
|
+
message: `Response Validation Warnnings for application > User > resetForgotPassword \n ${res_error}`,
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
return response;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* @param {UserApplicationValidator.SendForgotOTPOnEmailParam} arg - Arg object.
|
|
1681
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1682
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1683
|
+
* @returns {Promise<UserApplicationModel.EmailOtpSuccess>} - Success response
|
|
1684
|
+
* @name sendForgotOTPOnEmail
|
|
1685
|
+
* @summary: Send Forgot OTP on email
|
|
1686
|
+
* @description: Use this API to send an Forgot OTP to an email ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendForgotOTPOnEmail/).
|
|
1687
|
+
*/
|
|
1688
|
+
async sendForgotOTPOnEmail(
|
|
1689
|
+
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
1690
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1691
|
+
) {
|
|
1692
|
+
const { error } = UserApplicationValidator.sendForgotOTPOnEmail().validate(
|
|
1693
|
+
{ body, platform },
|
|
1694
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1695
|
+
);
|
|
1696
|
+
if (error) {
|
|
1697
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1701
|
+
const {
|
|
1702
|
+
error: warrning,
|
|
1703
|
+
} = UserApplicationValidator.sendForgotOTPOnEmail().validate(
|
|
1704
|
+
{ body, platform },
|
|
1705
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1706
|
+
);
|
|
1707
|
+
if (warrning) {
|
|
1708
|
+
Logger({
|
|
1709
|
+
level: "WARN",
|
|
1710
|
+
message: `Parameter Validation warrnings for application > User > sendForgotOTPOnEmail \n ${warrning}`,
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
const query_params = {};
|
|
1715
|
+
query_params["platform"] = platform;
|
|
1716
|
+
|
|
1717
|
+
const xHeaders = {};
|
|
1718
|
+
|
|
1719
|
+
const response = await ApplicationAPIClient.execute(
|
|
1720
|
+
this._conf,
|
|
1721
|
+
"post",
|
|
1722
|
+
constructUrl({
|
|
1723
|
+
url: this._urls["sendForgotOTPOnEmail"],
|
|
1724
|
+
params: {},
|
|
1725
|
+
}),
|
|
1726
|
+
query_params,
|
|
1727
|
+
body,
|
|
1728
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1729
|
+
{ responseHeaders }
|
|
1730
|
+
);
|
|
1731
|
+
|
|
1732
|
+
let responseData = response;
|
|
1733
|
+
if (responseHeaders) {
|
|
1734
|
+
responseData = response[0];
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
const {
|
|
1738
|
+
error: res_error,
|
|
1739
|
+
} = UserApplicationModel.EmailOtpSuccess().validate(responseData, {
|
|
1740
|
+
abortEarly: false,
|
|
1741
|
+
allowUnknown: false,
|
|
1742
|
+
});
|
|
1743
|
+
|
|
1744
|
+
if (res_error) {
|
|
1745
|
+
Logger({
|
|
1746
|
+
level: "WARN",
|
|
1747
|
+
message: `Response Validation Warnnings for application > User > sendForgotOTPOnEmail \n ${res_error}`,
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
return response;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* @param {UserApplicationValidator.SendForgotOTPOnMobileParam} arg - Arg object.
|
|
1756
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1757
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
1758
|
+
* @returns {Promise<UserApplicationModel.OtpSuccess>} - Success response
|
|
1759
|
+
* @name sendForgotOTPOnMobile
|
|
1760
|
+
* @summary: Send Forgot OTP on mobile
|
|
1761
|
+
* @description: Use this API to send an Forgot OTP to a mobile number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/sendForgotOTPOnMobile/).
|
|
1762
|
+
*/
|
|
1763
|
+
async sendForgotOTPOnMobile(
|
|
1764
|
+
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
1765
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1766
|
+
) {
|
|
1767
|
+
const { error } = UserApplicationValidator.sendForgotOTPOnMobile().validate(
|
|
1768
|
+
{ body, platform },
|
|
1769
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1770
|
+
);
|
|
1771
|
+
if (error) {
|
|
1772
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1776
|
+
const {
|
|
1777
|
+
error: warrning,
|
|
1778
|
+
} = UserApplicationValidator.sendForgotOTPOnMobile().validate(
|
|
1779
|
+
{ body, platform },
|
|
1780
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1781
|
+
);
|
|
1782
|
+
if (warrning) {
|
|
1783
|
+
Logger({
|
|
1784
|
+
level: "WARN",
|
|
1785
|
+
message: `Parameter Validation warrnings for application > User > sendForgotOTPOnMobile \n ${warrning}`,
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
const query_params = {};
|
|
1790
|
+
query_params["platform"] = platform;
|
|
1791
|
+
|
|
1792
|
+
const xHeaders = {};
|
|
1793
|
+
|
|
1794
|
+
const response = await ApplicationAPIClient.execute(
|
|
1795
|
+
this._conf,
|
|
1796
|
+
"post",
|
|
1797
|
+
constructUrl({
|
|
1798
|
+
url: this._urls["sendForgotOTPOnMobile"],
|
|
1799
|
+
params: {},
|
|
1800
|
+
}),
|
|
1801
|
+
query_params,
|
|
1802
|
+
body,
|
|
1803
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1804
|
+
{ responseHeaders }
|
|
1805
|
+
);
|
|
1806
|
+
|
|
1807
|
+
let responseData = response;
|
|
1808
|
+
if (responseHeaders) {
|
|
1809
|
+
responseData = response[0];
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
const {
|
|
1813
|
+
error: res_error,
|
|
1814
|
+
} = UserApplicationModel.OtpSuccess().validate(responseData, {
|
|
1815
|
+
abortEarly: false,
|
|
1816
|
+
allowUnknown: false,
|
|
1817
|
+
});
|
|
1818
|
+
|
|
1819
|
+
if (res_error) {
|
|
1820
|
+
Logger({
|
|
1821
|
+
level: "WARN",
|
|
1822
|
+
message: `Response Validation Warnnings for application > User > sendForgotOTPOnMobile \n ${res_error}`,
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
return response;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1594
1829
|
/**
|
|
1595
1830
|
* @param {UserApplicationValidator.SendOTPOnEmailParam} arg - Arg object.
|
|
1596
1831
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2499,6 +2734,81 @@ class User {
|
|
|
2499
2734
|
return response;
|
|
2500
2735
|
}
|
|
2501
2736
|
|
|
2737
|
+
/**
|
|
2738
|
+
* @param {UserApplicationValidator.VerifyEmailForgotOTPParam} arg - Arg object.
|
|
2739
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2740
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2741
|
+
* @returns {Promise<UserApplicationModel.VerifyForgotOtpSuccess>} - Success response
|
|
2742
|
+
* @name verifyEmailForgotOTP
|
|
2743
|
+
* @summary: Verify Forgot OTP on email
|
|
2744
|
+
* @description: Use this API to verify the Forgot OTP received on an email ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyEmailForgotOTP/).
|
|
2745
|
+
*/
|
|
2746
|
+
async verifyEmailForgotOTP(
|
|
2747
|
+
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
2748
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2749
|
+
) {
|
|
2750
|
+
const { error } = UserApplicationValidator.verifyEmailForgotOTP().validate(
|
|
2751
|
+
{ body, platform },
|
|
2752
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2753
|
+
);
|
|
2754
|
+
if (error) {
|
|
2755
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2759
|
+
const {
|
|
2760
|
+
error: warrning,
|
|
2761
|
+
} = UserApplicationValidator.verifyEmailForgotOTP().validate(
|
|
2762
|
+
{ body, platform },
|
|
2763
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2764
|
+
);
|
|
2765
|
+
if (warrning) {
|
|
2766
|
+
Logger({
|
|
2767
|
+
level: "WARN",
|
|
2768
|
+
message: `Parameter Validation warrnings for application > User > verifyEmailForgotOTP \n ${warrning}`,
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
const query_params = {};
|
|
2773
|
+
query_params["platform"] = platform;
|
|
2774
|
+
|
|
2775
|
+
const xHeaders = {};
|
|
2776
|
+
|
|
2777
|
+
const response = await ApplicationAPIClient.execute(
|
|
2778
|
+
this._conf,
|
|
2779
|
+
"post",
|
|
2780
|
+
constructUrl({
|
|
2781
|
+
url: this._urls["verifyEmailForgotOTP"],
|
|
2782
|
+
params: {},
|
|
2783
|
+
}),
|
|
2784
|
+
query_params,
|
|
2785
|
+
body,
|
|
2786
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2787
|
+
{ responseHeaders }
|
|
2788
|
+
);
|
|
2789
|
+
|
|
2790
|
+
let responseData = response;
|
|
2791
|
+
if (responseHeaders) {
|
|
2792
|
+
responseData = response[0];
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
const {
|
|
2796
|
+
error: res_error,
|
|
2797
|
+
} = UserApplicationModel.VerifyForgotOtpSuccess().validate(responseData, {
|
|
2798
|
+
abortEarly: false,
|
|
2799
|
+
allowUnknown: false,
|
|
2800
|
+
});
|
|
2801
|
+
|
|
2802
|
+
if (res_error) {
|
|
2803
|
+
Logger({
|
|
2804
|
+
level: "WARN",
|
|
2805
|
+
message: `Response Validation Warnnings for application > User > verifyEmailForgotOTP \n ${res_error}`,
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
|
|
2809
|
+
return response;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2502
2812
|
/**
|
|
2503
2813
|
* @param {UserApplicationValidator.VerifyEmailOTPParam} arg - Arg object.
|
|
2504
2814
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -2648,6 +2958,81 @@ class User {
|
|
|
2648
2958
|
return response;
|
|
2649
2959
|
}
|
|
2650
2960
|
|
|
2961
|
+
/**
|
|
2962
|
+
* @param {UserApplicationValidator.VerifyMobileForgotOTPParam} arg - Arg object.
|
|
2963
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2964
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
2965
|
+
* @returns {Promise<UserApplicationModel.VerifyForgotOtpSuccess>} - Success response
|
|
2966
|
+
* @name verifyMobileForgotOTP
|
|
2967
|
+
* @summary: Verify Forgot OTP on mobile
|
|
2968
|
+
* @description: Use this API to verify the Forgot OTP received on a mobile number. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/user/verifyMobileForgotOTP/).
|
|
2969
|
+
*/
|
|
2970
|
+
async verifyMobileForgotOTP(
|
|
2971
|
+
{ body, platform, requestHeaders } = { requestHeaders: {} },
|
|
2972
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2973
|
+
) {
|
|
2974
|
+
const { error } = UserApplicationValidator.verifyMobileForgotOTP().validate(
|
|
2975
|
+
{ body, platform },
|
|
2976
|
+
{ abortEarly: false, allowUnknown: true }
|
|
2977
|
+
);
|
|
2978
|
+
if (error) {
|
|
2979
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
// Showing warrnings if extra unknown parameters are found
|
|
2983
|
+
const {
|
|
2984
|
+
error: warrning,
|
|
2985
|
+
} = UserApplicationValidator.verifyMobileForgotOTP().validate(
|
|
2986
|
+
{ body, platform },
|
|
2987
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2988
|
+
);
|
|
2989
|
+
if (warrning) {
|
|
2990
|
+
Logger({
|
|
2991
|
+
level: "WARN",
|
|
2992
|
+
message: `Parameter Validation warrnings for application > User > verifyMobileForgotOTP \n ${warrning}`,
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
|
|
2996
|
+
const query_params = {};
|
|
2997
|
+
query_params["platform"] = platform;
|
|
2998
|
+
|
|
2999
|
+
const xHeaders = {};
|
|
3000
|
+
|
|
3001
|
+
const response = await ApplicationAPIClient.execute(
|
|
3002
|
+
this._conf,
|
|
3003
|
+
"post",
|
|
3004
|
+
constructUrl({
|
|
3005
|
+
url: this._urls["verifyMobileForgotOTP"],
|
|
3006
|
+
params: {},
|
|
3007
|
+
}),
|
|
3008
|
+
query_params,
|
|
3009
|
+
body,
|
|
3010
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3011
|
+
{ responseHeaders }
|
|
3012
|
+
);
|
|
3013
|
+
|
|
3014
|
+
let responseData = response;
|
|
3015
|
+
if (responseHeaders) {
|
|
3016
|
+
responseData = response[0];
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
const {
|
|
3020
|
+
error: res_error,
|
|
3021
|
+
} = UserApplicationModel.VerifyForgotOtpSuccess().validate(responseData, {
|
|
3022
|
+
abortEarly: false,
|
|
3023
|
+
allowUnknown: false,
|
|
3024
|
+
});
|
|
3025
|
+
|
|
3026
|
+
if (res_error) {
|
|
3027
|
+
Logger({
|
|
3028
|
+
level: "WARN",
|
|
3029
|
+
message: `Response Validation Warnnings for application > User > verifyMobileForgotOTP \n ${res_error}`,
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
|
|
3033
|
+
return response;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
2651
3036
|
/**
|
|
2652
3037
|
* @param {UserApplicationValidator.VerifyMobileOTPParam} arg - Arg object.
|
|
2653
3038
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3,6 +3,14 @@ export = UserApplicationModel;
|
|
|
3
3
|
* @typedef Accountkit
|
|
4
4
|
* @property {string} [app_id]
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef APIError
|
|
8
|
+
* @property {string} [code]
|
|
9
|
+
* @property {string} [info] - Error code description link
|
|
10
|
+
* @property {string} [message]
|
|
11
|
+
* @property {Object} [meta]
|
|
12
|
+
* @property {string} [request_id]
|
|
13
|
+
*/
|
|
6
14
|
/**
|
|
7
15
|
* @typedef AuthenticationApiErrorSchema
|
|
8
16
|
* @property {string} [message]
|
|
@@ -298,10 +306,20 @@ export = UserApplicationModel;
|
|
|
298
306
|
* @property {PlatformEmail} [email]
|
|
299
307
|
* @property {PlatformMobile} [mobile]
|
|
300
308
|
*/
|
|
309
|
+
/**
|
|
310
|
+
* @typedef ResetForgotPasswordSuccess
|
|
311
|
+
* @property {boolean} [success]
|
|
312
|
+
*/
|
|
301
313
|
/**
|
|
302
314
|
* @typedef ResetPasswordSuccess
|
|
303
315
|
* @property {string} [status]
|
|
304
316
|
*/
|
|
317
|
+
/**
|
|
318
|
+
* @typedef SendEmailForgotOtpRequestSchema
|
|
319
|
+
* @property {string} [action]
|
|
320
|
+
* @property {string} [email]
|
|
321
|
+
* @property {string} [token]
|
|
322
|
+
*/
|
|
305
323
|
/**
|
|
306
324
|
* @typedef SendEmailOtpRequestSchema
|
|
307
325
|
* @property {string} [action]
|
|
@@ -314,6 +332,14 @@ export = UserApplicationModel;
|
|
|
314
332
|
* @typedef SendEmailVerifyLinkSuccess
|
|
315
333
|
* @property {boolean} [verify_email_link]
|
|
316
334
|
*/
|
|
335
|
+
/**
|
|
336
|
+
* @typedef SendMobileForgotOtpRequestSchema
|
|
337
|
+
* @property {string} [action]
|
|
338
|
+
* @property {string} [android_hash]
|
|
339
|
+
* @property {string} [country_code]
|
|
340
|
+
* @property {string} [mobile]
|
|
341
|
+
* @property {string} [token]
|
|
342
|
+
*/
|
|
317
343
|
/**
|
|
318
344
|
* @typedef SendMobileOtpRequestSchema
|
|
319
345
|
* @property {string} [action]
|
|
@@ -425,6 +451,11 @@ export = UserApplicationModel;
|
|
|
425
451
|
* @property {string} [user_id]
|
|
426
452
|
* @property {string} [username]
|
|
427
453
|
*/
|
|
454
|
+
/**
|
|
455
|
+
* @typedef VerifyEmailForgotOtpRequestSchema
|
|
456
|
+
* @property {string} [email]
|
|
457
|
+
* @property {string} [otp]
|
|
458
|
+
*/
|
|
428
459
|
/**
|
|
429
460
|
* @typedef VerifyEmailOtpRequestSchema
|
|
430
461
|
* @property {string} [action]
|
|
@@ -441,6 +472,16 @@ export = UserApplicationModel;
|
|
|
441
472
|
* @typedef VerifyEmailSuccess
|
|
442
473
|
* @property {string} [message]
|
|
443
474
|
*/
|
|
475
|
+
/**
|
|
476
|
+
* @typedef VerifyForgotOtpSuccess
|
|
477
|
+
* @property {string} [forgot_token]
|
|
478
|
+
* @property {boolean} [success]
|
|
479
|
+
*/
|
|
480
|
+
/**
|
|
481
|
+
* @typedef VerifyMobileForgotOtpRequestSchema
|
|
482
|
+
* @property {string} [otp]
|
|
483
|
+
* @property {string} [request_id]
|
|
484
|
+
*/
|
|
444
485
|
/**
|
|
445
486
|
* @typedef VerifyMobileOTPSuccess
|
|
446
487
|
* @property {UserSchema} [user]
|
|
@@ -461,13 +502,25 @@ export = UserApplicationModel;
|
|
|
461
502
|
declare class UserApplicationModel {
|
|
462
503
|
}
|
|
463
504
|
declare namespace UserApplicationModel {
|
|
464
|
-
export { Accountkit, AuthenticationApiErrorSchema, AuthenticationInternalServerErrorSchema, AuthSuccess, CodeRequestBodySchema, DeleteAccountConsent, DeleteAccountReasons, DeleteApplicationUserRequestSchema, DeleteUserSuccess, EditEmailRequestSchema, EditMobileRequestSchema, EditProfileMobileSchema, EditProfileRequestSchema, Email, EmailOtpSuccess, Facebook, FlashCard, ForgotPasswordRequestSchema, FormRegisterRequestSchema, FormRegisterRequestSchemaPhone, Google, HasPasswordSuccess, Login, LoginSuccess, LogoutSuccess, LookAndFeel, MetaSchema, OAuthRequestAppleSchema, OAuthRequestAppleSchemaOauth, OAuthRequestAppleSchemaProfile, OAuthRequestSchema, OAuthRequestSchemaOauth2, OAuthRequestSchemaProfile, OtpSuccess, PasswordLoginRequestSchema, PhoneNumber, PlatformEmail, PlatformMobile, PlatformSchema, ProfileEditSuccess, RegisterFormSuccess, RegisterRequiredFields, RegisterRequiredFieldsEmail, RegisterRequiredFieldsMobile, RequiredFields, ResetPasswordSuccess, SendEmailOtpRequestSchema, SendEmailVerifyLinkSuccess, SendMobileOtpRequestSchema, SendMobileVerifyLinkSuccess, SendOtpRequestSchema, SendOtpResponse, SendResetPasswordEmailRequestSchema, SendResetPasswordMobileRequestSchema, SendVerificationLinkMobileRequestSchema, SessionExpiry, SessionListSuccess, Social, SocialTokens, TokenRequestBodySchema, UpdatePasswordRequestSchema, UserObjectSchema, UserSchema, VerifyEmailOtpRequestSchema, VerifyEmailOTPSuccess, VerifyEmailSuccess, VerifyMobileOTPSuccess, VerifyOtpRequestSchema, VerifyOtpSuccess };
|
|
505
|
+
export { Accountkit, APIError, AuthenticationApiErrorSchema, AuthenticationInternalServerErrorSchema, AuthSuccess, CodeRequestBodySchema, DeleteAccountConsent, DeleteAccountReasons, DeleteApplicationUserRequestSchema, DeleteUserSuccess, EditEmailRequestSchema, EditMobileRequestSchema, EditProfileMobileSchema, EditProfileRequestSchema, Email, EmailOtpSuccess, Facebook, FlashCard, ForgotPasswordRequestSchema, FormRegisterRequestSchema, FormRegisterRequestSchemaPhone, Google, HasPasswordSuccess, Login, LoginSuccess, LogoutSuccess, LookAndFeel, MetaSchema, OAuthRequestAppleSchema, OAuthRequestAppleSchemaOauth, OAuthRequestAppleSchemaProfile, OAuthRequestSchema, OAuthRequestSchemaOauth2, OAuthRequestSchemaProfile, OtpSuccess, PasswordLoginRequestSchema, PhoneNumber, PlatformEmail, PlatformMobile, PlatformSchema, ProfileEditSuccess, RegisterFormSuccess, RegisterRequiredFields, RegisterRequiredFieldsEmail, RegisterRequiredFieldsMobile, RequiredFields, ResetForgotPasswordSuccess, ResetPasswordSuccess, SendEmailForgotOtpRequestSchema, SendEmailOtpRequestSchema, SendEmailVerifyLinkSuccess, SendMobileForgotOtpRequestSchema, SendMobileOtpRequestSchema, SendMobileVerifyLinkSuccess, SendOtpRequestSchema, SendOtpResponse, SendResetPasswordEmailRequestSchema, SendResetPasswordMobileRequestSchema, SendVerificationLinkMobileRequestSchema, SessionExpiry, SessionListSuccess, Social, SocialTokens, TokenRequestBodySchema, UpdatePasswordRequestSchema, UserObjectSchema, UserSchema, VerifyEmailForgotOtpRequestSchema, VerifyEmailOtpRequestSchema, VerifyEmailOTPSuccess, VerifyEmailSuccess, VerifyForgotOtpSuccess, VerifyMobileForgotOtpRequestSchema, VerifyMobileOTPSuccess, VerifyOtpRequestSchema, VerifyOtpSuccess };
|
|
465
506
|
}
|
|
466
507
|
/** @returns {Accountkit} */
|
|
467
508
|
declare function Accountkit(): Accountkit;
|
|
468
509
|
type Accountkit = {
|
|
469
510
|
app_id?: string;
|
|
470
511
|
};
|
|
512
|
+
/** @returns {APIError} */
|
|
513
|
+
declare function APIError(): APIError;
|
|
514
|
+
type APIError = {
|
|
515
|
+
code?: string;
|
|
516
|
+
/**
|
|
517
|
+
* - Error code description link
|
|
518
|
+
*/
|
|
519
|
+
info?: string;
|
|
520
|
+
message?: string;
|
|
521
|
+
meta?: any;
|
|
522
|
+
request_id?: string;
|
|
523
|
+
};
|
|
471
524
|
/** @returns {AuthenticationApiErrorSchema} */
|
|
472
525
|
declare function AuthenticationApiErrorSchema(): AuthenticationApiErrorSchema;
|
|
473
526
|
type AuthenticationApiErrorSchema = {
|
|
@@ -807,11 +860,23 @@ type RequiredFields = {
|
|
|
807
860
|
email?: PlatformEmail;
|
|
808
861
|
mobile?: PlatformMobile;
|
|
809
862
|
};
|
|
863
|
+
/** @returns {ResetForgotPasswordSuccess} */
|
|
864
|
+
declare function ResetForgotPasswordSuccess(): ResetForgotPasswordSuccess;
|
|
865
|
+
type ResetForgotPasswordSuccess = {
|
|
866
|
+
success?: boolean;
|
|
867
|
+
};
|
|
810
868
|
/** @returns {ResetPasswordSuccess} */
|
|
811
869
|
declare function ResetPasswordSuccess(): ResetPasswordSuccess;
|
|
812
870
|
type ResetPasswordSuccess = {
|
|
813
871
|
status?: string;
|
|
814
872
|
};
|
|
873
|
+
/** @returns {SendEmailForgotOtpRequestSchema} */
|
|
874
|
+
declare function SendEmailForgotOtpRequestSchema(): SendEmailForgotOtpRequestSchema;
|
|
875
|
+
type SendEmailForgotOtpRequestSchema = {
|
|
876
|
+
action?: string;
|
|
877
|
+
email?: string;
|
|
878
|
+
token?: string;
|
|
879
|
+
};
|
|
815
880
|
/** @returns {SendEmailOtpRequestSchema} */
|
|
816
881
|
declare function SendEmailOtpRequestSchema(): SendEmailOtpRequestSchema;
|
|
817
882
|
type SendEmailOtpRequestSchema = {
|
|
@@ -826,6 +891,15 @@ declare function SendEmailVerifyLinkSuccess(): SendEmailVerifyLinkSuccess;
|
|
|
826
891
|
type SendEmailVerifyLinkSuccess = {
|
|
827
892
|
verify_email_link?: boolean;
|
|
828
893
|
};
|
|
894
|
+
/** @returns {SendMobileForgotOtpRequestSchema} */
|
|
895
|
+
declare function SendMobileForgotOtpRequestSchema(): SendMobileForgotOtpRequestSchema;
|
|
896
|
+
type SendMobileForgotOtpRequestSchema = {
|
|
897
|
+
action?: string;
|
|
898
|
+
android_hash?: string;
|
|
899
|
+
country_code?: string;
|
|
900
|
+
mobile?: string;
|
|
901
|
+
token?: string;
|
|
902
|
+
};
|
|
829
903
|
/** @returns {SendMobileOtpRequestSchema} */
|
|
830
904
|
declare function SendMobileOtpRequestSchema(): SendMobileOtpRequestSchema;
|
|
831
905
|
type SendMobileOtpRequestSchema = {
|
|
@@ -952,6 +1026,12 @@ type UserSchema = {
|
|
|
952
1026
|
user_id?: string;
|
|
953
1027
|
username?: string;
|
|
954
1028
|
};
|
|
1029
|
+
/** @returns {VerifyEmailForgotOtpRequestSchema} */
|
|
1030
|
+
declare function VerifyEmailForgotOtpRequestSchema(): VerifyEmailForgotOtpRequestSchema;
|
|
1031
|
+
type VerifyEmailForgotOtpRequestSchema = {
|
|
1032
|
+
email?: string;
|
|
1033
|
+
otp?: string;
|
|
1034
|
+
};
|
|
955
1035
|
/** @returns {VerifyEmailOtpRequestSchema} */
|
|
956
1036
|
declare function VerifyEmailOtpRequestSchema(): VerifyEmailOtpRequestSchema;
|
|
957
1037
|
type VerifyEmailOtpRequestSchema = {
|
|
@@ -971,6 +1051,18 @@ declare function VerifyEmailSuccess(): VerifyEmailSuccess;
|
|
|
971
1051
|
type VerifyEmailSuccess = {
|
|
972
1052
|
message?: string;
|
|
973
1053
|
};
|
|
1054
|
+
/** @returns {VerifyForgotOtpSuccess} */
|
|
1055
|
+
declare function VerifyForgotOtpSuccess(): VerifyForgotOtpSuccess;
|
|
1056
|
+
type VerifyForgotOtpSuccess = {
|
|
1057
|
+
forgot_token?: string;
|
|
1058
|
+
success?: boolean;
|
|
1059
|
+
};
|
|
1060
|
+
/** @returns {VerifyMobileForgotOtpRequestSchema} */
|
|
1061
|
+
declare function VerifyMobileForgotOtpRequestSchema(): VerifyMobileForgotOtpRequestSchema;
|
|
1062
|
+
type VerifyMobileForgotOtpRequestSchema = {
|
|
1063
|
+
otp?: string;
|
|
1064
|
+
request_id?: string;
|
|
1065
|
+
};
|
|
974
1066
|
/** @returns {VerifyMobileOTPSuccess} */
|
|
975
1067
|
declare function VerifyMobileOTPSuccess(): VerifyMobileOTPSuccess;
|
|
976
1068
|
type VerifyMobileOTPSuccess = {
|