@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,84 @@
|
|
|
1
|
+
export = Analytics;
|
|
2
|
+
declare class Analytics {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.exportType - Export type / format
|
|
8
|
+
* @param {ExportJobReq} arg.body
|
|
9
|
+
* @summary: Create data export job in required format
|
|
10
|
+
* @description: Create data export job in required format
|
|
11
|
+
*/
|
|
12
|
+
createExportJob({ exportType, body }?: {
|
|
13
|
+
exportType: string;
|
|
14
|
+
body: any;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} arg - Arg object.
|
|
18
|
+
* @param {string} arg.exportType - Export type / format
|
|
19
|
+
* @param {string} arg.jobId - Export job id
|
|
20
|
+
* @summary: Get data export job status
|
|
21
|
+
* @description: Get data export job status
|
|
22
|
+
*/
|
|
23
|
+
getExportJobStatus({ exportType, jobId }?: {
|
|
24
|
+
exportType: string;
|
|
25
|
+
jobId: string;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {Object} arg - Arg object.
|
|
29
|
+
* @param {string} arg.logType - Log type
|
|
30
|
+
* @param {number} [arg.pageNo] - Current page number
|
|
31
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
32
|
+
* @param {GetLogsListReq} arg.body
|
|
33
|
+
* @summary: Get logs list
|
|
34
|
+
* @description: Get logs list
|
|
35
|
+
*/
|
|
36
|
+
getLogsList({ logType, body, pageNo, pageSize }?: {
|
|
37
|
+
logType: string;
|
|
38
|
+
pageNo?: number;
|
|
39
|
+
pageSize?: number;
|
|
40
|
+
body: any;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* @param {Object} arg - Arg object.
|
|
44
|
+
* @param {string} arg.logType - Log type
|
|
45
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
46
|
+
* @param {GetLogsListReq} arg.body
|
|
47
|
+
* @summary: Get logs list
|
|
48
|
+
* @description: Get logs list
|
|
49
|
+
*/
|
|
50
|
+
getLogsListPaginator({ logType, pageSize, body }?: {
|
|
51
|
+
logType: string;
|
|
52
|
+
pageSize?: number;
|
|
53
|
+
body: any;
|
|
54
|
+
}): Paginator;
|
|
55
|
+
/**
|
|
56
|
+
* @param {Object} arg - Arg object.
|
|
57
|
+
* @param {number} [arg.pageNo] - Current page number
|
|
58
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
59
|
+
* @param {string} arg.logType - Log type
|
|
60
|
+
* @param {SearchLogReq} arg.body
|
|
61
|
+
* @summary: Search logs
|
|
62
|
+
* @description: Search logs
|
|
63
|
+
*/
|
|
64
|
+
searchLogs({ logType, body, pageNo, pageSize }?: {
|
|
65
|
+
pageNo?: number;
|
|
66
|
+
pageSize?: number;
|
|
67
|
+
logType: string;
|
|
68
|
+
body: any;
|
|
69
|
+
}): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
73
|
+
* @param {string} arg.logType - Log type
|
|
74
|
+
* @param {SearchLogReq} arg.body
|
|
75
|
+
* @summary: Search logs
|
|
76
|
+
* @description: Search logs
|
|
77
|
+
*/
|
|
78
|
+
searchLogsPaginator({ pageSize, logType, body }?: {
|
|
79
|
+
pageSize?: number;
|
|
80
|
+
logType: string;
|
|
81
|
+
body: any;
|
|
82
|
+
}): Paginator;
|
|
83
|
+
}
|
|
84
|
+
import Paginator = require("../../common/Paginator");
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const AnalyticsValidator = require("../models/AnalyticsValidator");
|
|
5
|
+
class Analytics {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {string} arg.exportType - Export type / format
|
|
13
|
+
* @param {ExportJobReq} arg.body
|
|
14
|
+
* @summary: Create data export job in required format
|
|
15
|
+
* @description: Create data export job in required format
|
|
16
|
+
*/
|
|
17
|
+
createExportJob({ exportType, body } = {}) {
|
|
18
|
+
const { error } = AnalyticsValidator.createExportJob().validate(
|
|
19
|
+
{
|
|
20
|
+
exportType,
|
|
21
|
+
body,
|
|
22
|
+
},
|
|
23
|
+
{ abortEarly: false, allowUnknown: true }
|
|
24
|
+
);
|
|
25
|
+
if (error) {
|
|
26
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const query_params = {};
|
|
30
|
+
|
|
31
|
+
const xHeaders = {};
|
|
32
|
+
|
|
33
|
+
return PlatformAPIClient.execute(
|
|
34
|
+
this.config,
|
|
35
|
+
"post",
|
|
36
|
+
`/service/platform/analytics/v1.0/company/${this.config.companyId}/export/${exportType}`,
|
|
37
|
+
query_params,
|
|
38
|
+
body,
|
|
39
|
+
xHeaders
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {Object} arg - Arg object.
|
|
45
|
+
* @param {string} arg.exportType - Export type / format
|
|
46
|
+
* @param {string} arg.jobId - Export job id
|
|
47
|
+
* @summary: Get data export job status
|
|
48
|
+
* @description: Get data export job status
|
|
49
|
+
*/
|
|
50
|
+
getExportJobStatus({ exportType, jobId } = {}) {
|
|
51
|
+
const { error } = AnalyticsValidator.getExportJobStatus().validate(
|
|
52
|
+
{
|
|
53
|
+
exportType,
|
|
54
|
+
jobId,
|
|
55
|
+
},
|
|
56
|
+
{ abortEarly: false, allowUnknown: true }
|
|
57
|
+
);
|
|
58
|
+
if (error) {
|
|
59
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const query_params = {};
|
|
63
|
+
|
|
64
|
+
const xHeaders = {};
|
|
65
|
+
|
|
66
|
+
return PlatformAPIClient.execute(
|
|
67
|
+
this.config,
|
|
68
|
+
"get",
|
|
69
|
+
`/service/platform/analytics/v1.0/company/${this.config.companyId}/export/${exportType}/job/${jobId}`,
|
|
70
|
+
query_params,
|
|
71
|
+
undefined,
|
|
72
|
+
xHeaders
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @param {Object} arg - Arg object.
|
|
78
|
+
* @param {string} arg.logType - Log type
|
|
79
|
+
* @param {number} [arg.pageNo] - Current page number
|
|
80
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
81
|
+
* @param {GetLogsListReq} arg.body
|
|
82
|
+
* @summary: Get logs list
|
|
83
|
+
* @description: Get logs list
|
|
84
|
+
*/
|
|
85
|
+
getLogsList({ logType, body, pageNo, pageSize } = {}) {
|
|
86
|
+
const { error } = AnalyticsValidator.getLogsList().validate(
|
|
87
|
+
{
|
|
88
|
+
logType,
|
|
89
|
+
body,
|
|
90
|
+
pageNo,
|
|
91
|
+
pageSize,
|
|
92
|
+
},
|
|
93
|
+
{ abortEarly: false, allowUnknown: true }
|
|
94
|
+
);
|
|
95
|
+
if (error) {
|
|
96
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const query_params = {};
|
|
100
|
+
query_params["page_no"] = pageNo;
|
|
101
|
+
query_params["page_size"] = pageSize;
|
|
102
|
+
|
|
103
|
+
const xHeaders = {};
|
|
104
|
+
|
|
105
|
+
return PlatformAPIClient.execute(
|
|
106
|
+
this.config,
|
|
107
|
+
"post",
|
|
108
|
+
`/service/platform/analytics/v1.0/company/${this.config.companyId}/logs/${logType}`,
|
|
109
|
+
query_params,
|
|
110
|
+
body,
|
|
111
|
+
xHeaders
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @param {Object} arg - Arg object.
|
|
117
|
+
* @param {string} arg.logType - Log type
|
|
118
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
119
|
+
* @param {GetLogsListReq} arg.body
|
|
120
|
+
* @summary: Get logs list
|
|
121
|
+
* @description: Get logs list
|
|
122
|
+
*/
|
|
123
|
+
getLogsListPaginator({ logType, pageSize, body } = {}) {
|
|
124
|
+
const paginator = new Paginator();
|
|
125
|
+
const callback = async () => {
|
|
126
|
+
const pageId = paginator.nextId;
|
|
127
|
+
const pageNo = paginator.pageNo;
|
|
128
|
+
const pageType = "number";
|
|
129
|
+
const data = await this.getLogsList({
|
|
130
|
+
logType: logType,
|
|
131
|
+
body: body,
|
|
132
|
+
pageNo: pageNo,
|
|
133
|
+
pageSize: pageSize,
|
|
134
|
+
});
|
|
135
|
+
paginator.setPaginator({
|
|
136
|
+
hasNext: data.page.has_next ? true : false,
|
|
137
|
+
nextId: data.page.next_id,
|
|
138
|
+
});
|
|
139
|
+
return data;
|
|
140
|
+
};
|
|
141
|
+
paginator.setCallback(callback);
|
|
142
|
+
return paginator;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* @param {Object} arg - Arg object.
|
|
147
|
+
* @param {number} [arg.pageNo] - Current page number
|
|
148
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
149
|
+
* @param {string} arg.logType - Log type
|
|
150
|
+
* @param {SearchLogReq} arg.body
|
|
151
|
+
* @summary: Search logs
|
|
152
|
+
* @description: Search logs
|
|
153
|
+
*/
|
|
154
|
+
searchLogs({ logType, body, pageNo, pageSize } = {}) {
|
|
155
|
+
const { error } = AnalyticsValidator.searchLogs().validate(
|
|
156
|
+
{
|
|
157
|
+
logType,
|
|
158
|
+
body,
|
|
159
|
+
pageNo,
|
|
160
|
+
pageSize,
|
|
161
|
+
},
|
|
162
|
+
{ abortEarly: false, allowUnknown: true }
|
|
163
|
+
);
|
|
164
|
+
if (error) {
|
|
165
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const query_params = {};
|
|
169
|
+
query_params["page_no"] = pageNo;
|
|
170
|
+
query_params["page_size"] = pageSize;
|
|
171
|
+
|
|
172
|
+
const xHeaders = {};
|
|
173
|
+
|
|
174
|
+
return PlatformAPIClient.execute(
|
|
175
|
+
this.config,
|
|
176
|
+
"post",
|
|
177
|
+
`/service/platform/analytics/v1.0/company/${this.config.companyId}/logs/${logType}/search`,
|
|
178
|
+
query_params,
|
|
179
|
+
body,
|
|
180
|
+
xHeaders
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @param {Object} arg - Arg object.
|
|
186
|
+
* @param {number} [arg.pageSize] - Current page size
|
|
187
|
+
* @param {string} arg.logType - Log type
|
|
188
|
+
* @param {SearchLogReq} arg.body
|
|
189
|
+
* @summary: Search logs
|
|
190
|
+
* @description: Search logs
|
|
191
|
+
*/
|
|
192
|
+
searchLogsPaginator({ pageSize, logType, body } = {}) {
|
|
193
|
+
const paginator = new Paginator();
|
|
194
|
+
const callback = async () => {
|
|
195
|
+
const pageId = paginator.nextId;
|
|
196
|
+
const pageNo = paginator.pageNo;
|
|
197
|
+
const pageType = "number";
|
|
198
|
+
const data = await this.searchLogs({
|
|
199
|
+
logType: logType,
|
|
200
|
+
body: body,
|
|
201
|
+
pageNo: pageNo,
|
|
202
|
+
pageSize: pageSize,
|
|
203
|
+
});
|
|
204
|
+
paginator.setPaginator({
|
|
205
|
+
hasNext: data.page.has_next ? true : false,
|
|
206
|
+
nextId: data.page.next_id,
|
|
207
|
+
});
|
|
208
|
+
return data;
|
|
209
|
+
};
|
|
210
|
+
paginator.setCallback(callback);
|
|
211
|
+
return paginator;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
module.exports = Analytics;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export = AuditTrail;
|
|
2
|
+
declare class AuditTrail {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.qs - Logs Query
|
|
8
|
+
* @summary: Get paginated audit logs
|
|
9
|
+
* @description: Get a paginated set of logs that can be filtered using the available set of parameters and get the relevant group of logs
|
|
10
|
+
*/
|
|
11
|
+
getAuditLogs({ qs }?: {
|
|
12
|
+
qs: string;
|
|
13
|
+
}): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @param {Object} arg - Arg object.
|
|
16
|
+
* @param {RequestBodyAuditLog} arg.body
|
|
17
|
+
* @summary: Create logs for auditing later on
|
|
18
|
+
* @description: Create a log instance that stores all the relevant info to be logged
|
|
19
|
+
*/
|
|
20
|
+
createAuditLog({ body }?: {
|
|
21
|
+
body: any;
|
|
22
|
+
}): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* @param {Object} arg - Arg object.
|
|
25
|
+
* @param {string} arg.id - Log uuid
|
|
26
|
+
* @summary: Get audit log
|
|
27
|
+
* @description: Get detailed log information by their id
|
|
28
|
+
*/
|
|
29
|
+
getAuditLog({ id }?: {
|
|
30
|
+
id: string;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* @param {Object} arg - Arg object.
|
|
34
|
+
* @summary: Get entity types
|
|
35
|
+
* @description: Get a consolidated list of entity types from all the logs stored on the db, which further helps to filter the logs better
|
|
36
|
+
*/
|
|
37
|
+
getEntityTypes({}?: any): Promise<any>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const AuditTrailValidator = require("../models/AuditTrailValidator");
|
|
5
|
+
class AuditTrail {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {string} arg.qs - Logs Query
|
|
13
|
+
* @summary: Get paginated audit logs
|
|
14
|
+
* @description: Get a paginated set of logs that can be filtered using the available set of parameters and get the relevant group of logs
|
|
15
|
+
*/
|
|
16
|
+
getAuditLogs({ qs } = {}) {
|
|
17
|
+
const { error } = AuditTrailValidator.getAuditLogs().validate(
|
|
18
|
+
{
|
|
19
|
+
qs,
|
|
20
|
+
},
|
|
21
|
+
{ abortEarly: false, allowUnknown: true }
|
|
22
|
+
);
|
|
23
|
+
if (error) {
|
|
24
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const query_params = {};
|
|
28
|
+
query_params["qs"] = qs;
|
|
29
|
+
|
|
30
|
+
const xHeaders = {};
|
|
31
|
+
|
|
32
|
+
return PlatformAPIClient.execute(
|
|
33
|
+
this.config,
|
|
34
|
+
"get",
|
|
35
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/`,
|
|
36
|
+
query_params,
|
|
37
|
+
undefined,
|
|
38
|
+
xHeaders
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {Object} arg - Arg object.
|
|
44
|
+
* @param {RequestBodyAuditLog} arg.body
|
|
45
|
+
* @summary: Create logs for auditing later on
|
|
46
|
+
* @description: Create a log instance that stores all the relevant info to be logged
|
|
47
|
+
*/
|
|
48
|
+
createAuditLog({ body } = {}) {
|
|
49
|
+
const { error } = AuditTrailValidator.createAuditLog().validate(
|
|
50
|
+
{
|
|
51
|
+
body,
|
|
52
|
+
},
|
|
53
|
+
{ abortEarly: false, allowUnknown: true }
|
|
54
|
+
);
|
|
55
|
+
if (error) {
|
|
56
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const query_params = {};
|
|
60
|
+
|
|
61
|
+
const xHeaders = {};
|
|
62
|
+
|
|
63
|
+
return PlatformAPIClient.execute(
|
|
64
|
+
this.config,
|
|
65
|
+
"post",
|
|
66
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/`,
|
|
67
|
+
query_params,
|
|
68
|
+
body,
|
|
69
|
+
xHeaders
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {Object} arg - Arg object.
|
|
75
|
+
* @param {string} arg.id - Log uuid
|
|
76
|
+
* @summary: Get audit log
|
|
77
|
+
* @description: Get detailed log information by their id
|
|
78
|
+
*/
|
|
79
|
+
getAuditLog({ id } = {}) {
|
|
80
|
+
const { error } = AuditTrailValidator.getAuditLog().validate(
|
|
81
|
+
{
|
|
82
|
+
id,
|
|
83
|
+
},
|
|
84
|
+
{ abortEarly: false, allowUnknown: true }
|
|
85
|
+
);
|
|
86
|
+
if (error) {
|
|
87
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const query_params = {};
|
|
91
|
+
|
|
92
|
+
const xHeaders = {};
|
|
93
|
+
|
|
94
|
+
return PlatformAPIClient.execute(
|
|
95
|
+
this.config,
|
|
96
|
+
"get",
|
|
97
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/${id}`,
|
|
98
|
+
query_params,
|
|
99
|
+
undefined,
|
|
100
|
+
xHeaders
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @param {Object} arg - Arg object.
|
|
106
|
+
* @summary: Get entity types
|
|
107
|
+
* @description: Get a consolidated list of entity types from all the logs stored on the db, which further helps to filter the logs better
|
|
108
|
+
*/
|
|
109
|
+
getEntityTypes({} = {}) {
|
|
110
|
+
const { error } = AuditTrailValidator.getEntityTypes().validate(
|
|
111
|
+
{},
|
|
112
|
+
{ abortEarly: false, allowUnknown: true }
|
|
113
|
+
);
|
|
114
|
+
if (error) {
|
|
115
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const query_params = {};
|
|
119
|
+
|
|
120
|
+
const xHeaders = {};
|
|
121
|
+
|
|
122
|
+
return PlatformAPIClient.execute(
|
|
123
|
+
this.config,
|
|
124
|
+
"get",
|
|
125
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/entity-types`,
|
|
126
|
+
query_params,
|
|
127
|
+
undefined,
|
|
128
|
+
xHeaders
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
module.exports = AuditTrail;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export = Billing;
|
|
2
|
+
declare class Billing {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.plan - ID of the plan.
|
|
8
|
+
* @param {string} arg.couponCode - Coupon code.
|
|
9
|
+
* @summary: Check coupon validity
|
|
10
|
+
* @description: Check coupon validity.
|
|
11
|
+
*/
|
|
12
|
+
checkCouponValidity({ plan, couponCode }?: {
|
|
13
|
+
plan: string;
|
|
14
|
+
couponCode: string;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} arg - Arg object.
|
|
18
|
+
* @param {string} arg.extensionId - Extension _id
|
|
19
|
+
* @param {CreateSubscriptionCharge} arg.body
|
|
20
|
+
* @summary: Create subscription charge
|
|
21
|
+
* @description: Register subscription charge for a seller of your extension.
|
|
22
|
+
*/
|
|
23
|
+
createSubscriptionCharge({ extensionId, body }?: {
|
|
24
|
+
extensionId: string;
|
|
25
|
+
body: any;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {Object} arg - Arg object.
|
|
29
|
+
* @param {string} arg.extensionId - Extension _id
|
|
30
|
+
* @param {string} arg.subscriptionId - Subscription charge _id
|
|
31
|
+
* @summary: Get subscription charge details
|
|
32
|
+
* @description: Get created subscription charge details
|
|
33
|
+
*/
|
|
34
|
+
getSubscriptionCharge({ extensionId, subscriptionId }?: {
|
|
35
|
+
extensionId: string;
|
|
36
|
+
subscriptionId: string;
|
|
37
|
+
}): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* @param {Object} arg - Arg object.
|
|
40
|
+
* @param {string} arg.extensionId - Extension _id
|
|
41
|
+
* @param {string} arg.subscriptionId - Subscription charge _id
|
|
42
|
+
* @summary: Cancel subscription charge
|
|
43
|
+
* @description: Cancel subscription and attached charges.
|
|
44
|
+
*/
|
|
45
|
+
cancelSubscriptionCharge({ extensionId, subscriptionId }?: {
|
|
46
|
+
extensionId: string;
|
|
47
|
+
subscriptionId: string;
|
|
48
|
+
}): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* @param {Object} arg - Arg object.
|
|
51
|
+
* @summary: Get invoices
|
|
52
|
+
* @description: Get invoices.
|
|
53
|
+
*/
|
|
54
|
+
getInvoices({}?: any): Promise<any>;
|
|
55
|
+
/**
|
|
56
|
+
* @param {Object} arg - Arg object.
|
|
57
|
+
* @param {string} arg.invoiceId - Invoice id
|
|
58
|
+
* @summary: Get invoice by id
|
|
59
|
+
* @description: Get invoice by id.
|
|
60
|
+
*/
|
|
61
|
+
getInvoiceById({ invoiceId }?: {
|
|
62
|
+
invoiceId: string;
|
|
63
|
+
}): Promise<any>;
|
|
64
|
+
/**
|
|
65
|
+
* @param {Object} arg - Arg object.
|
|
66
|
+
* @summary: Get subscription customer detail
|
|
67
|
+
* @description: Get subscription customer detail.
|
|
68
|
+
*/
|
|
69
|
+
getCustomerDetail({}?: any): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {SubscriptionCustomerCreate} arg.body
|
|
73
|
+
* @summary: Upsert subscription customer detail
|
|
74
|
+
* @description: Upsert subscription customer detail.
|
|
75
|
+
*/
|
|
76
|
+
upsertCustomerDetail({ body }?: {
|
|
77
|
+
body: any;
|
|
78
|
+
}): Promise<any>;
|
|
79
|
+
/**
|
|
80
|
+
* @param {Object} arg - Arg object.
|
|
81
|
+
* @summary: Get current subscription detail
|
|
82
|
+
* @description: If subscription is active then it will return is_enabled true and return subscription object. If subscription is not active then is_enabled false and message.
|
|
83
|
+
*/
|
|
84
|
+
getSubscription({}?: any): Promise<any>;
|
|
85
|
+
/**
|
|
86
|
+
* @param {Object} arg - Arg object.
|
|
87
|
+
* @summary: Get subscription subscription limits
|
|
88
|
+
* @description: Get subscription subscription limits.
|
|
89
|
+
*/
|
|
90
|
+
getFeatureLimitConfig({}?: any): Promise<any>;
|
|
91
|
+
/**
|
|
92
|
+
* @param {Object} arg - Arg object.
|
|
93
|
+
* @param {SubscriptionActivateReq} arg.body
|
|
94
|
+
* @summary: Activate subscription
|
|
95
|
+
* @description: It will activate subscription plan for customer
|
|
96
|
+
*/
|
|
97
|
+
activateSubscriptionPlan({ body }?: {
|
|
98
|
+
body: any;
|
|
99
|
+
}): Promise<any>;
|
|
100
|
+
/**
|
|
101
|
+
* @param {Object} arg - Arg object.
|
|
102
|
+
* @param {CancelSubscriptionReq} arg.body
|
|
103
|
+
* @summary: Cancel subscription
|
|
104
|
+
* @description: It will cancel current active subscription.
|
|
105
|
+
*/
|
|
106
|
+
cancelSubscriptionPlan({ body }?: {
|
|
107
|
+
body: any;
|
|
108
|
+
}): Promise<any>;
|
|
109
|
+
}
|