@gofynd/fdk-client-javascript 1.0.1 → 1.0.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.
Files changed (134) hide show
  1. package/documentation/application/CART.md +251 -251
  2. package/documentation/application/CATALOG.md +414 -414
  3. package/documentation/application/CONTENT.md +15 -1
  4. package/documentation/application/ORDER.md +290 -290
  5. package/documentation/application/PAYMENT.md +255 -255
  6. package/documentation/application/POSCART.md +297 -297
  7. package/documentation/platform/CART.md +499 -499
  8. package/documentation/platform/CATALOG.md +3088 -2702
  9. package/documentation/platform/COMPANYPROFILE.md +201 -201
  10. package/documentation/platform/CONTENT.md +123 -1
  11. package/documentation/platform/ORDER.md +1233 -1158
  12. package/documentation/platform/PARTNER.md +7 -7
  13. package/documentation/platform/PAYMENT.md +83 -83
  14. package/package.json +1 -1
  15. package/sdk/application/ApplicationConfig.js +1 -1
  16. package/sdk/application/Cart/CartApplicationClient.js +619 -108
  17. package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
  18. package/sdk/application/Cart/CartApplicationModel.js +335 -335
  19. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
  20. package/sdk/application/Catalog/CatalogApplicationClient.js +730 -134
  21. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +21 -21
  22. package/sdk/application/Catalog/CatalogApplicationModel.js +547 -547
  23. package/sdk/application/Common/CommonApplicationClient.js +48 -8
  24. package/sdk/application/Communication/CommunicationApplicationClient.js +75 -14
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +392 -66
  27. package/sdk/application/Content/ContentApplicationClient.js +444 -76
  28. package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
  29. package/sdk/application/Content/ContentApplicationModel.js +11 -1
  30. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -12
  31. package/sdk/application/Lead/LeadApplicationClient.js +164 -30
  32. package/sdk/application/Logistic/LogisticApplicationClient.js +98 -16
  33. package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
  34. package/sdk/application/Order/OrderApplicationClient.js +287 -54
  35. package/sdk/application/Order/OrderApplicationModel.d.ts +19 -19
  36. package/sdk/application/Order/OrderApplicationModel.js +357 -357
  37. package/sdk/application/Payment/PaymentApplicationClient.js +961 -186
  38. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3 -3
  39. package/sdk/application/Payment/PaymentApplicationModel.js +352 -352
  40. package/sdk/application/PosCart/PosCartApplicationClient.js +645 -114
  41. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
  42. package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
  43. package/sdk/application/Rewards/RewardsApplicationClient.js +168 -28
  44. package/sdk/application/Share/ShareApplicationClient.js +157 -32
  45. package/sdk/application/Theme/ThemeApplicationClient.js +94 -16
  46. package/sdk/application/User/UserApplicationClient.js +806 -148
  47. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
  48. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +191 -34
  49. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
  50. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
  51. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  52. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +103 -16
  53. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
  54. package/sdk/platform/Billing/BillingPlatformClient.js +299 -54
  55. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
  56. package/sdk/platform/Cart/CartPlatformApplicationClient.js +409 -72
  57. package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
  58. package/sdk/platform/Cart/CartPlatformModel.js +617 -617
  59. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +167 -114
  60. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1562 -453
  61. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +8 -8
  62. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +39 -39
  63. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +314 -196
  64. package/sdk/platform/Catalog/CatalogPlatformClient.js +2459 -718
  65. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +103 -94
  66. package/sdk/platform/Catalog/CatalogPlatformModel.js +2063 -1797
  67. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +17 -15
  68. package/sdk/platform/Catalog/CatalogPlatformValidator.js +95 -76
  69. package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
  70. package/sdk/platform/Common/CommonPlatformClient.js +51 -8
  71. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
  72. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1000 -168
  73. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  74. package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
  75. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
  76. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +335 -54
  77. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +10 -10
  78. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +278 -278
  79. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
  80. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +702 -118
  81. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  82. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +457 -82
  83. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
  84. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1724 -284
  85. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
  86. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
  87. package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
  88. package/sdk/platform/Content/ContentPlatformModel.js +43 -1
  89. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
  90. package/sdk/platform/Discount/DiscountPlatformClient.js +270 -44
  91. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
  92. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +102 -16
  93. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
  94. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +150 -24
  95. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
  96. package/sdk/platform/Inventory/InventoryPlatformClient.js +316 -52
  97. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
  98. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +311 -52
  99. package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
  100. package/sdk/platform/Lead/LeadPlatformClient.js +266 -44
  101. package/sdk/platform/OAuthClient.js +8 -8
  102. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
  103. package/sdk/platform/Order/OrderPlatformApplicationClient.js +78 -14
  104. package/sdk/platform/Order/OrderPlatformClient.d.ts +95 -43
  105. package/sdk/platform/Order/OrderPlatformClient.js +1062 -180
  106. package/sdk/platform/Order/OrderPlatformModel.d.ts +64 -60
  107. package/sdk/platform/Order/OrderPlatformModel.js +1481 -1425
  108. package/sdk/platform/Order/OrderPlatformValidator.js +5 -0
  109. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
  110. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
  111. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
  112. package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
  113. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
  114. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +287 -56
  115. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
  116. package/sdk/platform/Payment/PaymentPlatformClient.js +263 -48
  117. package/sdk/platform/Payment/PaymentPlatformModel.js +122 -122
  118. package/sdk/platform/PlatformApplicationClient.d.ts +2959 -2787
  119. package/sdk/platform/PlatformApplicationClient.js +3420 -3212
  120. package/sdk/platform/PlatformClient.d.ts +2959 -2787
  121. package/sdk/platform/PlatformClient.js +3420 -3212
  122. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
  123. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +308 -54
  124. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
  125. package/sdk/platform/Share/SharePlatformApplicationClient.js +94 -16
  126. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
  127. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +571 -96
  128. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
  129. package/sdk/platform/User/UserPlatformApplicationClient.js +296 -48
  130. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
  131. package/sdk/platform/Webhook/WebhookPlatformClient.js +157 -30
  132. package/sdk/public/Configuration/ConfigurationPublicClient.js +51 -8
  133. package/sdk/public/Inventory/InventoryPublicClient.js +149 -26
  134. package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
@@ -6,13 +6,14 @@ declare class Communication {
6
6
  * @param {Object} arg - Arg object.
7
7
  * @param {number} [arg.pageNo] -
8
8
  * @param {number} [arg.pageSize] -
9
+ * @returns {Promise<SystemNotifications>} - Success response
9
10
  * @summary: Get system notifications
10
11
  * @description: Get system notifications
11
12
  */
12
13
  getSystemNotifications({ pageNo, pageSize }?: {
13
14
  pageNo?: number;
14
15
  pageSize?: number;
15
- }): Promise<any>;
16
+ }): Promise<SystemNotifications>;
16
17
  /**
17
18
  * @param {Object} arg - Arg object.
18
19
  * @param {number} [arg.pageSize] -
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const PlatformAPIClient = require("../PlatformAPIClient");
4
4
  const CommunicationValidator = require("./CommunicationPlatformValidator");
5
+ const CommunicationModel = require("./CommunicationPlatformModel");
6
+ const { Logger } = require("./../../common/Logger");
7
+
5
8
  class Communication {
6
9
  constructor(config) {
7
10
  this.config = config;
@@ -11,10 +14,11 @@ class Communication {
11
14
  * @param {Object} arg - Arg object.
12
15
  * @param {number} [arg.pageNo] -
13
16
  * @param {number} [arg.pageSize] -
17
+ * @returns {Promise<SystemNotifications>} - Success response
14
18
  * @summary: Get system notifications
15
19
  * @description: Get system notifications
16
20
  */
17
- getSystemNotifications({ pageNo, pageSize } = {}) {
21
+ async getSystemNotifications({ pageNo, pageSize } = {}) {
18
22
  const { error } = CommunicationValidator.getSystemNotifications().validate(
19
23
  {
20
24
  pageNo,
@@ -37,8 +41,11 @@ class Communication {
37
41
  { abortEarly: false, allowUnknown: false }
38
42
  );
39
43
  if (warrning) {
40
- console.log("Parameter Validation warrnings for getSystemNotifications");
41
- console.log(warrning);
44
+ Logger({
45
+ level: "WARN",
46
+ message: "Parameter Validation warrnings for getSystemNotifications",
47
+ });
48
+ Logger({ level: "WARN", message: warrning });
42
49
  }
43
50
 
44
51
  const query_params = {};
@@ -47,7 +54,7 @@ class Communication {
47
54
 
48
55
  const xHeaders = {};
49
56
 
50
- return PlatformAPIClient.execute(
57
+ const response = await PlatformAPIClient.execute(
51
58
  this.config,
52
59
  "get",
53
60
  `/service/platform/communication/v1.0/company/${this.config.companyId}/notification/system-notifications/`,
@@ -55,6 +62,23 @@ class Communication {
55
62
  undefined,
56
63
  xHeaders
57
64
  );
65
+
66
+ const {
67
+ error: res_error,
68
+ } = CommunicationModel.SystemNotifications().validate(response, {
69
+ abortEarly: false,
70
+ allowUnknown: false,
71
+ });
72
+
73
+ if (res_error) {
74
+ Logger({
75
+ level: "WARN",
76
+ message: "Response Validation Warnnings for getSystemNotifications",
77
+ });
78
+ Logger({ level: "WARN", message: res_error });
79
+ }
80
+
81
+ return response;
58
82
  }
59
83
 
60
84
  /**
@@ -4,54 +4,60 @@ declare class CompanyProfile {
4
4
  config: any;
5
5
  /**
6
6
  * @param {Object} arg - Arg object.
7
+ * @returns {Promise<GetCompanyProfileSerializerResponse>} - Success response
7
8
  * @summary: Get company profile
8
9
  * @description: This API allows to view the company profile of the seller account.
9
10
  */
10
- cbsOnboardGet({}?: any): Promise<any>;
11
+ cbsOnboardGet({}?: any): Promise<GetCompanyProfileSerializerResponse>;
11
12
  /**
12
13
  * @param {Object} arg - Arg object.
13
14
  * @param {UpdateCompany} arg.body
15
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
14
16
  * @summary: Edit company profile
15
17
  * @description: This API allows to edit the company profile of the seller account.
16
18
  */
17
19
  updateCompany({ body }?: {
18
20
  body: UpdateCompany;
19
- }): Promise<any>;
21
+ }): Promise<ProfileSuccessResponse>;
20
22
  /**
21
23
  * @param {Object} arg - Arg object.
24
+ * @returns {Promise<MetricsSerializer>} - Success response
22
25
  * @summary: Get company metrics
23
26
  * @description: This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified.
24
27
  */
25
- getCompanyMetrics({}?: any): Promise<any>;
28
+ getCompanyMetrics({}?: any): Promise<MetricsSerializer>;
26
29
  /**
27
30
  * @param {Object} arg - Arg object.
28
31
  * @param {string} arg.brandId - Id of the brand to be viewed.
32
+ * @returns {Promise<GetBrandResponseSerializer>} - Success response
29
33
  * @summary: Get a single brand.
30
34
  * @description: This API helps to get data associated to a particular brand.
31
35
  */
32
36
  getBrand({ brandId }?: {
33
37
  brandId: string;
34
- }): Promise<any>;
38
+ }): Promise<GetBrandResponseSerializer>;
35
39
  /**
36
40
  * @param {Object} arg - Arg object.
37
41
  * @param {string} arg.brandId - Id of the brand to be viewed.
38
42
  * @param {CreateUpdateBrandRequestSerializer} arg.body
43
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
39
44
  * @summary: Edit a brand.
40
45
  * @description: This API allows to edit meta of a brand.
41
46
  */
42
47
  editBrand({ brandId, body }?: {
43
48
  brandId: string;
44
49
  body: CreateUpdateBrandRequestSerializer;
45
- }): Promise<any>;
50
+ }): Promise<ProfileSuccessResponse>;
46
51
  /**
47
52
  * @param {Object} arg - Arg object.
48
53
  * @param {CreateUpdateBrandRequestSerializer} arg.body
54
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
49
55
  * @summary: Create a Brand.
50
56
  * @description: This API allows to create a brand associated to a company.
51
57
  */
52
58
  createBrand({ body }?: {
53
59
  body: CreateUpdateBrandRequestSerializer;
54
- }): Promise<any>;
60
+ }): Promise<ProfileSuccessResponse>;
55
61
  /**
56
62
  * @param {Object} arg - Arg object.
57
63
  * @param {number} [arg.pageNo] - The page number to navigate through the
@@ -59,6 +65,7 @@ declare class CompanyProfile {
59
65
  * @param {number} [arg.pageSize] - Number of items to retrieve in each
60
66
  * page. Default is 10.
61
67
  * @param {string} [arg.q] - Search term for name.
68
+ * @returns {Promise<CompanyBrandListSerializer>} - Success response
62
69
  * @summary: Get brands associated to a company
63
70
  * @description: This API helps to get view brands associated to a particular company.
64
71
  */
@@ -66,7 +73,7 @@ declare class CompanyProfile {
66
73
  pageNo?: number;
67
74
  pageSize?: number;
68
75
  q?: string;
69
- }): Promise<any>;
76
+ }): Promise<CompanyBrandListSerializer>;
70
77
  /**
71
78
  * @param {Object} arg - Arg object.
72
79
  * @param {number} [arg.pageSize] - Number of items to retrieve in each
@@ -82,12 +89,13 @@ declare class CompanyProfile {
82
89
  /**
83
90
  * @param {Object} arg - Arg object.
84
91
  * @param {CompanyBrandPostRequestSerializer} arg.body
92
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
85
93
  * @summary: Create a company brand mapping.
86
94
  * @description: This API allows to create a company brand mapping, for a already existing brand in the system.
87
95
  */
88
96
  createCompanyBrandMapping({ body }?: {
89
97
  body: CompanyBrandPostRequestSerializer;
90
- }): Promise<any>;
98
+ }): Promise<ProfileSuccessResponse>;
91
99
  /**
92
100
  * @param {Object} arg - Arg object.
93
101
  * @param {string} [arg.storeType] - Helps to sort the location list on the
@@ -100,17 +108,18 @@ declare class CompanyProfile {
100
108
  * @param {number} [arg.pageSize] - Number of items to retrieve in each
101
109
  * page. Default is 10.
102
110
  * @param {number[]} [arg.locationIds] - Helps to filter stores on the basis of uids.
111
+ * @returns {Promise<LocationListSerializer>} - Success response
103
112
  * @summary: Get list of locations
104
113
  * @description: This API allows to view all the locations associated to a company.
105
114
  */
106
- getLocations({ storeType, q, stage, pageNo, pageSize, locationIds }?: {
115
+ getLocations({ storeType, q, stage, pageNo, pageSize, locationIds, }?: {
107
116
  storeType?: string;
108
117
  q?: string;
109
118
  stage?: string;
110
119
  pageNo?: number;
111
120
  pageSize?: number;
112
121
  locationIds?: number[];
113
- }): Promise<any>;
122
+ }): Promise<LocationListSerializer>;
114
123
  /**
115
124
  * @param {Object} arg - Arg object.
116
125
  * @param {string} [arg.storeType] - Helps to sort the location list on the
@@ -134,40 +143,44 @@ declare class CompanyProfile {
134
143
  /**
135
144
  * @param {Object} arg - Arg object.
136
145
  * @param {LocationSerializer} arg.body
146
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
137
147
  * @summary: Create a location associated to a company.
138
148
  * @description: This API allows to edit a location associated to a company.
139
149
  */
140
150
  createLocation({ body }?: {
141
151
  body: LocationSerializer;
142
- }): Promise<any>;
152
+ }): Promise<ProfileSuccessResponse>;
143
153
  /**
144
154
  * @param {Object} arg - Arg object.
145
155
  * @param {string} arg.locationId - Id of the location which you want to view.
156
+ * @returns {Promise<GetLocationSerializer>} - Success response
146
157
  * @summary: Get details of a specific location.
147
158
  * @description: This API helps to get data associated to a specific location.
148
159
  */
149
160
  getLocationDetail({ locationId }?: {
150
161
  locationId: string;
151
- }): Promise<any>;
162
+ }): Promise<GetLocationSerializer>;
152
163
  /**
153
164
  * @param {Object} arg - Arg object.
154
165
  * @param {string} arg.locationId - Id of the location which you want to edit.
155
166
  * @param {LocationSerializer} arg.body
167
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
156
168
  * @summary: Edit a location asscoiated to a company.
157
169
  * @description: This API allows to edit a location associated to a company.
158
170
  */
159
171
  updateLocation({ locationId, body }?: {
160
172
  locationId: string;
161
173
  body: LocationSerializer;
162
- }): Promise<any>;
174
+ }): Promise<ProfileSuccessResponse>;
163
175
  /**
164
176
  * @param {Object} arg - Arg object.
165
177
  * @param {BulkLocationSerializer} arg.body
178
+ * @returns {Promise<ProfileSuccessResponse>} - Success response
166
179
  * @summary: Create a location asscoiated to a company in bulk.
167
180
  * @description: This API allows to create a location associated to a company.
168
181
  */
169
182
  createLocationBulk({ body }?: {
170
183
  body: BulkLocationSerializer;
171
- }): Promise<any>;
184
+ }): Promise<ProfileSuccessResponse>;
172
185
  }
173
186
  import Paginator = require("../../common/Paginator");