@gofynd/fdk-client-javascript 1.2.0 → 1.3.0
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/README.md +44 -7
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +3 -3
- package/sdk/application/ApplicationAPIClient.js +6 -4
- package/sdk/application/ApplicationClient.d.ts +2 -3
- package/sdk/application/ApplicationClient.js +1 -45
- package/sdk/application/ApplicationConfig.d.ts +46 -6
- package/sdk/application/ApplicationConfig.js +15 -16
- package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
- package/sdk/application/Cart/CartApplicationClient.js +225 -134
- package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
- package/sdk/application/Cart/CartApplicationModel.js +4 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
- package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
- package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
- package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
- package/sdk/application/Common/CommonApplicationClient.js +13 -11
- package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
- package/sdk/application/Common/CommonApplicationModel.js +2 -58
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
- package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
- package/sdk/application/Content/ContentApplicationClient.js +159 -80
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
- package/sdk/application/Content/ContentApplicationModel.js +11 -763
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
- package/sdk/application/Lead/LeadApplicationClient.js +50 -31
- package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
- package/sdk/application/Lead/LeadApplicationModel.js +21 -481
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
- package/sdk/application/Order/OrderApplicationClient.js +88 -56
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
- package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
- package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
- package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
- package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
- package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
- package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
- package/sdk/application/Share/ShareApplicationClient.js +51 -31
- package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
- package/sdk/application/Share/ShareApplicationModel.js +0 -38
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
- package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
- package/sdk/application/User/UserApplicationClient.d.ts +74 -35
- package/sdk/application/User/UserApplicationClient.js +252 -161
- package/sdk/application/User/UserApplicationModel.d.ts +3 -401
- package/sdk/application/User/UserApplicationModel.js +2 -490
- package/sdk/common/AxiosHelper.js +1 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +5 -4
- package/sdk/partner/PartnerAPIClient.js +7 -4
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
- package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
- package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
- package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
- package/sdk/platform/Cart/CartPlatformModel.js +104 -54
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
- package/sdk/platform/Common/CommonPlatformClient.js +13 -11
- package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
- package/sdk/platform/Common/CommonPlatformModel.js +23 -57
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
- package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
- package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
- package/sdk/platform/Content/ContentPlatformModel.js +8 -231
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
- package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
- package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
- package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
- package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
- package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
- package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
- package/sdk/platform/Order/OrderPlatformClient.js +738 -205
- package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
- package/sdk/platform/Order/OrderPlatformModel.js +225 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
- package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
- package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
- package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
- package/sdk/platform/PlatformAPIClient.d.ts +3 -3
- package/sdk/platform/PlatformAPIClient.js +2 -2
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/platform/PlatformClient.js +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
- package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
- package/sdk/platform/Share/SharePlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
- package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
- package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
- package/sdk/platform/User/UserPlatformModel.js +3 -899
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
- package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
- package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
- package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
- package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
- package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -48
- package/sdk/application/ApplicationModels.js +0 -38
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
|
@@ -10,7 +10,7 @@ export = FileStoragePlatformApplicationValidator;
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef AppCopyFilesParam
|
|
12
12
|
* @property {boolean} [sync] - Sync
|
|
13
|
-
* @property {FileStoragePlatformModel.
|
|
13
|
+
* @property {FileStoragePlatformModel.CopyFiles} body
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* @typedef AppStartUploadParam
|
|
@@ -22,8 +22,35 @@ export = FileStoragePlatformApplicationValidator;
|
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
24
|
* @typedef AppbrowseParam
|
|
25
|
-
* @property {string} namespace -
|
|
26
|
-
*
|
|
25
|
+
* @property {string} namespace - Segregation of different types of
|
|
26
|
+
* files(products, orders, logistics etc), Required for validating the data of
|
|
27
|
+
* the file being uploaded, decides where exactly the file will be stored
|
|
28
|
+
* inside the storage bucket.
|
|
29
|
+
* @property {number} [page] - Page no
|
|
30
|
+
* @property {number} [limit] - Limit
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* @typedef GetDefaultHtmlTemplateParam
|
|
34
|
+
* @property {number} pdfTypeId
|
|
35
|
+
* @property {string} format
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @typedef GetDefaultPdfDataParam
|
|
39
|
+
* @property {number} pdfTypeId
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* @typedef GetDefaultPdfTemplateParam
|
|
43
|
+
* @property {number} pdfTypeId
|
|
44
|
+
* @property {string} format
|
|
45
|
+
*/
|
|
46
|
+
/** @typedef GetPdfTypesParam */
|
|
47
|
+
/**
|
|
48
|
+
* @typedef PreviewTemplateParam
|
|
49
|
+
* @property {FileStoragePlatformModel.pdfRender} body
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* @typedef SaveHtmlTemplateParam
|
|
53
|
+
* @property {FileStoragePlatformModel.pdfConfig} body
|
|
27
54
|
*/
|
|
28
55
|
declare class FileStoragePlatformApplicationValidator {
|
|
29
56
|
/** @returns {AppCompleteUploadParam} */
|
|
@@ -34,9 +61,21 @@ declare class FileStoragePlatformApplicationValidator {
|
|
|
34
61
|
static appStartUpload(): AppStartUploadParam;
|
|
35
62
|
/** @returns {AppbrowseParam} */
|
|
36
63
|
static appbrowse(): AppbrowseParam;
|
|
64
|
+
/** @returns {GetDefaultHtmlTemplateParam} */
|
|
65
|
+
static getDefaultHtmlTemplate(): GetDefaultHtmlTemplateParam;
|
|
66
|
+
/** @returns {GetDefaultPdfDataParam} */
|
|
67
|
+
static getDefaultPdfData(): GetDefaultPdfDataParam;
|
|
68
|
+
/** @returns {GetDefaultPdfTemplateParam} */
|
|
69
|
+
static getDefaultPdfTemplate(): GetDefaultPdfTemplateParam;
|
|
70
|
+
/** @returns {GetPdfTypesParam} */
|
|
71
|
+
static getPdfTypes(): any;
|
|
72
|
+
/** @returns {PreviewTemplateParam} */
|
|
73
|
+
static previewTemplate(): PreviewTemplateParam;
|
|
74
|
+
/** @returns {SaveHtmlTemplateParam} */
|
|
75
|
+
static saveHtmlTemplate(): SaveHtmlTemplateParam;
|
|
37
76
|
}
|
|
38
77
|
declare namespace FileStoragePlatformApplicationValidator {
|
|
39
|
-
export { AppCompleteUploadParam, AppCopyFilesParam, AppStartUploadParam, AppbrowseParam };
|
|
78
|
+
export { AppCompleteUploadParam, AppCopyFilesParam, AppStartUploadParam, AppbrowseParam, GetDefaultHtmlTemplateParam, GetDefaultPdfDataParam, GetDefaultPdfTemplateParam, GetPdfTypesParam, PreviewTemplateParam, SaveHtmlTemplateParam };
|
|
40
79
|
}
|
|
41
80
|
type AppCompleteUploadParam = {
|
|
42
81
|
/**
|
|
@@ -53,7 +92,7 @@ type AppCopyFilesParam = {
|
|
|
53
92
|
* - Sync
|
|
54
93
|
*/
|
|
55
94
|
sync?: boolean;
|
|
56
|
-
body: FileStoragePlatformModel.
|
|
95
|
+
body: FileStoragePlatformModel.CopyFiles;
|
|
57
96
|
};
|
|
58
97
|
type AppStartUploadParam = {
|
|
59
98
|
/**
|
|
@@ -67,12 +106,37 @@ type AppStartUploadParam = {
|
|
|
67
106
|
};
|
|
68
107
|
type AppbrowseParam = {
|
|
69
108
|
/**
|
|
70
|
-
* -
|
|
109
|
+
* - Segregation of different types of
|
|
110
|
+
* files(products, orders, logistics etc), Required for validating the data of
|
|
111
|
+
* the file being uploaded, decides where exactly the file will be stored
|
|
112
|
+
* inside the storage bucket.
|
|
71
113
|
*/
|
|
72
114
|
namespace: string;
|
|
73
115
|
/**
|
|
74
116
|
* - Page no
|
|
75
117
|
*/
|
|
76
|
-
|
|
118
|
+
page?: number;
|
|
119
|
+
/**
|
|
120
|
+
* - Limit
|
|
121
|
+
*/
|
|
122
|
+
limit?: number;
|
|
123
|
+
};
|
|
124
|
+
type GetDefaultHtmlTemplateParam = {
|
|
125
|
+
pdfTypeId: number;
|
|
126
|
+
format: string;
|
|
127
|
+
};
|
|
128
|
+
type GetDefaultPdfDataParam = {
|
|
129
|
+
pdfTypeId: number;
|
|
130
|
+
};
|
|
131
|
+
type GetDefaultPdfTemplateParam = {
|
|
132
|
+
pdfTypeId: number;
|
|
133
|
+
format: string;
|
|
134
|
+
};
|
|
135
|
+
type PreviewTemplateParam = {
|
|
136
|
+
body: FileStoragePlatformModel.pdfRender;
|
|
137
|
+
};
|
|
138
|
+
type SaveHtmlTemplateParam = {
|
|
139
|
+
body: FileStoragePlatformModel.pdfConfig;
|
|
77
140
|
};
|
|
141
|
+
type GetPdfTypesParam = any;
|
|
78
142
|
import FileStoragePlatformModel = require("./FileStoragePlatformModel");
|
|
@@ -14,7 +14,7 @@ const FileStoragePlatformModel = require("./FileStoragePlatformModel");
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef AppCopyFilesParam
|
|
16
16
|
* @property {boolean} [sync] - Sync
|
|
17
|
-
* @property {FileStoragePlatformModel.
|
|
17
|
+
* @property {FileStoragePlatformModel.CopyFiles} body
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -28,8 +28,41 @@ const FileStoragePlatformModel = require("./FileStoragePlatformModel");
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @typedef AppbrowseParam
|
|
31
|
-
* @property {string} namespace -
|
|
32
|
-
*
|
|
31
|
+
* @property {string} namespace - Segregation of different types of
|
|
32
|
+
* files(products, orders, logistics etc), Required for validating the data of
|
|
33
|
+
* the file being uploaded, decides where exactly the file will be stored
|
|
34
|
+
* inside the storage bucket.
|
|
35
|
+
* @property {number} [page] - Page no
|
|
36
|
+
* @property {number} [limit] - Limit
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @typedef GetDefaultHtmlTemplateParam
|
|
41
|
+
* @property {number} pdfTypeId
|
|
42
|
+
* @property {string} format
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @typedef GetDefaultPdfDataParam
|
|
47
|
+
* @property {number} pdfTypeId
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @typedef GetDefaultPdfTemplateParam
|
|
52
|
+
* @property {number} pdfTypeId
|
|
53
|
+
* @property {string} format
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/** @typedef GetPdfTypesParam */
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @typedef PreviewTemplateParam
|
|
60
|
+
* @property {FileStoragePlatformModel.pdfRender} body
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @typedef SaveHtmlTemplateParam
|
|
65
|
+
* @property {FileStoragePlatformModel.pdfConfig} body
|
|
33
66
|
*/
|
|
34
67
|
|
|
35
68
|
class FileStoragePlatformApplicationValidator {
|
|
@@ -47,7 +80,7 @@ class FileStoragePlatformApplicationValidator {
|
|
|
47
80
|
return Joi.object({
|
|
48
81
|
sync: Joi.boolean(),
|
|
49
82
|
|
|
50
|
-
body: FileStoragePlatformModel.
|
|
83
|
+
body: FileStoragePlatformModel.CopyFiles().required(),
|
|
51
84
|
}).required();
|
|
52
85
|
}
|
|
53
86
|
|
|
@@ -65,7 +98,50 @@ class FileStoragePlatformApplicationValidator {
|
|
|
65
98
|
return Joi.object({
|
|
66
99
|
namespace: Joi.string().allow("").required(),
|
|
67
100
|
|
|
68
|
-
|
|
101
|
+
page: Joi.number(),
|
|
102
|
+
limit: Joi.number(),
|
|
103
|
+
}).required();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** @returns {GetDefaultHtmlTemplateParam} */
|
|
107
|
+
static getDefaultHtmlTemplate() {
|
|
108
|
+
return Joi.object({
|
|
109
|
+
pdfTypeId: Joi.number().required(),
|
|
110
|
+
format: Joi.string().allow("").required(),
|
|
111
|
+
}).required();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @returns {GetDefaultPdfDataParam} */
|
|
115
|
+
static getDefaultPdfData() {
|
|
116
|
+
return Joi.object({
|
|
117
|
+
pdfTypeId: Joi.number().required(),
|
|
118
|
+
}).required();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** @returns {GetDefaultPdfTemplateParam} */
|
|
122
|
+
static getDefaultPdfTemplate() {
|
|
123
|
+
return Joi.object({
|
|
124
|
+
pdfTypeId: Joi.number().required(),
|
|
125
|
+
format: Joi.string().allow("").required(),
|
|
126
|
+
}).required();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** @returns {GetPdfTypesParam} */
|
|
130
|
+
static getPdfTypes() {
|
|
131
|
+
return Joi.object({}).required();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** @returns {PreviewTemplateParam} */
|
|
135
|
+
static previewTemplate() {
|
|
136
|
+
return Joi.object({
|
|
137
|
+
body: FileStoragePlatformModel.pdfRender().required(),
|
|
138
|
+
}).required();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** @returns {SaveHtmlTemplateParam} */
|
|
142
|
+
static saveHtmlTemplate() {
|
|
143
|
+
return Joi.object({
|
|
144
|
+
body: FileStoragePlatformModel.pdfConfig().required(),
|
|
69
145
|
}).required();
|
|
70
146
|
}
|
|
71
147
|
}
|
|
@@ -4,25 +4,17 @@ declare class FileStorage {
|
|
|
4
4
|
config: any;
|
|
5
5
|
/**
|
|
6
6
|
* @param {FileStoragePlatformValidator.BrowseParam} arg - Arg object
|
|
7
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
7
8
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
8
9
|
* @returns {Promise<FileStoragePlatformModel.BrowseResponse>} - Success response
|
|
9
10
|
* @name browse
|
|
10
11
|
* @summary: Browse Files
|
|
11
12
|
* @description: Browse Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/browse/).
|
|
12
13
|
*/
|
|
13
|
-
browse({ namespace,
|
|
14
|
-
/**
|
|
15
|
-
* @param {Object} arg - Arg object.
|
|
16
|
-
* @param {string} arg.namespace - Bucket name
|
|
17
|
-
* @returns {Paginator<FileStoragePlatformModel.BrowseResponse>}
|
|
18
|
-
* @summary: Browse Files
|
|
19
|
-
* @description: Browse Files
|
|
20
|
-
*/
|
|
21
|
-
browsePaginator({ namespace }?: {
|
|
22
|
-
namespace: string;
|
|
23
|
-
}): Paginator<FileStoragePlatformModel.BrowseResponse>;
|
|
14
|
+
browse({ namespace, page, limit, requestHeaders }?: FileStoragePlatformValidator.BrowseParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.BrowseResponse>;
|
|
24
15
|
/**
|
|
25
16
|
* @param {FileStoragePlatformValidator.CompleteUploadParam} arg - Arg object
|
|
17
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
26
18
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
27
19
|
* @returns {Promise<FileStoragePlatformModel.CompleteResponse>} - Success response
|
|
28
20
|
* @name completeUpload
|
|
@@ -47,36 +39,40 @@ declare class FileStorage {
|
|
|
47
39
|
* This operation will return the url for the uploaded file.
|
|
48
40
|
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/completeUpload/).
|
|
49
41
|
*/
|
|
50
|
-
completeUpload({ namespace, body }?: FileStoragePlatformValidator.CompleteUploadParam, {
|
|
42
|
+
completeUpload({ namespace, body, requestHeaders }?: FileStoragePlatformValidator.CompleteUploadParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.CompleteResponse>;
|
|
51
43
|
/**
|
|
52
44
|
* @param {FileStoragePlatformValidator.CopyFilesParam} arg - Arg object
|
|
45
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
53
46
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
54
|
-
* @returns {Promise<FileStoragePlatformModel.
|
|
47
|
+
* @returns {Promise<FileStoragePlatformModel.BulkUploadSyncMode>} - Success response
|
|
55
48
|
* @name copyFiles
|
|
56
49
|
* @summary: Copy Files
|
|
57
50
|
* @description: Copy Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/copyFiles/).
|
|
58
51
|
*/
|
|
59
|
-
copyFiles({ body, sync }?: FileStoragePlatformValidator.CopyFilesParam, {
|
|
52
|
+
copyFiles({ body, sync, requestHeaders }?: FileStoragePlatformValidator.CopyFilesParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.BulkUploadSyncMode>;
|
|
60
53
|
/**
|
|
61
54
|
* @param {FileStoragePlatformValidator.GetSignUrlsParam} arg - Arg object
|
|
55
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
62
56
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
63
57
|
* @returns {Promise<FileStoragePlatformModel.SignUrlResponse>} - Success response
|
|
64
58
|
* @name getSignUrls
|
|
65
59
|
* @summary: Gives signed urls to access private files
|
|
66
60
|
* @description: Describe here - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getSignUrls/).
|
|
67
61
|
*/
|
|
68
|
-
getSignUrls({ body }?: FileStoragePlatformValidator.GetSignUrlsParam, {
|
|
62
|
+
getSignUrls({ body, requestHeaders }?: FileStoragePlatformValidator.GetSignUrlsParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.SignUrlResponse>;
|
|
69
63
|
/**
|
|
70
64
|
* @param {FileStoragePlatformValidator.ProxyParam} arg - Arg object
|
|
65
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
71
66
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
72
67
|
* @returns {Promise<string>} - Success response
|
|
73
68
|
* @name proxy
|
|
74
69
|
* @summary: Proxy
|
|
75
70
|
* @description: Proxy - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/proxy/).
|
|
76
71
|
*/
|
|
77
|
-
proxy({ url }?: FileStoragePlatformValidator.ProxyParam, {
|
|
72
|
+
proxy({ url, requestHeaders }?: FileStoragePlatformValidator.ProxyParam, { responseHeaders }?: object): Promise<string>;
|
|
78
73
|
/**
|
|
79
74
|
* @param {FileStoragePlatformValidator.StartUploadParam} arg - Arg object
|
|
75
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
80
76
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
81
77
|
* @returns {Promise<FileStoragePlatformModel.StartResponse>} - Success response
|
|
82
78
|
* @name startUpload
|
|
@@ -101,7 +97,7 @@ declare class FileStorage {
|
|
|
101
97
|
* This operation will return the url for the uploaded file.
|
|
102
98
|
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/startUpload/).
|
|
103
99
|
*/
|
|
104
|
-
startUpload({ namespace, body }?: FileStoragePlatformValidator.StartUploadParam, {
|
|
100
|
+
startUpload({ namespace, body, requestHeaders }?: FileStoragePlatformValidator.StartUploadParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.StartResponse>;
|
|
105
101
|
/**
|
|
106
102
|
* @param data
|
|
107
103
|
* @param {string} file_name
|
|
@@ -121,4 +117,3 @@ declare class FileStorage {
|
|
|
121
117
|
}
|
|
122
118
|
import FileStoragePlatformValidator = require("./FileStoragePlatformValidator");
|
|
123
119
|
import FileStoragePlatformModel = require("./FileStoragePlatformModel");
|
|
124
|
-
import Paginator = require("../../common/Paginator");
|
|
@@ -15,18 +15,23 @@ class FileStorage {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @param {FileStoragePlatformValidator.BrowseParam} arg - Arg object
|
|
18
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
18
19
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
19
20
|
* @returns {Promise<FileStoragePlatformModel.BrowseResponse>} - Success response
|
|
20
21
|
* @name browse
|
|
21
22
|
* @summary: Browse Files
|
|
22
23
|
* @description: Browse Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/browse/).
|
|
23
24
|
*/
|
|
24
|
-
async browse(
|
|
25
|
+
async browse(
|
|
26
|
+
{ namespace, page, limit, requestHeaders } = { requestHeaders: {} },
|
|
27
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
28
|
+
) {
|
|
25
29
|
const { error } = FileStoragePlatformValidator.browse().validate(
|
|
26
30
|
{
|
|
27
31
|
namespace,
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
page,
|
|
34
|
+
limit,
|
|
30
35
|
},
|
|
31
36
|
{ abortEarly: false, allowUnknown: true }
|
|
32
37
|
);
|
|
@@ -39,7 +44,8 @@ class FileStorage {
|
|
|
39
44
|
{
|
|
40
45
|
namespace,
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
page,
|
|
48
|
+
limit,
|
|
43
49
|
},
|
|
44
50
|
{ abortEarly: false, allowUnknown: false }
|
|
45
51
|
);
|
|
@@ -51,22 +57,23 @@ class FileStorage {
|
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
const query_params = {};
|
|
54
|
-
query_params["
|
|
60
|
+
query_params["page"] = page;
|
|
61
|
+
query_params["limit"] = limit;
|
|
55
62
|
|
|
56
63
|
const xHeaders = {};
|
|
57
64
|
|
|
58
65
|
const response = await PlatformAPIClient.execute(
|
|
59
66
|
this.config,
|
|
60
67
|
"get",
|
|
61
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/browse
|
|
68
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/browse`,
|
|
62
69
|
query_params,
|
|
63
70
|
undefined,
|
|
64
|
-
xHeaders,
|
|
65
|
-
{
|
|
71
|
+
{ ...xHeaders, ...requestHeaders },
|
|
72
|
+
{ responseHeaders }
|
|
66
73
|
);
|
|
67
74
|
|
|
68
75
|
let responseData = response;
|
|
69
|
-
if (
|
|
76
|
+
if (responseHeaders) {
|
|
70
77
|
responseData = response[0];
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -87,36 +94,9 @@ class FileStorage {
|
|
|
87
94
|
return response;
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
/**
|
|
91
|
-
* @param {Object} arg - Arg object.
|
|
92
|
-
* @param {string} arg.namespace - Bucket name
|
|
93
|
-
* @returns {Paginator<FileStoragePlatformModel.BrowseResponse>}
|
|
94
|
-
* @summary: Browse Files
|
|
95
|
-
* @description: Browse Files
|
|
96
|
-
*/
|
|
97
|
-
browsePaginator({ namespace } = {}) {
|
|
98
|
-
const paginator = new Paginator();
|
|
99
|
-
const callback = async () => {
|
|
100
|
-
const pageId = paginator.nextId;
|
|
101
|
-
const pageNo = paginator.pageNo;
|
|
102
|
-
const pageType = "number";
|
|
103
|
-
const data = await this.browse({
|
|
104
|
-
namespace: namespace,
|
|
105
|
-
|
|
106
|
-
pageNo: pageNo,
|
|
107
|
-
});
|
|
108
|
-
paginator.setPaginator({
|
|
109
|
-
hasNext: data.page.has_next ? true : false,
|
|
110
|
-
nextId: data.page.next_id,
|
|
111
|
-
});
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
paginator.setCallback(callback.bind(this));
|
|
115
|
-
return paginator;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
97
|
/**
|
|
119
98
|
* @param {FileStoragePlatformValidator.CompleteUploadParam} arg - Arg object
|
|
99
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
120
100
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
121
101
|
* @returns {Promise<FileStoragePlatformModel.CompleteResponse>} - Success response
|
|
122
102
|
* @name completeUpload
|
|
@@ -142,8 +122,8 @@ class FileStorage {
|
|
|
142
122
|
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/completeUpload/).
|
|
143
123
|
*/
|
|
144
124
|
async completeUpload(
|
|
145
|
-
{ namespace, body } = {},
|
|
146
|
-
{
|
|
125
|
+
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
126
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
147
127
|
) {
|
|
148
128
|
const { error } = FileStoragePlatformValidator.completeUpload().validate(
|
|
149
129
|
{
|
|
@@ -182,15 +162,15 @@ class FileStorage {
|
|
|
182
162
|
const response = await PlatformAPIClient.execute(
|
|
183
163
|
this.config,
|
|
184
164
|
"post",
|
|
185
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/complete
|
|
165
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/complete`,
|
|
186
166
|
query_params,
|
|
187
167
|
body,
|
|
188
|
-
xHeaders,
|
|
189
|
-
{
|
|
168
|
+
{ ...xHeaders, ...requestHeaders },
|
|
169
|
+
{ responseHeaders }
|
|
190
170
|
);
|
|
191
171
|
|
|
192
172
|
let responseData = response;
|
|
193
|
-
if (
|
|
173
|
+
if (responseHeaders) {
|
|
194
174
|
responseData = response[0];
|
|
195
175
|
}
|
|
196
176
|
|
|
@@ -213,13 +193,17 @@ class FileStorage {
|
|
|
213
193
|
|
|
214
194
|
/**
|
|
215
195
|
* @param {FileStoragePlatformValidator.CopyFilesParam} arg - Arg object
|
|
196
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
216
197
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
217
|
-
* @returns {Promise<FileStoragePlatformModel.
|
|
198
|
+
* @returns {Promise<FileStoragePlatformModel.BulkUploadSyncMode>} - Success response
|
|
218
199
|
* @name copyFiles
|
|
219
200
|
* @summary: Copy Files
|
|
220
201
|
* @description: Copy Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/copyFiles/).
|
|
221
202
|
*/
|
|
222
|
-
async copyFiles(
|
|
203
|
+
async copyFiles(
|
|
204
|
+
{ body, sync, requestHeaders } = { requestHeaders: {} },
|
|
205
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
206
|
+
) {
|
|
223
207
|
const { error } = FileStoragePlatformValidator.copyFiles().validate(
|
|
224
208
|
{
|
|
225
209
|
body,
|
|
@@ -256,21 +240,21 @@ class FileStorage {
|
|
|
256
240
|
const response = await PlatformAPIClient.execute(
|
|
257
241
|
this.config,
|
|
258
242
|
"post",
|
|
259
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/uploads/copy
|
|
243
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/uploads/copy`,
|
|
260
244
|
query_params,
|
|
261
245
|
body,
|
|
262
|
-
xHeaders,
|
|
263
|
-
{
|
|
246
|
+
{ ...xHeaders, ...requestHeaders },
|
|
247
|
+
{ responseHeaders }
|
|
264
248
|
);
|
|
265
249
|
|
|
266
250
|
let responseData = response;
|
|
267
|
-
if (
|
|
251
|
+
if (responseHeaders) {
|
|
268
252
|
responseData = response[0];
|
|
269
253
|
}
|
|
270
254
|
|
|
271
255
|
const {
|
|
272
256
|
error: res_error,
|
|
273
|
-
} = FileStoragePlatformModel.
|
|
257
|
+
} = FileStoragePlatformModel.BulkUploadSyncMode().validate(responseData, {
|
|
274
258
|
abortEarly: false,
|
|
275
259
|
allowUnknown: false,
|
|
276
260
|
});
|
|
@@ -287,13 +271,17 @@ class FileStorage {
|
|
|
287
271
|
|
|
288
272
|
/**
|
|
289
273
|
* @param {FileStoragePlatformValidator.GetSignUrlsParam} arg - Arg object
|
|
274
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
290
275
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
291
276
|
* @returns {Promise<FileStoragePlatformModel.SignUrlResponse>} - Success response
|
|
292
277
|
* @name getSignUrls
|
|
293
278
|
* @summary: Gives signed urls to access private files
|
|
294
279
|
* @description: Describe here - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getSignUrls/).
|
|
295
280
|
*/
|
|
296
|
-
async getSignUrls(
|
|
281
|
+
async getSignUrls(
|
|
282
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
283
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
284
|
+
) {
|
|
297
285
|
const { error } = FileStoragePlatformValidator.getSignUrls().validate(
|
|
298
286
|
{
|
|
299
287
|
body,
|
|
@@ -327,15 +315,15 @@ class FileStorage {
|
|
|
327
315
|
const response = await PlatformAPIClient.execute(
|
|
328
316
|
this.config,
|
|
329
317
|
"post",
|
|
330
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/sign-urls
|
|
318
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/sign-urls`,
|
|
331
319
|
query_params,
|
|
332
320
|
body,
|
|
333
|
-
xHeaders,
|
|
334
|
-
{
|
|
321
|
+
{ ...xHeaders, ...requestHeaders },
|
|
322
|
+
{ responseHeaders }
|
|
335
323
|
);
|
|
336
324
|
|
|
337
325
|
let responseData = response;
|
|
338
|
-
if (
|
|
326
|
+
if (responseHeaders) {
|
|
339
327
|
responseData = response[0];
|
|
340
328
|
}
|
|
341
329
|
|
|
@@ -358,13 +346,17 @@ class FileStorage {
|
|
|
358
346
|
|
|
359
347
|
/**
|
|
360
348
|
* @param {FileStoragePlatformValidator.ProxyParam} arg - Arg object
|
|
349
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
361
350
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
362
351
|
* @returns {Promise<string>} - Success response
|
|
363
352
|
* @name proxy
|
|
364
353
|
* @summary: Proxy
|
|
365
354
|
* @description: Proxy - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/proxy/).
|
|
366
355
|
*/
|
|
367
|
-
async proxy(
|
|
356
|
+
async proxy(
|
|
357
|
+
{ url, requestHeaders } = { requestHeaders: {} },
|
|
358
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
359
|
+
) {
|
|
368
360
|
const { error } = FileStoragePlatformValidator.proxy().validate(
|
|
369
361
|
{
|
|
370
362
|
url,
|
|
@@ -397,15 +389,15 @@ class FileStorage {
|
|
|
397
389
|
const response = await PlatformAPIClient.execute(
|
|
398
390
|
this.config,
|
|
399
391
|
"get",
|
|
400
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/proxy
|
|
392
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/proxy`,
|
|
401
393
|
query_params,
|
|
402
394
|
undefined,
|
|
403
|
-
xHeaders,
|
|
404
|
-
{
|
|
395
|
+
{ ...xHeaders, ...requestHeaders },
|
|
396
|
+
{ responseHeaders }
|
|
405
397
|
);
|
|
406
398
|
|
|
407
399
|
let responseData = response;
|
|
408
|
-
if (
|
|
400
|
+
if (responseHeaders) {
|
|
409
401
|
responseData = response[0];
|
|
410
402
|
}
|
|
411
403
|
|
|
@@ -425,6 +417,7 @@ class FileStorage {
|
|
|
425
417
|
|
|
426
418
|
/**
|
|
427
419
|
* @param {FileStoragePlatformValidator.StartUploadParam} arg - Arg object
|
|
420
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
428
421
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
429
422
|
* @returns {Promise<FileStoragePlatformModel.StartResponse>} - Success response
|
|
430
423
|
* @name startUpload
|
|
@@ -450,8 +443,8 @@ class FileStorage {
|
|
|
450
443
|
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/startUpload/).
|
|
451
444
|
*/
|
|
452
445
|
async startUpload(
|
|
453
|
-
{ namespace, body } = {},
|
|
454
|
-
{
|
|
446
|
+
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
447
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
455
448
|
) {
|
|
456
449
|
const { error } = FileStoragePlatformValidator.startUpload().validate(
|
|
457
450
|
{
|
|
@@ -490,15 +483,15 @@ class FileStorage {
|
|
|
490
483
|
const response = await PlatformAPIClient.execute(
|
|
491
484
|
this.config,
|
|
492
485
|
"post",
|
|
493
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/start
|
|
486
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/start`,
|
|
494
487
|
query_params,
|
|
495
488
|
body,
|
|
496
|
-
xHeaders,
|
|
497
|
-
{
|
|
489
|
+
{ ...xHeaders, ...requestHeaders },
|
|
490
|
+
{ responseHeaders }
|
|
498
491
|
);
|
|
499
492
|
|
|
500
493
|
let responseData = response;
|
|
501
|
-
if (
|
|
494
|
+
if (responseHeaders) {
|
|
502
495
|
responseData = response[0];
|
|
503
496
|
}
|
|
504
497
|
|