@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,88 @@
|
|
|
1
|
+
export = FileStorage;
|
|
2
|
+
declare class FileStorage {
|
|
3
|
+
constructor(_conf: any);
|
|
4
|
+
_conf: any;
|
|
5
|
+
_relativeUrls: {
|
|
6
|
+
startUpload: string;
|
|
7
|
+
completeUpload: string;
|
|
8
|
+
signUrls: string;
|
|
9
|
+
};
|
|
10
|
+
_urls: {};
|
|
11
|
+
updateUrls(urls: any): void;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Object} arg - Arg object.
|
|
14
|
+
* @param {string} arg.namespace - Name of the bucket created for storing objects.
|
|
15
|
+
* @param {StartRequest} arg.body
|
|
16
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
17
|
+
* @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob.
|
|
18
|
+
* @description: Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob.
|
|
19
|
+
*
|
|
20
|
+
* The three major steps are:
|
|
21
|
+
* Start
|
|
22
|
+
* Upload
|
|
23
|
+
* Complete
|
|
24
|
+
*
|
|
25
|
+
* ### Start
|
|
26
|
+
* Initiates the assets upload using `startUpload`.
|
|
27
|
+
* It returns a storage link in response.
|
|
28
|
+
*
|
|
29
|
+
* ### Upload
|
|
30
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
31
|
+
* Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body.
|
|
32
|
+
*
|
|
33
|
+
* ### Complete
|
|
34
|
+
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
35
|
+
* This operation will return the URL of the uploaded file.
|
|
36
|
+
*/
|
|
37
|
+
startUpload({ namespace, body }?: {
|
|
38
|
+
namespace: string;
|
|
39
|
+
body: any;
|
|
40
|
+
}): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* @param {Object} arg - Arg object.
|
|
43
|
+
* @param {string} arg.namespace - Name of the bucket created for storing objects.
|
|
44
|
+
* @param {StartResponse} arg.body
|
|
45
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
46
|
+
* @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
|
|
47
|
+
* @description: Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob.
|
|
48
|
+
*
|
|
49
|
+
* The three major steps are:
|
|
50
|
+
* Start
|
|
51
|
+
* Upload
|
|
52
|
+
* Complete
|
|
53
|
+
*
|
|
54
|
+
* ### Start
|
|
55
|
+
* Initiates the assets upload using `startUpload`.
|
|
56
|
+
* It returns a storage link in response.
|
|
57
|
+
*
|
|
58
|
+
* ### Upload
|
|
59
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
60
|
+
* Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body.
|
|
61
|
+
*
|
|
62
|
+
* ### Complete
|
|
63
|
+
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
64
|
+
* This operation will return the URL of the uploaded file.
|
|
65
|
+
*/
|
|
66
|
+
completeUpload({ namespace, body }?: {
|
|
67
|
+
namespace: string;
|
|
68
|
+
body: any;
|
|
69
|
+
}): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {SignUrlRequest} arg.body
|
|
73
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
74
|
+
* @summary: Explain here
|
|
75
|
+
* @description: Describe here
|
|
76
|
+
*/
|
|
77
|
+
signUrls({ body }?: {
|
|
78
|
+
body: any;
|
|
79
|
+
}): Promise<any>;
|
|
80
|
+
upload({ data, file_name, content_type, namespace, size, tags, }?: {
|
|
81
|
+
data: any;
|
|
82
|
+
file_name: any;
|
|
83
|
+
content_type: any;
|
|
84
|
+
namespace: any;
|
|
85
|
+
size: any;
|
|
86
|
+
tags: any;
|
|
87
|
+
}): Promise<any>;
|
|
88
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
const APIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const Paginator = require("../../common/Paginator");
|
|
3
|
+
const constructUrl = require("../constructUrl");
|
|
4
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
|
+
const FileStorageValidator = require("../models/FileStorageValidator");
|
|
6
|
+
const axios = require("axios");
|
|
7
|
+
|
|
8
|
+
class FileStorage {
|
|
9
|
+
constructor(_conf) {
|
|
10
|
+
this._conf = _conf;
|
|
11
|
+
this._relativeUrls = {
|
|
12
|
+
startUpload:
|
|
13
|
+
"/service/application/assets/v1.0/namespaces/{namespace}/upload/start/",
|
|
14
|
+
completeUpload:
|
|
15
|
+
"/service/application/assets/v1.0/namespaces/{namespace}/upload/complete/",
|
|
16
|
+
signUrls: "/service/application/assets/v1.0/sign-urls/",
|
|
17
|
+
};
|
|
18
|
+
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
19
|
+
(urls, [method, relativeUrl]) => {
|
|
20
|
+
urls[method] = `${_conf.domain}${relativeUrl}`;
|
|
21
|
+
return urls;
|
|
22
|
+
},
|
|
23
|
+
{}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
updateUrls(urls) {
|
|
28
|
+
this._urls = {
|
|
29
|
+
...this._urls,
|
|
30
|
+
...urls,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {Object} arg - Arg object.
|
|
36
|
+
* @param {string} arg.namespace - Name of the bucket created for storing objects.
|
|
37
|
+
* @param {StartRequest} arg.body
|
|
38
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
39
|
+
* @summary: Initiates an upload and returns a storage link that is valid for 30 minutes. You can use the storage link to make subsequent upload request with file buffer or blob.
|
|
40
|
+
* @description: Use this API to perform the first step of uploading (i.e. **Start**) an arbitrarily sized buffer or blob.
|
|
41
|
+
*
|
|
42
|
+
* The three major steps are:
|
|
43
|
+
* Start
|
|
44
|
+
* Upload
|
|
45
|
+
* Complete
|
|
46
|
+
*
|
|
47
|
+
* ### Start
|
|
48
|
+
* Initiates the assets upload using `startUpload`.
|
|
49
|
+
* It returns a storage link in response.
|
|
50
|
+
*
|
|
51
|
+
* ### Upload
|
|
52
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
53
|
+
* Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body.
|
|
54
|
+
*
|
|
55
|
+
* ### Complete
|
|
56
|
+
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
57
|
+
* This operation will return the URL of the uploaded file.
|
|
58
|
+
*/
|
|
59
|
+
startUpload({ namespace, body } = {}) {
|
|
60
|
+
const { error } = FileStorageValidator.startUpload().validate(
|
|
61
|
+
{ namespace, body },
|
|
62
|
+
{ abortEarly: false, allowUnknown: true }
|
|
63
|
+
);
|
|
64
|
+
if (error) {
|
|
65
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
66
|
+
}
|
|
67
|
+
const query_params = {};
|
|
68
|
+
|
|
69
|
+
const xHeaders = {};
|
|
70
|
+
|
|
71
|
+
return APIClient.execute(
|
|
72
|
+
this._conf,
|
|
73
|
+
"post",
|
|
74
|
+
constructUrl({
|
|
75
|
+
url: this._urls["startUpload"],
|
|
76
|
+
params: { namespace },
|
|
77
|
+
}),
|
|
78
|
+
query_params,
|
|
79
|
+
body,
|
|
80
|
+
xHeaders
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @param {Object} arg - Arg object.
|
|
86
|
+
* @param {string} arg.namespace - Name of the bucket created for storing objects.
|
|
87
|
+
* @param {StartResponse} arg.body
|
|
88
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
89
|
+
* @summary: Completes the upload process. After successfully uploading a file, call this API to finish the upload process.
|
|
90
|
+
* @description: Use this API to perform the third step of uploading (i.e. **Complete**) an arbitrarily sized buffer or blob.
|
|
91
|
+
*
|
|
92
|
+
* The three major steps are:
|
|
93
|
+
* Start
|
|
94
|
+
* Upload
|
|
95
|
+
* Complete
|
|
96
|
+
*
|
|
97
|
+
* ### Start
|
|
98
|
+
* Initiates the assets upload using `startUpload`.
|
|
99
|
+
* It returns a storage link in response.
|
|
100
|
+
*
|
|
101
|
+
* ### Upload
|
|
102
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
103
|
+
* Make a `PUT` request on storage link received from `startUpload` API with the file (Buffer or Blob) in the request body.
|
|
104
|
+
*
|
|
105
|
+
* ### Complete
|
|
106
|
+
* After successfully upload, call the `completeUpload` API to finish the upload process.
|
|
107
|
+
* This operation will return the URL of the uploaded file.
|
|
108
|
+
*/
|
|
109
|
+
completeUpload({ namespace, body } = {}) {
|
|
110
|
+
const { error } = FileStorageValidator.completeUpload().validate(
|
|
111
|
+
{ namespace, body },
|
|
112
|
+
{ abortEarly: false, allowUnknown: true }
|
|
113
|
+
);
|
|
114
|
+
if (error) {
|
|
115
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
116
|
+
}
|
|
117
|
+
const query_params = {};
|
|
118
|
+
|
|
119
|
+
const xHeaders = {};
|
|
120
|
+
|
|
121
|
+
return APIClient.execute(
|
|
122
|
+
this._conf,
|
|
123
|
+
"post",
|
|
124
|
+
constructUrl({
|
|
125
|
+
url: this._urls["completeUpload"],
|
|
126
|
+
params: { namespace },
|
|
127
|
+
}),
|
|
128
|
+
query_params,
|
|
129
|
+
body,
|
|
130
|
+
xHeaders
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @param {Object} arg - Arg object.
|
|
136
|
+
* @param {SignUrlRequest} arg.body
|
|
137
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
138
|
+
* @summary: Explain here
|
|
139
|
+
* @description: Describe here
|
|
140
|
+
*/
|
|
141
|
+
signUrls({ body } = {}) {
|
|
142
|
+
const { error } = FileStorageValidator.signUrls().validate(
|
|
143
|
+
{ body },
|
|
144
|
+
{ abortEarly: false, allowUnknown: true }
|
|
145
|
+
);
|
|
146
|
+
if (error) {
|
|
147
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
148
|
+
}
|
|
149
|
+
const query_params = {};
|
|
150
|
+
|
|
151
|
+
const xHeaders = {};
|
|
152
|
+
|
|
153
|
+
return APIClient.execute(
|
|
154
|
+
this._conf,
|
|
155
|
+
"post",
|
|
156
|
+
constructUrl({
|
|
157
|
+
url: this._urls["signUrls"],
|
|
158
|
+
params: {},
|
|
159
|
+
}),
|
|
160
|
+
query_params,
|
|
161
|
+
body,
|
|
162
|
+
xHeaders
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @param data
|
|
169
|
+
* @param {string} file_name
|
|
170
|
+
* @param {string} content_type
|
|
171
|
+
* @param {string} namespace
|
|
172
|
+
* @param {number} size
|
|
173
|
+
* @param {number} tags
|
|
174
|
+
*/
|
|
175
|
+
FileStorage.prototype.upload = function ({
|
|
176
|
+
data,
|
|
177
|
+
file_name,
|
|
178
|
+
content_type,
|
|
179
|
+
namespace,
|
|
180
|
+
size,
|
|
181
|
+
tags,
|
|
182
|
+
} = {}) {
|
|
183
|
+
return new Promise(async (resolve, reject) => {
|
|
184
|
+
try {
|
|
185
|
+
const dataObj = await this.startUpload({
|
|
186
|
+
namespace,
|
|
187
|
+
body: {
|
|
188
|
+
file_name,
|
|
189
|
+
content_type,
|
|
190
|
+
size: size,
|
|
191
|
+
tags: tags,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
if (dataObj.upload && dataObj.upload.url) {
|
|
195
|
+
await axios.put(dataObj.upload.url, data, {
|
|
196
|
+
withCredentials: false,
|
|
197
|
+
headers: { "Content-Type": content_type },
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
reject({ message: "Failed to upload file" });
|
|
201
|
+
}
|
|
202
|
+
delete dataObj.tags;
|
|
203
|
+
const completeRes = await this.completeUpload({
|
|
204
|
+
namespace,
|
|
205
|
+
body: dataObj,
|
|
206
|
+
});
|
|
207
|
+
resolve(completeRes);
|
|
208
|
+
} catch (err) {
|
|
209
|
+
reject(err);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
module.exports = FileStorage;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export = Lead;
|
|
2
|
+
declare class Lead {
|
|
3
|
+
constructor(_conf: any);
|
|
4
|
+
_conf: any;
|
|
5
|
+
_relativeUrls: {
|
|
6
|
+
getTicket: string;
|
|
7
|
+
createHistory: string;
|
|
8
|
+
createTicket: string;
|
|
9
|
+
getCustomForm: string;
|
|
10
|
+
submitCustomForm: string;
|
|
11
|
+
getParticipantsInsideVideoRoom: string;
|
|
12
|
+
getTokenForVideoRoom: string;
|
|
13
|
+
};
|
|
14
|
+
_urls: {};
|
|
15
|
+
updateUrls(urls: any): void;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object} arg - Arg object.
|
|
18
|
+
* @param {string} arg.id - ID of ticket to be retrieved
|
|
19
|
+
* @returns {Promise<Ticket>} - Success response
|
|
20
|
+
* @summary: Get Ticket with the specific id
|
|
21
|
+
* @description: Get Ticket with the specific id, this is used to view the ticket details
|
|
22
|
+
*/
|
|
23
|
+
getTicket({ id }?: {
|
|
24
|
+
id: string;
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* @param {Object} arg - Arg object.
|
|
28
|
+
* @param {string} arg.id - Ticket ID for which history is created
|
|
29
|
+
* @param {TicketHistoryPayload} arg.body
|
|
30
|
+
* @returns {Promise<TicketHistory>} - Success response
|
|
31
|
+
* @summary: Create history for specific Ticket
|
|
32
|
+
* @description: Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating.
|
|
33
|
+
*/
|
|
34
|
+
createHistory({ id, body }?: {
|
|
35
|
+
id: string;
|
|
36
|
+
body: any;
|
|
37
|
+
}): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* @param {Object} arg - Arg object.
|
|
40
|
+
* @param {AddTicketPayload} arg.body
|
|
41
|
+
* @returns {Promise<Ticket>} - Success response
|
|
42
|
+
* @summary: Create Ticket
|
|
43
|
+
* @description: This is used to Create Ticket.
|
|
44
|
+
*/
|
|
45
|
+
createTicket({ body }?: {
|
|
46
|
+
body: any;
|
|
47
|
+
}): Promise<any>;
|
|
48
|
+
/**
|
|
49
|
+
* @param {Object} arg - Arg object.
|
|
50
|
+
* @param {string} arg.slug - Slug of form whose response is getting submitted
|
|
51
|
+
* @returns {Promise<CustomForm>} - Success response
|
|
52
|
+
* @summary: Get specific Custom Form using it's slug
|
|
53
|
+
* @description: Get specific Custom Form using it's slug, this is used to view the form.
|
|
54
|
+
*/
|
|
55
|
+
getCustomForm({ slug }?: {
|
|
56
|
+
slug: string;
|
|
57
|
+
}): Promise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* @param {Object} arg - Arg object.
|
|
60
|
+
* @param {string} arg.slug - Slug of form whose response is getting submitted
|
|
61
|
+
* @param {CustomFormSubmissionPayload} arg.body
|
|
62
|
+
* @returns {Promise<SubmitCustomFormResponse>} - Success response
|
|
63
|
+
* @summary: Submit Response for a specific Custom Form using it's slug
|
|
64
|
+
* @description: Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user.
|
|
65
|
+
*/
|
|
66
|
+
submitCustomForm({ slug, body }?: {
|
|
67
|
+
slug: string;
|
|
68
|
+
body: any;
|
|
69
|
+
}): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {string} arg.uniqueName - Unique name of Video Room
|
|
73
|
+
* @returns {Promise<GetParticipantsInsideVideoRoomResponse>} - Success response
|
|
74
|
+
* @summary: Get participants of a specific Video Room using it's unique name
|
|
75
|
+
* @description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names.
|
|
76
|
+
*/
|
|
77
|
+
getParticipantsInsideVideoRoom({ uniqueName }?: {
|
|
78
|
+
uniqueName: string;
|
|
79
|
+
}): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* @param {Object} arg - Arg object.
|
|
82
|
+
* @param {string} arg.uniqueName - Unique name of Video Room
|
|
83
|
+
* @returns {Promise<GetTokenForVideoRoomResponse>} - Success response
|
|
84
|
+
* @summary: Get Token to join a specific Video Room using it's unqiue name
|
|
85
|
+
* @description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there.
|
|
86
|
+
*/
|
|
87
|
+
getTokenForVideoRoom({ uniqueName }?: {
|
|
88
|
+
uniqueName: string;
|
|
89
|
+
}): Promise<any>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
const APIClient = require("../ApplicationAPIClient");
|
|
2
|
+
const Paginator = require("../../common/Paginator");
|
|
3
|
+
const constructUrl = require("../constructUrl");
|
|
4
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
|
+
const LeadValidator = require("../models/LeadValidator");
|
|
6
|
+
|
|
7
|
+
class Lead {
|
|
8
|
+
constructor(_conf) {
|
|
9
|
+
this._conf = _conf;
|
|
10
|
+
this._relativeUrls = {
|
|
11
|
+
getTicket: "/service/application/lead/v1.0/ticket/{id}",
|
|
12
|
+
createHistory: "/service/application/lead/v1.0/ticket/{id}/history",
|
|
13
|
+
createTicket: "/service/application/lead/v1.0/ticket/",
|
|
14
|
+
getCustomForm: "/service/application/lead/v1.0/form/{slug}",
|
|
15
|
+
submitCustomForm: "/service/application/lead/v1.0/form/{slug}/submit",
|
|
16
|
+
getParticipantsInsideVideoRoom:
|
|
17
|
+
"/service/application/lead/v1.0/video/room/{unique_name}/participants",
|
|
18
|
+
getTokenForVideoRoom:
|
|
19
|
+
"/service/application/lead/v1.0/video/room/{unique_name}/token",
|
|
20
|
+
};
|
|
21
|
+
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
22
|
+
(urls, [method, relativeUrl]) => {
|
|
23
|
+
urls[method] = `${_conf.domain}${relativeUrl}`;
|
|
24
|
+
return urls;
|
|
25
|
+
},
|
|
26
|
+
{}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
updateUrls(urls) {
|
|
31
|
+
this._urls = {
|
|
32
|
+
...this._urls,
|
|
33
|
+
...urls,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {Object} arg - Arg object.
|
|
39
|
+
* @param {string} arg.id - ID of ticket to be retrieved
|
|
40
|
+
* @returns {Promise<Ticket>} - Success response
|
|
41
|
+
* @summary: Get Ticket with the specific id
|
|
42
|
+
* @description: Get Ticket with the specific id, this is used to view the ticket details
|
|
43
|
+
*/
|
|
44
|
+
getTicket({ id } = {}) {
|
|
45
|
+
const { error } = LeadValidator.getTicket().validate(
|
|
46
|
+
{ id },
|
|
47
|
+
{ abortEarly: false, allowUnknown: true }
|
|
48
|
+
);
|
|
49
|
+
if (error) {
|
|
50
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
51
|
+
}
|
|
52
|
+
const query_params = {};
|
|
53
|
+
|
|
54
|
+
const xHeaders = {};
|
|
55
|
+
|
|
56
|
+
return APIClient.execute(
|
|
57
|
+
this._conf,
|
|
58
|
+
"get",
|
|
59
|
+
constructUrl({
|
|
60
|
+
url: this._urls["getTicket"],
|
|
61
|
+
params: { id },
|
|
62
|
+
}),
|
|
63
|
+
query_params,
|
|
64
|
+
undefined,
|
|
65
|
+
xHeaders
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {Object} arg - Arg object.
|
|
71
|
+
* @param {string} arg.id - Ticket ID for which history is created
|
|
72
|
+
* @param {TicketHistoryPayload} arg.body
|
|
73
|
+
* @returns {Promise<TicketHistory>} - Success response
|
|
74
|
+
* @summary: Create history for specific Ticket
|
|
75
|
+
* @description: Create history for specific Ticket, this history is seen on ticket detail page, this can be comment, log or rating.
|
|
76
|
+
*/
|
|
77
|
+
createHistory({ id, body } = {}) {
|
|
78
|
+
const { error } = LeadValidator.createHistory().validate(
|
|
79
|
+
{ id, body },
|
|
80
|
+
{ abortEarly: false, allowUnknown: true }
|
|
81
|
+
);
|
|
82
|
+
if (error) {
|
|
83
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
84
|
+
}
|
|
85
|
+
const query_params = {};
|
|
86
|
+
|
|
87
|
+
const xHeaders = {};
|
|
88
|
+
|
|
89
|
+
return APIClient.execute(
|
|
90
|
+
this._conf,
|
|
91
|
+
"post",
|
|
92
|
+
constructUrl({
|
|
93
|
+
url: this._urls["createHistory"],
|
|
94
|
+
params: { id },
|
|
95
|
+
}),
|
|
96
|
+
query_params,
|
|
97
|
+
body,
|
|
98
|
+
xHeaders
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @param {Object} arg - Arg object.
|
|
104
|
+
* @param {AddTicketPayload} arg.body
|
|
105
|
+
* @returns {Promise<Ticket>} - Success response
|
|
106
|
+
* @summary: Create Ticket
|
|
107
|
+
* @description: This is used to Create Ticket.
|
|
108
|
+
*/
|
|
109
|
+
createTicket({ body } = {}) {
|
|
110
|
+
const { error } = LeadValidator.createTicket().validate(
|
|
111
|
+
{ body },
|
|
112
|
+
{ abortEarly: false, allowUnknown: true }
|
|
113
|
+
);
|
|
114
|
+
if (error) {
|
|
115
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
116
|
+
}
|
|
117
|
+
const query_params = {};
|
|
118
|
+
|
|
119
|
+
const xHeaders = {};
|
|
120
|
+
|
|
121
|
+
return APIClient.execute(
|
|
122
|
+
this._conf,
|
|
123
|
+
"post",
|
|
124
|
+
constructUrl({
|
|
125
|
+
url: this._urls["createTicket"],
|
|
126
|
+
params: {},
|
|
127
|
+
}),
|
|
128
|
+
query_params,
|
|
129
|
+
body,
|
|
130
|
+
xHeaders
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @param {Object} arg - Arg object.
|
|
136
|
+
* @param {string} arg.slug - Slug of form whose response is getting submitted
|
|
137
|
+
* @returns {Promise<CustomForm>} - Success response
|
|
138
|
+
* @summary: Get specific Custom Form using it's slug
|
|
139
|
+
* @description: Get specific Custom Form using it's slug, this is used to view the form.
|
|
140
|
+
*/
|
|
141
|
+
getCustomForm({ slug } = {}) {
|
|
142
|
+
const { error } = LeadValidator.getCustomForm().validate(
|
|
143
|
+
{ slug },
|
|
144
|
+
{ abortEarly: false, allowUnknown: true }
|
|
145
|
+
);
|
|
146
|
+
if (error) {
|
|
147
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
148
|
+
}
|
|
149
|
+
const query_params = {};
|
|
150
|
+
|
|
151
|
+
const xHeaders = {};
|
|
152
|
+
|
|
153
|
+
return APIClient.execute(
|
|
154
|
+
this._conf,
|
|
155
|
+
"get",
|
|
156
|
+
constructUrl({
|
|
157
|
+
url: this._urls["getCustomForm"],
|
|
158
|
+
params: { slug },
|
|
159
|
+
}),
|
|
160
|
+
query_params,
|
|
161
|
+
undefined,
|
|
162
|
+
xHeaders
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {Object} arg - Arg object.
|
|
168
|
+
* @param {string} arg.slug - Slug of form whose response is getting submitted
|
|
169
|
+
* @param {CustomFormSubmissionPayload} arg.body
|
|
170
|
+
* @returns {Promise<SubmitCustomFormResponse>} - Success response
|
|
171
|
+
* @summary: Submit Response for a specific Custom Form using it's slug
|
|
172
|
+
* @description: Submit Response for a specific Custom Form using it's slug, this response is then used to create a ticket on behalf of the user.
|
|
173
|
+
*/
|
|
174
|
+
submitCustomForm({ slug, body } = {}) {
|
|
175
|
+
const { error } = LeadValidator.submitCustomForm().validate(
|
|
176
|
+
{ slug, body },
|
|
177
|
+
{ abortEarly: false, allowUnknown: true }
|
|
178
|
+
);
|
|
179
|
+
if (error) {
|
|
180
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
181
|
+
}
|
|
182
|
+
const query_params = {};
|
|
183
|
+
|
|
184
|
+
const xHeaders = {};
|
|
185
|
+
|
|
186
|
+
return APIClient.execute(
|
|
187
|
+
this._conf,
|
|
188
|
+
"post",
|
|
189
|
+
constructUrl({
|
|
190
|
+
url: this._urls["submitCustomForm"],
|
|
191
|
+
params: { slug },
|
|
192
|
+
}),
|
|
193
|
+
query_params,
|
|
194
|
+
body,
|
|
195
|
+
xHeaders
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @param {Object} arg - Arg object.
|
|
201
|
+
* @param {string} arg.uniqueName - Unique name of Video Room
|
|
202
|
+
* @returns {Promise<GetParticipantsInsideVideoRoomResponse>} - Success response
|
|
203
|
+
* @summary: Get participants of a specific Video Room using it's unique name
|
|
204
|
+
* @description: Get participants of a specific Video Room using it's unique name, this can be used to check if people are already there in the room and also to show their names.
|
|
205
|
+
*/
|
|
206
|
+
getParticipantsInsideVideoRoom({ uniqueName } = {}) {
|
|
207
|
+
const { error } = LeadValidator.getParticipantsInsideVideoRoom().validate(
|
|
208
|
+
{ uniqueName },
|
|
209
|
+
{ abortEarly: false, allowUnknown: true }
|
|
210
|
+
);
|
|
211
|
+
if (error) {
|
|
212
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
213
|
+
}
|
|
214
|
+
const query_params = {};
|
|
215
|
+
|
|
216
|
+
const xHeaders = {};
|
|
217
|
+
|
|
218
|
+
return APIClient.execute(
|
|
219
|
+
this._conf,
|
|
220
|
+
"get",
|
|
221
|
+
constructUrl({
|
|
222
|
+
url: this._urls["getParticipantsInsideVideoRoom"],
|
|
223
|
+
params: { uniqueName },
|
|
224
|
+
}),
|
|
225
|
+
query_params,
|
|
226
|
+
undefined,
|
|
227
|
+
xHeaders
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @param {Object} arg - Arg object.
|
|
233
|
+
* @param {string} arg.uniqueName - Unique name of Video Room
|
|
234
|
+
* @returns {Promise<GetTokenForVideoRoomResponse>} - Success response
|
|
235
|
+
* @summary: Get Token to join a specific Video Room using it's unqiue name
|
|
236
|
+
* @description: Get Token to join a specific Video Room using it's unqiue name, this Token is your ticket to Room and also creates your identity there.
|
|
237
|
+
*/
|
|
238
|
+
getTokenForVideoRoom({ uniqueName } = {}) {
|
|
239
|
+
const { error } = LeadValidator.getTokenForVideoRoom().validate(
|
|
240
|
+
{ uniqueName },
|
|
241
|
+
{ abortEarly: false, allowUnknown: true }
|
|
242
|
+
);
|
|
243
|
+
if (error) {
|
|
244
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
245
|
+
}
|
|
246
|
+
const query_params = {};
|
|
247
|
+
|
|
248
|
+
const xHeaders = {};
|
|
249
|
+
|
|
250
|
+
return APIClient.execute(
|
|
251
|
+
this._conf,
|
|
252
|
+
"get",
|
|
253
|
+
constructUrl({
|
|
254
|
+
url: this._urls["getTokenForVideoRoom"],
|
|
255
|
+
params: { uniqueName },
|
|
256
|
+
}),
|
|
257
|
+
query_params,
|
|
258
|
+
undefined,
|
|
259
|
+
xHeaders
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
module.exports = Lead;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export = Logistic;
|
|
2
|
+
declare class Logistic {
|
|
3
|
+
constructor(_conf: any);
|
|
4
|
+
_conf: any;
|
|
5
|
+
_relativeUrls: {
|
|
6
|
+
getTatProduct: string;
|
|
7
|
+
getPincodeZones: string;
|
|
8
|
+
getPincodeCity: string;
|
|
9
|
+
};
|
|
10
|
+
_urls: {};
|
|
11
|
+
updateUrls(urls: any): void;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Object} arg - Arg object.
|
|
14
|
+
* @param {GetTatProductReqBody} arg.body
|
|
15
|
+
* @returns {Promise<GetTatProductResponse>} - Success response
|
|
16
|
+
* @summary: Get TAT of a product
|
|
17
|
+
* @description: Use this API to know the delivery turnaround time (TAT) by entering the product details along with the PIN Code of the location.
|
|
18
|
+
*/
|
|
19
|
+
getTatProduct({ body }?: {
|
|
20
|
+
body: any;
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* @param {Object} arg - Arg object.
|
|
24
|
+
* @param {GetPincodeZonesReqBody} arg.body
|
|
25
|
+
* @returns {Promise<GetPincodeZonesResponse>} - Success response
|
|
26
|
+
* @summary: Get Pincode Zones
|
|
27
|
+
* @description: Get to know the zones of a specefic pincode
|
|
28
|
+
*/
|
|
29
|
+
getPincodeZones({ body }?: {
|
|
30
|
+
body: any;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* @param {Object} arg - Arg object.
|
|
34
|
+
* @param {string} arg.pincode - The PIN Code of the area, e.g. 400059
|
|
35
|
+
* @returns {Promise<GetPincodeCityResponse>} - Success response
|
|
36
|
+
* @summary: Get city from PIN Code
|
|
37
|
+
* @description: Use this API to retrieve a city by its PIN Code.
|
|
38
|
+
*/
|
|
39
|
+
getPincodeCity({ pincode }?: {
|
|
40
|
+
pincode: string;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
}
|