@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,30 @@
|
|
|
1
|
+
export = Common;
|
|
2
|
+
declare class Common {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} [arg.authorization] -
|
|
8
|
+
* @param {string} [arg.query] - Provide application name
|
|
9
|
+
* @summary: Search Application
|
|
10
|
+
* @description: Provide application name or domain url
|
|
11
|
+
*/
|
|
12
|
+
searchApplication({ authorization, query }?: {
|
|
13
|
+
authorization?: string;
|
|
14
|
+
query?: string;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} arg - Arg object.
|
|
18
|
+
* @param {string} [arg.locationType] - Provide location type to query on.
|
|
19
|
+
* Possible values : country, state, city
|
|
20
|
+
* @param {string} [arg.id] - Field is optional when location_type is
|
|
21
|
+
* country. If querying for state, provide id of country. If querying for
|
|
22
|
+
* city, provide id of state.
|
|
23
|
+
* @summary: Get countries, states, cities
|
|
24
|
+
* @description:
|
|
25
|
+
*/
|
|
26
|
+
getLocations({ locationType, id }?: {
|
|
27
|
+
locationType?: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
}): Promise<any>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const CommonValidator = require("../models/CommonValidator");
|
|
5
|
+
class Common {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {string} [arg.authorization] -
|
|
13
|
+
* @param {string} [arg.query] - Provide application name
|
|
14
|
+
* @summary: Search Application
|
|
15
|
+
* @description: Provide application name or domain url
|
|
16
|
+
*/
|
|
17
|
+
searchApplication({ authorization, query } = {}) {
|
|
18
|
+
const { error } = CommonValidator.searchApplication().validate(
|
|
19
|
+
{
|
|
20
|
+
authorization,
|
|
21
|
+
query,
|
|
22
|
+
},
|
|
23
|
+
{ abortEarly: false, allowUnknown: true }
|
|
24
|
+
);
|
|
25
|
+
if (error) {
|
|
26
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const query_params = {};
|
|
30
|
+
query_params["query"] = query;
|
|
31
|
+
|
|
32
|
+
const xHeaders = {};
|
|
33
|
+
xHeaders["authorization"] = authorization;
|
|
34
|
+
|
|
35
|
+
return PlatformAPIClient.execute(
|
|
36
|
+
this.config,
|
|
37
|
+
"get",
|
|
38
|
+
`/service/common/configuration/v1.0/application/search-application`,
|
|
39
|
+
query_params,
|
|
40
|
+
undefined,
|
|
41
|
+
xHeaders
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {Object} arg - Arg object.
|
|
47
|
+
* @param {string} [arg.locationType] - Provide location type to query on.
|
|
48
|
+
* Possible values : country, state, city
|
|
49
|
+
* @param {string} [arg.id] - Field is optional when location_type is
|
|
50
|
+
* country. If querying for state, provide id of country. If querying for
|
|
51
|
+
* city, provide id of state.
|
|
52
|
+
* @summary: Get countries, states, cities
|
|
53
|
+
* @description:
|
|
54
|
+
*/
|
|
55
|
+
getLocations({ locationType, id } = {}) {
|
|
56
|
+
const { error } = CommonValidator.getLocations().validate(
|
|
57
|
+
{
|
|
58
|
+
locationType,
|
|
59
|
+
id,
|
|
60
|
+
},
|
|
61
|
+
{ abortEarly: false, allowUnknown: true }
|
|
62
|
+
);
|
|
63
|
+
if (error) {
|
|
64
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const query_params = {};
|
|
68
|
+
query_params["location_type"] = locationType;
|
|
69
|
+
query_params["id"] = id;
|
|
70
|
+
|
|
71
|
+
const xHeaders = {};
|
|
72
|
+
|
|
73
|
+
return PlatformAPIClient.execute(
|
|
74
|
+
this.config,
|
|
75
|
+
"get",
|
|
76
|
+
`/service/common/configuration/v1.0/location`,
|
|
77
|
+
query_params,
|
|
78
|
+
undefined,
|
|
79
|
+
xHeaders
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = Common;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export = Communication;
|
|
2
|
+
declare class Communication {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {number} [arg.pageNo] -
|
|
8
|
+
* @param {number} [arg.pageSize] -
|
|
9
|
+
* @summary: Get system notifications
|
|
10
|
+
* @description: Get system notifications
|
|
11
|
+
*/
|
|
12
|
+
getSystemNotifications({ pageNo, pageSize }?: {
|
|
13
|
+
pageNo?: number;
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} arg - Arg object.
|
|
18
|
+
* @param {number} [arg.pageSize] -
|
|
19
|
+
* @summary: Get system notifications
|
|
20
|
+
* @description: Get system notifications
|
|
21
|
+
*/
|
|
22
|
+
getSystemNotificationsPaginator({ pageSize }?: {
|
|
23
|
+
pageSize?: number;
|
|
24
|
+
}): Paginator;
|
|
25
|
+
}
|
|
26
|
+
import Paginator = require("../../common/Paginator");
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const CommunicationValidator = require("../models/CommunicationValidator");
|
|
5
|
+
class Communication {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {number} [arg.pageNo] -
|
|
13
|
+
* @param {number} [arg.pageSize] -
|
|
14
|
+
* @summary: Get system notifications
|
|
15
|
+
* @description: Get system notifications
|
|
16
|
+
*/
|
|
17
|
+
getSystemNotifications({ pageNo, pageSize } = {}) {
|
|
18
|
+
const { error } = CommunicationValidator.getSystemNotifications().validate(
|
|
19
|
+
{
|
|
20
|
+
pageNo,
|
|
21
|
+
pageSize,
|
|
22
|
+
},
|
|
23
|
+
{ abortEarly: false, allowUnknown: true }
|
|
24
|
+
);
|
|
25
|
+
if (error) {
|
|
26
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const query_params = {};
|
|
30
|
+
query_params["page_no"] = pageNo;
|
|
31
|
+
query_params["page_size"] = pageSize;
|
|
32
|
+
|
|
33
|
+
const xHeaders = {};
|
|
34
|
+
|
|
35
|
+
return PlatformAPIClient.execute(
|
|
36
|
+
this.config,
|
|
37
|
+
"get",
|
|
38
|
+
`/service/platform/communication/v1.0/company/${this.config.companyId}/notification/system-notifications/`,
|
|
39
|
+
query_params,
|
|
40
|
+
undefined,
|
|
41
|
+
xHeaders
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {Object} arg - Arg object.
|
|
47
|
+
* @param {number} [arg.pageSize] -
|
|
48
|
+
* @summary: Get system notifications
|
|
49
|
+
* @description: Get system notifications
|
|
50
|
+
*/
|
|
51
|
+
getSystemNotificationsPaginator({ pageSize } = {}) {
|
|
52
|
+
const paginator = new Paginator();
|
|
53
|
+
const callback = async () => {
|
|
54
|
+
const pageId = paginator.nextId;
|
|
55
|
+
const pageNo = paginator.pageNo;
|
|
56
|
+
const pageType = "number";
|
|
57
|
+
const data = await this.getSystemNotifications({
|
|
58
|
+
pageNo: pageNo,
|
|
59
|
+
pageSize: pageSize,
|
|
60
|
+
});
|
|
61
|
+
paginator.setPaginator({
|
|
62
|
+
hasNext: data.page.has_next ? true : false,
|
|
63
|
+
nextId: data.page.next_id,
|
|
64
|
+
});
|
|
65
|
+
return data;
|
|
66
|
+
};
|
|
67
|
+
paginator.setCallback(callback);
|
|
68
|
+
return paginator;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = Communication;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export = CompanyProfile;
|
|
2
|
+
declare class CompanyProfile {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @summary: Get company profile
|
|
8
|
+
* @description: This API allows to view the company profile of the seller account.
|
|
9
|
+
*/
|
|
10
|
+
cbsOnboardGet({}?: any): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* @param {Object} arg - Arg object.
|
|
13
|
+
* @param {UpdateCompany} arg.body
|
|
14
|
+
* @summary: Edit company profile
|
|
15
|
+
* @description: This API allows to edit the company profile of the seller account.
|
|
16
|
+
*/
|
|
17
|
+
updateCompany({ body }?: {
|
|
18
|
+
body: any;
|
|
19
|
+
}): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* @param {Object} arg - Arg object.
|
|
22
|
+
* @summary: Get company metrics
|
|
23
|
+
* @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
|
+
*/
|
|
25
|
+
getCompanyMetrics({}?: any): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* @param {Object} arg - Arg object.
|
|
28
|
+
* @param {string} arg.brandId - Id of the brand to be viewed.
|
|
29
|
+
* @summary: Get a single brand.
|
|
30
|
+
* @description: This API helps to get data associated to a particular brand.
|
|
31
|
+
*/
|
|
32
|
+
getBrand({ brandId }?: {
|
|
33
|
+
brandId: string;
|
|
34
|
+
}): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* @param {Object} arg - Arg object.
|
|
37
|
+
* @param {string} arg.brandId - Id of the brand to be viewed.
|
|
38
|
+
* @param {CreateUpdateBrandRequestSerializer} arg.body
|
|
39
|
+
* @summary: Edit a brand.
|
|
40
|
+
* @description: This API allows to edit meta of a brand.
|
|
41
|
+
*/
|
|
42
|
+
editBrand({ brandId, body }?: {
|
|
43
|
+
brandId: string;
|
|
44
|
+
body: any;
|
|
45
|
+
}): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* @param {Object} arg - Arg object.
|
|
48
|
+
* @param {CreateUpdateBrandRequestSerializer} arg.body
|
|
49
|
+
* @summary: Create a Brand.
|
|
50
|
+
* @description: This API allows to create a brand associated to a company.
|
|
51
|
+
*/
|
|
52
|
+
createBrand({ body }?: {
|
|
53
|
+
body: any;
|
|
54
|
+
}): Promise<any>;
|
|
55
|
+
/**
|
|
56
|
+
* @param {Object} arg - Arg object.
|
|
57
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
58
|
+
* given set of results
|
|
59
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
60
|
+
* page. Default is 10.
|
|
61
|
+
* @param {string} [arg.q] - Search term for name.
|
|
62
|
+
* @summary: Get brands associated to a company
|
|
63
|
+
* @description: This API helps to get view brands associated to a particular company.
|
|
64
|
+
*/
|
|
65
|
+
getBrands({ pageNo, pageSize, q }?: {
|
|
66
|
+
pageNo?: number;
|
|
67
|
+
pageSize?: number;
|
|
68
|
+
q?: string;
|
|
69
|
+
}): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
73
|
+
* page. Default is 10.
|
|
74
|
+
* @param {string} [arg.q] - Search term for name.
|
|
75
|
+
* @summary: Get brands associated to a company
|
|
76
|
+
* @description: This API helps to get view brands associated to a particular company.
|
|
77
|
+
*/
|
|
78
|
+
getBrandsPaginator({ pageSize, q }?: {
|
|
79
|
+
pageSize?: number;
|
|
80
|
+
q?: string;
|
|
81
|
+
}): Paginator;
|
|
82
|
+
/**
|
|
83
|
+
* @param {Object} arg - Arg object.
|
|
84
|
+
* @param {CompanyBrandPostRequestSerializer} arg.body
|
|
85
|
+
* @summary: Create a company brand mapping.
|
|
86
|
+
* @description: This API allows to create a company brand mapping, for a already existing brand in the system.
|
|
87
|
+
*/
|
|
88
|
+
createCompanyBrandMapping({ body }?: {
|
|
89
|
+
body: any;
|
|
90
|
+
}): Promise<any>;
|
|
91
|
+
/**
|
|
92
|
+
* @param {Object} arg - Arg object.
|
|
93
|
+
* @param {string} [arg.storeType] - Helps to sort the location list on the
|
|
94
|
+
* basis of location type.
|
|
95
|
+
* @param {string} [arg.q] - Query that is to be searched.
|
|
96
|
+
* @param {string} [arg.stage] - To filter companies on basis of verified or
|
|
97
|
+
* unverified companies.
|
|
98
|
+
* @param {number} [arg.pageNo] - The page number to navigate through the
|
|
99
|
+
* given set of results
|
|
100
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
101
|
+
* page. Default is 10.
|
|
102
|
+
* @param {number[]} [arg.locationIds] - Helps to filter stores on the basis of uids.
|
|
103
|
+
* @summary: Get list of locations
|
|
104
|
+
* @description: This API allows to view all the locations associated to a company.
|
|
105
|
+
*/
|
|
106
|
+
getLocations({ storeType, q, stage, pageNo, pageSize, locationIds }?: {
|
|
107
|
+
storeType?: string;
|
|
108
|
+
q?: string;
|
|
109
|
+
stage?: string;
|
|
110
|
+
pageNo?: number;
|
|
111
|
+
pageSize?: number;
|
|
112
|
+
locationIds?: number[];
|
|
113
|
+
}): Promise<any>;
|
|
114
|
+
/**
|
|
115
|
+
* @param {Object} arg - Arg object.
|
|
116
|
+
* @param {string} [arg.storeType] - Helps to sort the location list on the
|
|
117
|
+
* basis of location type.
|
|
118
|
+
* @param {string} [arg.q] - Query that is to be searched.
|
|
119
|
+
* @param {string} [arg.stage] - To filter companies on basis of verified or
|
|
120
|
+
* unverified companies.
|
|
121
|
+
* @param {number} [arg.pageSize] - Number of items to retrieve in each
|
|
122
|
+
* page. Default is 10.
|
|
123
|
+
* @param {number[]} [arg.locationIds] - Helps to filter stores on the basis of uids.
|
|
124
|
+
* @summary: Get list of locations
|
|
125
|
+
* @description: This API allows to view all the locations associated to a company.
|
|
126
|
+
*/
|
|
127
|
+
getLocationsPaginator({ storeType, q, stage, pageSize, locationIds }?: {
|
|
128
|
+
storeType?: string;
|
|
129
|
+
q?: string;
|
|
130
|
+
stage?: string;
|
|
131
|
+
pageSize?: number;
|
|
132
|
+
locationIds?: number[];
|
|
133
|
+
}): Paginator;
|
|
134
|
+
/**
|
|
135
|
+
* @param {Object} arg - Arg object.
|
|
136
|
+
* @param {LocationSerializer} arg.body
|
|
137
|
+
* @summary: Create a location associated to a company.
|
|
138
|
+
* @description: This API allows to edit a location associated to a company.
|
|
139
|
+
*/
|
|
140
|
+
createLocation({ body }?: {
|
|
141
|
+
body: any;
|
|
142
|
+
}): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* @param {Object} arg - Arg object.
|
|
145
|
+
* @param {string} arg.locationId - Id of the location which you want to view.
|
|
146
|
+
* @summary: Get details of a specific location.
|
|
147
|
+
* @description: This API helps to get data associated to a specific location.
|
|
148
|
+
*/
|
|
149
|
+
getLocationDetail({ locationId }?: {
|
|
150
|
+
locationId: string;
|
|
151
|
+
}): Promise<any>;
|
|
152
|
+
/**
|
|
153
|
+
* @param {Object} arg - Arg object.
|
|
154
|
+
* @param {string} arg.locationId - Id of the location which you want to edit.
|
|
155
|
+
* @param {LocationSerializer} arg.body
|
|
156
|
+
* @summary: Edit a location asscoiated to a company.
|
|
157
|
+
* @description: This API allows to edit a location associated to a company.
|
|
158
|
+
*/
|
|
159
|
+
updateLocation({ locationId, body }?: {
|
|
160
|
+
locationId: string;
|
|
161
|
+
body: any;
|
|
162
|
+
}): Promise<any>;
|
|
163
|
+
/**
|
|
164
|
+
* @param {Object} arg - Arg object.
|
|
165
|
+
* @param {BulkLocationSerializer} arg.body
|
|
166
|
+
* @summary: Create a location asscoiated to a company in bulk.
|
|
167
|
+
* @description: This API allows to create a location associated to a company.
|
|
168
|
+
*/
|
|
169
|
+
createLocationBulk({ body }?: {
|
|
170
|
+
body: any;
|
|
171
|
+
}): Promise<any>;
|
|
172
|
+
/**
|
|
173
|
+
* @param {Object} arg - Arg object.
|
|
174
|
+
* @param {AssignStoreRequestValidator} arg.body
|
|
175
|
+
* @summary: Location Reassignment
|
|
176
|
+
* @description:
|
|
177
|
+
*/
|
|
178
|
+
getOptimalLocations({ body }?: {
|
|
179
|
+
body: any;
|
|
180
|
+
}): Promise<any>;
|
|
181
|
+
}
|
|
182
|
+
import Paginator = require("../../common/Paginator");
|