@gofynd/fdk-client-javascript 0.1.35
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/.github/workflows/on_create_release.yml +23 -0
- package/.github/workflows/on_merge_main.yml +38 -0
- package/.github/workflows/on_pull_request.yml +35 -0
- package/.prettierrc +5 -0
- package/LICENSE +21 -0
- package/README.md +118 -0
- package/application.d.ts +3 -0
- package/application.js +6 -0
- package/common.d.ts +4 -0
- package/common.js +9 -0
- package/documentation/application/CART.md +7290 -0
- package/documentation/application/CATALOG.md +9570 -0
- package/documentation/application/COMMON.md +448 -0
- package/documentation/application/COMMUNICATION.md +463 -0
- package/documentation/application/CONFIGURATION.md +2902 -0
- package/documentation/application/CONTENT.md +3350 -0
- package/documentation/application/FILESTORAGE.md +491 -0
- package/documentation/application/LEAD.md +1891 -0
- package/documentation/application/LOGISTIC.md +439 -0
- package/documentation/application/ORDER.md +3428 -0
- package/documentation/application/PAYMENT.md +5035 -0
- package/documentation/application/POSCART.md +7889 -0
- package/documentation/application/README.md +21 -0
- package/documentation/application/REWARDS.md +714 -0
- package/documentation/application/SHARE.md +729 -0
- package/documentation/application/THEME.md +5796 -0
- package/documentation/application/USER.md +4326 -0
- package/documentation/platform/ANALYTICS.md +1150 -0
- package/documentation/platform/AUDITTRAIL.md +572 -0
- package/documentation/platform/BILLING.md +2396 -0
- package/documentation/platform/CART.md +5539 -0
- package/documentation/platform/CATALOG.md +21624 -0
- package/documentation/platform/COMMON.md +448 -0
- package/documentation/platform/COMMUNICATION.md +5714 -0
- package/documentation/platform/COMPANYPROFILE.md +2141 -0
- package/documentation/platform/CONFIGURATION.md +7335 -0
- package/documentation/platform/CONTENT.md +8989 -0
- package/documentation/platform/DISCOUNT.md +773 -0
- package/documentation/platform/FILESTORAGE.md +994 -0
- package/documentation/platform/INVENTORY.md +1775 -0
- package/documentation/platform/LEAD.md +4736 -0
- package/documentation/platform/ORDER.md +3764 -0
- package/documentation/platform/PARTNER.md +216 -0
- package/documentation/platform/PAYMENT.md +3444 -0
- package/documentation/platform/README.md +27 -0
- package/documentation/platform/REWARDS.md +871 -0
- package/documentation/platform/SHARE.md +602 -0
- package/documentation/platform/THEME.md +35725 -0
- package/documentation/platform/USER.md +2305 -0
- package/documentation/platform/WEBHOOK.md +587 -0
- package/documentation/public/CONFIGURATION.md +448 -0
- package/documentation/public/INVENTORY.md +686 -0
- package/documentation/public/WEBHOOK.md +348 -0
- package/index.d.ts +10 -0
- package/index.js +18 -0
- package/jest.config.d.ts +4 -0
- package/jest.config.js +6 -0
- package/package.json +35 -0
- package/platform.d.ts +3 -0
- package/platform.js +6 -0
- package/public.d.ts +3 -0
- package/public.js +6 -0
- package/sdk/application/ApplicationAPIClient.d.ts +11 -0
- package/sdk/application/ApplicationAPIClient.js +44 -0
- package/sdk/application/ApplicationClient.d.ts +40 -0
- package/sdk/application/ApplicationClient.js +84 -0
- package/sdk/application/ApplicationConfig.d.ts +19 -0
- package/sdk/application/ApplicationConfig.js +55 -0
- package/sdk/application/ApplicationModels.d.ts +826 -0
- package/sdk/application/ApplicationModels.js +10474 -0
- package/sdk/application/client/CartApplicationClient.d.ts +432 -0
- package/sdk/application/client/CartApplicationClient.js +1066 -0
- package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
- package/sdk/application/client/CatalogApplicationClient.js +1629 -0
- package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
- package/sdk/application/client/CommonApplicationClient.js +105 -0
- package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
- package/sdk/application/client/CommunicationApplicationClient.js +131 -0
- package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
- package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
- package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
- package/sdk/application/client/ContentApplicationClient.js +785 -0
- package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
- package/sdk/application/client/FileStorageApplicationClient.js +214 -0
- package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
- package/sdk/application/client/LeadApplicationClient.js +264 -0
- package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
- package/sdk/application/client/LogisticApplicationClient.js +128 -0
- package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
- package/sdk/application/client/OrderApplicationClient.js +479 -0
- package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
- package/sdk/application/client/PaymentApplicationClient.js +1378 -0
- package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
- package/sdk/application/client/PosCartApplicationClient.js +1123 -0
- package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
- package/sdk/application/client/RewardsApplicationClient.js +293 -0
- package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
- package/sdk/application/client/ShareApplicationClient.js +268 -0
- package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
- package/sdk/application/client/ThemeApplicationClient.js +161 -0
- package/sdk/application/client/UserApplicationClient.d.ts +446 -0
- package/sdk/application/client/UserApplicationClient.js +1275 -0
- package/sdk/application/constructUrl.d.ts +5 -0
- package/sdk/application/constructUrl.js +13 -0
- package/sdk/application/index.d.ts +2 -0
- package/sdk/application/index.js +4 -0
- package/sdk/application/models/CartValidator.d.ts +29 -0
- package/sdk/application/models/CartValidator.js +223 -0
- package/sdk/application/models/CatalogValidator.d.ts +33 -0
- package/sdk/application/models/CatalogValidator.js +233 -0
- package/sdk/application/models/CommonValidator.d.ts +5 -0
- package/sdk/application/models/CommonValidator.js +18 -0
- package/sdk/application/models/CommunicationValidator.d.ts +6 -0
- package/sdk/application/models/CommunicationValidator.js +20 -0
- package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
- package/sdk/application/models/ConfigurationValidator.js +88 -0
- package/sdk/application/models/ContentValidator.d.ts +22 -0
- package/sdk/application/models/ContentValidator.js +106 -0
- package/sdk/application/models/FileStorageValidator.d.ts +6 -0
- package/sdk/application/models/FileStorageValidator.js +24 -0
- package/sdk/application/models/LeadValidator.d.ts +10 -0
- package/sdk/application/models/LeadValidator.js +48 -0
- package/sdk/application/models/LogisticValidator.d.ts +6 -0
- package/sdk/application/models/LogisticValidator.js +22 -0
- package/sdk/application/models/OrderValidator.d.ts +15 -0
- package/sdk/application/models/OrderValidator.js +87 -0
- package/sdk/application/models/PaymentValidator.d.ts +40 -0
- package/sdk/application/models/PaymentValidator.js +235 -0
- package/sdk/application/models/PosCartValidator.d.ts +30 -0
- package/sdk/application/models/PosCartValidator.js +232 -0
- package/sdk/application/models/RewardsValidator.d.ts +10 -0
- package/sdk/application/models/RewardsValidator.js +43 -0
- package/sdk/application/models/ShareValidator.d.ts +10 -0
- package/sdk/application/models/ShareValidator.js +44 -0
- package/sdk/application/models/ThemeValidator.d.ts +7 -0
- package/sdk/application/models/ThemeValidator.js +27 -0
- package/sdk/application/models/UserValidator.d.ts +38 -0
- package/sdk/application/models/UserValidator.js +233 -0
- package/sdk/common/AxiosHelper.d.ts +1 -0
- package/sdk/common/AxiosHelper.js +141 -0
- package/sdk/common/Constant.d.ts +294 -0
- package/sdk/common/Constant.js +332 -0
- package/sdk/common/FDKError.d.ts +26 -0
- package/sdk/common/FDKError.js +51 -0
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +85 -0
- package/sdk/common/Paginator.d.ts +16 -0
- package/sdk/common/Paginator.js +26 -0
- package/sdk/common/RequestSigner.d.ts +1 -0
- package/sdk/common/RequestSigner.js +306 -0
- package/sdk/common/Utility.d.ts +9 -0
- package/sdk/common/Utility.js +86 -0
- package/sdk/common/utils.d.ts +14 -0
- package/sdk/common/utils.js +165 -0
- package/sdk/platform/OAuthClient.d.ts +26 -0
- package/sdk/platform/OAuthClient.js +221 -0
- package/sdk/platform/PlatformAPIClient.d.ts +12 -0
- package/sdk/platform/PlatformAPIClient.js +43 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
- package/sdk/platform/PlatformApplicationClient.js +23185 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
- package/sdk/platform/PlatformApplicationModels.js +21262 -0
- package/sdk/platform/PlatformClient.d.ts +9535 -0
- package/sdk/platform/PlatformClient.js +12336 -0
- package/sdk/platform/PlatformConfig.d.ts +29 -0
- package/sdk/platform/PlatformConfig.js +36 -0
- package/sdk/platform/PlatformModels.d.ts +1396 -0
- package/sdk/platform/PlatformModels.js +19222 -0
- package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
- package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
- package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
- package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
- package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
- package/sdk/platform/client/BillingPlatformClient.js +381 -0
- package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
- package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
- package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
- package/sdk/platform/client/CommonPlatformClient.js +84 -0
- package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
- package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
- package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
- package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
- package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
- package/sdk/platform/client/DiscountPlatformClient.js +364 -0
- package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
- package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
- package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
- package/sdk/platform/client/InventoryPlatformClient.js +409 -0
- package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
- package/sdk/platform/client/LeadPlatformClient.js +439 -0
- package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
- package/sdk/platform/client/OrderPlatformClient.js +521 -0
- package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
- package/sdk/platform/client/PaymentPlatformClient.js +331 -0
- package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
- package/sdk/platform/client/WebhookPlatformClient.js +207 -0
- package/sdk/platform/index.d.ts +2 -0
- package/sdk/platform/index.js +4 -0
- package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
- package/sdk/platform/models/AnalyticsValidator.js +36 -0
- package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
- package/sdk/platform/models/AuditTrailValidator.js +26 -0
- package/sdk/platform/models/BillingValidator.d.ts +15 -0
- package/sdk/platform/models/BillingValidator.js +72 -0
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/CatalogValidator.d.ts +74 -0
- package/sdk/platform/models/CatalogValidator.js +484 -0
- package/sdk/platform/models/CommonValidator.d.ts +5 -0
- package/sdk/platform/models/CommonValidator.js +18 -0
- package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
- package/sdk/platform/models/CommunicationValidator.js +11 -0
- package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
- package/sdk/platform/models/CompanyProfileValidator.js +93 -0
- package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
- package/sdk/platform/models/ConfigurationValidator.js +134 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/DiscountValidator.d.ts +13 -0
- package/sdk/platform/models/DiscountValidator.js +75 -0
- package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
- package/sdk/platform/models/FileStorageValidator.js +44 -0
- package/sdk/platform/models/InventoryValidator.d.ts +15 -0
- package/sdk/platform/models/InventoryValidator.js +81 -0
- package/sdk/platform/models/LeadValidator.d.ts +14 -0
- package/sdk/platform/models/LeadValidator.js +78 -0
- package/sdk/platform/models/OrderValidator.d.ts +14 -0
- package/sdk/platform/models/OrderValidator.js +110 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/PaymentValidator.d.ts +13 -0
- package/sdk/platform/models/PaymentValidator.js +65 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/platform/models/WebhookValidator.d.ts +9 -0
- package/sdk/platform/models/WebhookValidator.js +42 -0
- package/sdk/public/PublicAPIClient.d.ts +11 -0
- package/sdk/public/PublicAPIClient.js +38 -0
- package/sdk/public/PublicClient.d.ts +12 -0
- package/sdk/public/PublicClient.js +24 -0
- package/sdk/public/PublicConfig.d.ts +10 -0
- package/sdk/public/PublicConfig.js +12 -0
- package/sdk/public/PublicModels.d.ts +50 -0
- package/sdk/public/PublicModels.js +712 -0
- package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
- package/sdk/public/client/ConfigurationPublicClient.js +102 -0
- package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
- package/sdk/public/client/InventoryPublicClient.js +239 -0
- package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
- package/sdk/public/client/WebhookPublicClient.js +92 -0
- package/sdk/public/constructUrl.d.ts +5 -0
- package/sdk/public/constructUrl.js +13 -0
- package/sdk/public/index.d.ts +2 -0
- package/sdk/public/index.js +4 -0
- package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
- package/sdk/public/models/ConfigurationValidator.js +18 -0
- package/sdk/public/models/InventoryValidator.d.ts +9 -0
- package/sdk/public/models/InventoryValidator.js +43 -0
- package/sdk/public/models/WebhookValidator.d.ts +5 -0
- package/sdk/public/models/WebhookValidator.js +14 -0
- package/tests/application/catalog.spec.js +47 -0
- package/tests/common/action-url.spec.js +35 -0
- package/tests/common/schema/action-url.json +163 -0
- package/tests/common/schema/url-action.json +667 -0
- package/tests/common/url-action.spec.js +48 -0
- package/tests/helpers/cookie.helper.js +31 -0
- package/tests/helpers/oauth.helper.js +43 -0
- package/tests/platform/catalog.spec.js +49 -0
- package/tests/public/location.spec.js +39 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
const AVAILABLE_PAGE_TYPE = {
|
|
2
|
+
ABOUT_US: "about-us",
|
|
3
|
+
ADDRESSES: "addresses",
|
|
4
|
+
BLOG: "blog",
|
|
5
|
+
BRANDS: "brands",
|
|
6
|
+
CARDS: "cards",
|
|
7
|
+
CART: "cart",
|
|
8
|
+
CATEGORIES: "categories",
|
|
9
|
+
BRAND: "brand",
|
|
10
|
+
CATEGORY: "category",
|
|
11
|
+
COLLECTION: "collection",
|
|
12
|
+
COLLECTIONS: "collections",
|
|
13
|
+
CONTACT_US: "contact-us",
|
|
14
|
+
EXTERNAL: "external",
|
|
15
|
+
FAQ: "faq",
|
|
16
|
+
FRESHCHAT: "freshchat",
|
|
17
|
+
HOME: "home",
|
|
18
|
+
NOTIFICATION_SETTINGS: "notification-settings",
|
|
19
|
+
ORDERS: "orders",
|
|
20
|
+
PAGE: "page",
|
|
21
|
+
POLICY: "policy",
|
|
22
|
+
PRODUCT: "product",
|
|
23
|
+
PRODUCT_REVIEWS: "product-reviews",
|
|
24
|
+
ADD_PRODUCT_REVIEW: "add-product-review",
|
|
25
|
+
PRODUCT_REQUEST: "product-request",
|
|
26
|
+
PRODUCTS: "products",
|
|
27
|
+
PROFILE: "profile",
|
|
28
|
+
PROFILE_BASIC: "profile-basic",
|
|
29
|
+
PROFILE_COMPANY: "profile-company",
|
|
30
|
+
PROFILE_EMAILS: "profile-emails",
|
|
31
|
+
PROFILE_PHONES: "profile-phones",
|
|
32
|
+
RATE_US: "rate-us",
|
|
33
|
+
REFER_EARN: "refer-earn",
|
|
34
|
+
SETTINGS: "settings",
|
|
35
|
+
SHARED_CART: "shared-cart",
|
|
36
|
+
TNC: "tnc",
|
|
37
|
+
TRACK_ORDER: "track-order",
|
|
38
|
+
WISHLIST: "wishlist",
|
|
39
|
+
SECTIONS: "sections",
|
|
40
|
+
FORM: "form",
|
|
41
|
+
CART_DELIVERY: "cart-delivery",
|
|
42
|
+
CART_PAYMENT: "cart-payment",
|
|
43
|
+
CART_REVIEW: "cart-review",
|
|
44
|
+
LOGIN: "login",
|
|
45
|
+
REGISTER: "register",
|
|
46
|
+
SHIPPING_POLICY: "shipping-policy",
|
|
47
|
+
RETURN_POLICY: "return-policy",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Object.freeze(AVAILABLE_PAGE_TYPE);
|
|
51
|
+
|
|
52
|
+
const NAVIGATORS = {
|
|
53
|
+
"about-us": {
|
|
54
|
+
name: "About Us",
|
|
55
|
+
link: "/about-us",
|
|
56
|
+
},
|
|
57
|
+
addresses: {
|
|
58
|
+
name: "Saved Addresses",
|
|
59
|
+
link: "/profile/address",
|
|
60
|
+
},
|
|
61
|
+
blog: {
|
|
62
|
+
name: "Blog",
|
|
63
|
+
link: "/blog/:slug",
|
|
64
|
+
params: [
|
|
65
|
+
{
|
|
66
|
+
key: "slug",
|
|
67
|
+
required: false,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
brands: {
|
|
72
|
+
name: "Brands",
|
|
73
|
+
link: "/brands/:department",
|
|
74
|
+
params: [
|
|
75
|
+
{
|
|
76
|
+
key: "department",
|
|
77
|
+
required: false,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
cards: {
|
|
82
|
+
name: "Saved Cards",
|
|
83
|
+
link: "/profile/my-cards",
|
|
84
|
+
},
|
|
85
|
+
cart: {
|
|
86
|
+
name: "Cart",
|
|
87
|
+
link: "/cart/bag/",
|
|
88
|
+
},
|
|
89
|
+
categories: {
|
|
90
|
+
name: "Categories",
|
|
91
|
+
link: "/categories/:department",
|
|
92
|
+
params: [
|
|
93
|
+
{
|
|
94
|
+
key: "department",
|
|
95
|
+
required: false,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
brand: {
|
|
100
|
+
name: "Brand",
|
|
101
|
+
link: "/brand/:slug",
|
|
102
|
+
params: [
|
|
103
|
+
{
|
|
104
|
+
key: "slug",
|
|
105
|
+
required: true,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
category: {
|
|
110
|
+
name: "Category",
|
|
111
|
+
link: "/category/:slug",
|
|
112
|
+
params: [
|
|
113
|
+
{
|
|
114
|
+
key: "slug",
|
|
115
|
+
required: true,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
collection: {
|
|
120
|
+
name: "Collection",
|
|
121
|
+
link: "/collection/:slug",
|
|
122
|
+
params: [
|
|
123
|
+
{
|
|
124
|
+
key: "slug",
|
|
125
|
+
required: true,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
collections: {
|
|
130
|
+
name: "Collections",
|
|
131
|
+
link: "/collections/",
|
|
132
|
+
},
|
|
133
|
+
"contact-us": {
|
|
134
|
+
name: "Contact Us",
|
|
135
|
+
link: "/contact-us/",
|
|
136
|
+
},
|
|
137
|
+
external: {
|
|
138
|
+
name: "External Link",
|
|
139
|
+
link: "/external/",
|
|
140
|
+
query: [
|
|
141
|
+
{
|
|
142
|
+
key: "url",
|
|
143
|
+
required: true,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
faq: {
|
|
148
|
+
name: "FAQ",
|
|
149
|
+
link: "/faq",
|
|
150
|
+
},
|
|
151
|
+
freshchat: {
|
|
152
|
+
name: "Chat by Freshchat",
|
|
153
|
+
link: "/freshchat",
|
|
154
|
+
},
|
|
155
|
+
home: {
|
|
156
|
+
name: "Home",
|
|
157
|
+
link: "/",
|
|
158
|
+
},
|
|
159
|
+
"notification-settings": {
|
|
160
|
+
name: "Notification Settings",
|
|
161
|
+
link: "/notification-settings",
|
|
162
|
+
},
|
|
163
|
+
orders: {
|
|
164
|
+
name: "Orders",
|
|
165
|
+
link: "/profile/orders",
|
|
166
|
+
},
|
|
167
|
+
page: {
|
|
168
|
+
name: "Page",
|
|
169
|
+
link: "/page/:slug",
|
|
170
|
+
params: [
|
|
171
|
+
{
|
|
172
|
+
key: "slug",
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
policy: {
|
|
178
|
+
name: "Privacy Policy",
|
|
179
|
+
link: "/privacy-policy",
|
|
180
|
+
},
|
|
181
|
+
product: {
|
|
182
|
+
name: "Product",
|
|
183
|
+
link: "/product/:slug",
|
|
184
|
+
params: [
|
|
185
|
+
{
|
|
186
|
+
key: "slug",
|
|
187
|
+
required: true,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
"product-reviews": {
|
|
192
|
+
name: "Product Reviews",
|
|
193
|
+
link: "/product/:slug/reviews",
|
|
194
|
+
params: [
|
|
195
|
+
{
|
|
196
|
+
key: "slug",
|
|
197
|
+
required: true,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
"add-product-review": {
|
|
202
|
+
name: "Add Product review",
|
|
203
|
+
link: "/product/:slug/add-review",
|
|
204
|
+
params: [
|
|
205
|
+
{
|
|
206
|
+
key: "slug",
|
|
207
|
+
required: true,
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
"product-request": {
|
|
212
|
+
name: "Product Request",
|
|
213
|
+
link: "/product-request/",
|
|
214
|
+
},
|
|
215
|
+
products: {
|
|
216
|
+
name: "Products",
|
|
217
|
+
link: "/products/",
|
|
218
|
+
},
|
|
219
|
+
profile: {
|
|
220
|
+
name: "Profile",
|
|
221
|
+
link: "/profile",
|
|
222
|
+
},
|
|
223
|
+
"profile-basic": {
|
|
224
|
+
name: "Basic Profile",
|
|
225
|
+
link: "/profile/details",
|
|
226
|
+
},
|
|
227
|
+
"profile-company": {
|
|
228
|
+
name: "Profile Company",
|
|
229
|
+
link: "/profile/company",
|
|
230
|
+
},
|
|
231
|
+
"profile-emails": {
|
|
232
|
+
name: "Profile Emails",
|
|
233
|
+
link: "/profile/email",
|
|
234
|
+
},
|
|
235
|
+
"profile-phones": {
|
|
236
|
+
name: "Profile Phones",
|
|
237
|
+
link: "/profile/phone",
|
|
238
|
+
},
|
|
239
|
+
"rate-us": {
|
|
240
|
+
name: "Rate Us",
|
|
241
|
+
link: "/rate-us",
|
|
242
|
+
},
|
|
243
|
+
"refer-earn": {
|
|
244
|
+
name: "Refer & Earn",
|
|
245
|
+
link: "/profile/refer-earn",
|
|
246
|
+
},
|
|
247
|
+
settings: {
|
|
248
|
+
name: "Settings",
|
|
249
|
+
link: "/setting/currency",
|
|
250
|
+
},
|
|
251
|
+
"shared-cart": {
|
|
252
|
+
name: "Shared Cart",
|
|
253
|
+
link: "/shared-cart/:token",
|
|
254
|
+
params: [
|
|
255
|
+
{
|
|
256
|
+
key: "token",
|
|
257
|
+
required: true,
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
tnc: {
|
|
262
|
+
name: "Terms and Conditions",
|
|
263
|
+
link: "/terms-and-conditions",
|
|
264
|
+
},
|
|
265
|
+
"track-order": {
|
|
266
|
+
name: "Track Order",
|
|
267
|
+
link: "/order-tracking/:orderId",
|
|
268
|
+
params: [
|
|
269
|
+
{
|
|
270
|
+
key: "orderId",
|
|
271
|
+
required: false,
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
},
|
|
275
|
+
wishlist: {
|
|
276
|
+
name: "Wishlist",
|
|
277
|
+
link: "/wishlist/",
|
|
278
|
+
},
|
|
279
|
+
sections: {
|
|
280
|
+
name: "Sections",
|
|
281
|
+
link: "/sections/:group",
|
|
282
|
+
params: [
|
|
283
|
+
{
|
|
284
|
+
key: "group",
|
|
285
|
+
required: true,
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
},
|
|
289
|
+
form: {
|
|
290
|
+
name: "Form",
|
|
291
|
+
link: "/form/:slug",
|
|
292
|
+
params: [
|
|
293
|
+
{
|
|
294
|
+
key: "slug",
|
|
295
|
+
required: true,
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
"cart-delivery": {
|
|
300
|
+
name: "Cart Delivery",
|
|
301
|
+
link: "/cart/delivery",
|
|
302
|
+
},
|
|
303
|
+
"cart-payment": {
|
|
304
|
+
name: "Cart Payment Information",
|
|
305
|
+
link: "/cart/payment-info",
|
|
306
|
+
},
|
|
307
|
+
"cart-review": {
|
|
308
|
+
name: "Cart Order Review",
|
|
309
|
+
link: "/cart/order-review",
|
|
310
|
+
},
|
|
311
|
+
login: {
|
|
312
|
+
name: "Login",
|
|
313
|
+
link: "/auth/login",
|
|
314
|
+
},
|
|
315
|
+
register: {
|
|
316
|
+
name: "Register",
|
|
317
|
+
link: "/auth/register",
|
|
318
|
+
},
|
|
319
|
+
"shipping-policy": {
|
|
320
|
+
name: "Shipping policy",
|
|
321
|
+
link: "/shipping-policy",
|
|
322
|
+
},
|
|
323
|
+
"return-policy": {
|
|
324
|
+
name: "Return policy",
|
|
325
|
+
link: "/return-policy",
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
module.exports = {
|
|
330
|
+
AVAILABLE_PAGE_TYPE,
|
|
331
|
+
NAVIGATORS,
|
|
332
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export class FDKServerResponseError extends Error {
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} message
|
|
4
|
+
* @param {string} stackTrace
|
|
5
|
+
* @param {string} [status]
|
|
6
|
+
* @param {string} [code]
|
|
7
|
+
*/
|
|
8
|
+
constructor(message: string, stackTrace: string, status?: string, code?: string, details?: any);
|
|
9
|
+
stackTrace: string;
|
|
10
|
+
status: string;
|
|
11
|
+
code: string;
|
|
12
|
+
details: any;
|
|
13
|
+
}
|
|
14
|
+
export class FDKClientValidationError extends Error {
|
|
15
|
+
constructor(errObj: any);
|
|
16
|
+
details: any;
|
|
17
|
+
}
|
|
18
|
+
export class FDKInvalidCredentialError extends Error {
|
|
19
|
+
constructor(message: any);
|
|
20
|
+
}
|
|
21
|
+
export class FDKTokenIssueError extends Error {
|
|
22
|
+
constructor(message: any);
|
|
23
|
+
}
|
|
24
|
+
export class FDKOAuthCodeError extends Error {
|
|
25
|
+
constructor(message: any);
|
|
26
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
class FDKServerResponseError extends Error {
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} message
|
|
4
|
+
* @param {string} stackTrace
|
|
5
|
+
* @param {string} [status]
|
|
6
|
+
* @param {string} [code]
|
|
7
|
+
*/
|
|
8
|
+
constructor(message, stackTrace, status = null, code = null, details = null) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "FDKServerResponseError";
|
|
11
|
+
this.stackTrace = stackTrace;
|
|
12
|
+
this.status = status;
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.details = details;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class FDKClientValidationError extends Error {
|
|
19
|
+
constructor(errObj) {
|
|
20
|
+
super(errObj.message);
|
|
21
|
+
this.name = "FDKClientValidationError";
|
|
22
|
+
this.details = errObj.details;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class FDKInvalidCredentialError extends Error {
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "FDKInvalidCredentialError";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class FDKTokenIssueError extends Error {
|
|
33
|
+
constructor(message) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.name = "FDKTokenIssueError";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class FDKOAuthCodeError extends Error {
|
|
39
|
+
constructor(message) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.name = "FDKOAuthCodeError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
FDKServerResponseError,
|
|
47
|
+
FDKClientValidationError,
|
|
48
|
+
FDKInvalidCredentialError,
|
|
49
|
+
FDKTokenIssueError,
|
|
50
|
+
FDKOAuthCodeError,
|
|
51
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const log = require("loglevel");
|
|
2
|
+
const packageJSON = require("../../package.json");
|
|
3
|
+
|
|
4
|
+
const PACKAGE_VERSION = getPackageVersion();
|
|
5
|
+
|
|
6
|
+
function Logger(data) {
|
|
7
|
+
const { level, message, ...others } = data;
|
|
8
|
+
|
|
9
|
+
if (level === "TRACE") {
|
|
10
|
+
log.trace(
|
|
11
|
+
JSON.stringify({
|
|
12
|
+
level: level,
|
|
13
|
+
detail: message,
|
|
14
|
+
...others,
|
|
15
|
+
time: getDateTime(),
|
|
16
|
+
version: PACKAGE_VERSION,
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (level === "DEBUG") {
|
|
22
|
+
log.debug(
|
|
23
|
+
JSON.stringify({
|
|
24
|
+
level: level,
|
|
25
|
+
detail: message,
|
|
26
|
+
...others,
|
|
27
|
+
time: getDateTime(),
|
|
28
|
+
version: PACKAGE_VERSION,
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (level === "INFO") {
|
|
34
|
+
log.info(
|
|
35
|
+
JSON.stringify({
|
|
36
|
+
level: level,
|
|
37
|
+
detail: message,
|
|
38
|
+
...others,
|
|
39
|
+
time: getDateTime(),
|
|
40
|
+
version: PACKAGE_VERSION,
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (level === "WARN") {
|
|
46
|
+
log.warn(
|
|
47
|
+
JSON.stringify({
|
|
48
|
+
level: level,
|
|
49
|
+
detail: message,
|
|
50
|
+
...others,
|
|
51
|
+
time: getDateTime(),
|
|
52
|
+
version: PACKAGE_VERSION,
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (level === "ERROR") {
|
|
58
|
+
log.error(
|
|
59
|
+
JSON.stringify({
|
|
60
|
+
level: level,
|
|
61
|
+
detail: message,
|
|
62
|
+
...others,
|
|
63
|
+
time: getDateTime(),
|
|
64
|
+
version: PACKAGE_VERSION,
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function setLoggerLevel(level) {
|
|
71
|
+
log.setLevel(level);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getDateTime() {
|
|
75
|
+
return new Date().toString();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getPackageVersion() {
|
|
79
|
+
return packageJSON.version;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = {
|
|
83
|
+
Logger,
|
|
84
|
+
setLoggerLevel,
|
|
85
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export = Paginator;
|
|
2
|
+
declare class Paginator {
|
|
3
|
+
constructor(pageNo: any);
|
|
4
|
+
pageNo: any;
|
|
5
|
+
callback: any;
|
|
6
|
+
setCallback(callback: any): void;
|
|
7
|
+
hasNext(): any;
|
|
8
|
+
setPaginator({ hasNext, nextId, pageNo }: {
|
|
9
|
+
hasNext: any;
|
|
10
|
+
nextId?: any;
|
|
11
|
+
pageNo?: number;
|
|
12
|
+
}): void;
|
|
13
|
+
isNext: any;
|
|
14
|
+
nextId: any;
|
|
15
|
+
next(): any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
class Paginator {
|
|
2
|
+
constructor(pageNo) {
|
|
3
|
+
this.pageNo = pageNo;
|
|
4
|
+
this.callback = undefined;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
setCallback(callback) {
|
|
8
|
+
this.callback = callback;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
hasNext() {
|
|
12
|
+
return this.isNext;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
setPaginator({ hasNext, nextId = undefined, pageNo = 1 }) {
|
|
16
|
+
this.isNext = hasNext;
|
|
17
|
+
this.nextId = nextId;
|
|
18
|
+
this.pageNo = pageNo;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
next() {
|
|
22
|
+
return this.callback();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = Paginator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function sign(request: any): any;
|