@gofynd/fdk-client-javascript 3.0.0-beta.1 → 3.1.0-beta.1
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 +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +14 -14
- package/sdk/application/Cart/CartApplicationClient.js +14 -14
- package/sdk/application/Content/ContentApplicationClient.d.ts +10 -0
- package/sdk/application/Content/ContentApplicationClient.js +53 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -6
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +136 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +12 -12
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +12 -12
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +46 -33
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +41 -25
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +4 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +6 -397
- package/sdk/platform/Billing/BillingPlatformClient.js +77 -3215
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +417 -3811
- package/sdk/platform/Billing/BillingPlatformModel.js +292 -2544
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +12 -451
- package/sdk/platform/Billing/BillingPlatformValidator.js +8 -483
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -34
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +34 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +363 -29
- package/sdk/platform/Cart/CartPlatformModel.js +203 -31
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +220 -200
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +121 -91
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +58 -46
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +10 -51
- package/sdk/platform/Catalog/CatalogPlatformClient.js +79 -400
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +22 -228
- package/sdk/platform/Catalog/CatalogPlatformModel.js +12 -163
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +15 -61
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -65
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +4 -8
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +10 -14
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +94 -30
- package/sdk/platform/Communication/CommunicationPlatformModel.js +110 -32
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +33 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +62 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +11 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +5 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +12 -2
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -1
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +6 -4
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +12 -10
- package/sdk/platform/Content/ContentPlatformModel.d.ts +42 -12
- package/sdk/platform/Content/ContentPlatformModel.js +43 -13
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
- package/sdk/platform/Order/OrderPlatformClient.d.ts +21 -21
- package/sdk/platform/Order/OrderPlatformClient.js +21 -21
- package/sdk/platform/Order/OrderPlatformModel.d.ts +1010 -80
- package/sdk/platform/Order/OrderPlatformModel.js +665 -70
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +31 -4
- package/sdk/platform/Payment/PaymentPlatformModel.js +11 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +8 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +14 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +24 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +119 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +194 -23
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +116 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +23 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +16 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
- package/sdk/platform/Share/SharePlatformModel.js +2 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +10 -12
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +45 -49
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +10 -10
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +12 -12
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/public/Billing/BillingPublicClient.d.ts +0 -56
- package/sdk/public/Billing/BillingPublicClient.js +0 -397
- package/sdk/public/Billing/BillingPublicModel.d.ts +0 -919
- package/sdk/public/Billing/BillingPublicModel.js +0 -560
- package/sdk/public/Billing/BillingPublicValidator.d.ts +0 -43
- package/sdk/public/Billing/BillingPublicValidator.js +0 -50
|
@@ -633,11 +633,17 @@ export = PaymentPlatformModel;
|
|
|
633
633
|
/**
|
|
634
634
|
* @typedef MultiTenderPaymentMeta
|
|
635
635
|
* @property {Object} [extra_meta]
|
|
636
|
-
* @property {string} [order_id]
|
|
637
|
-
* @property {string} [payment_id]
|
|
638
|
-
*
|
|
636
|
+
* @property {string} [order_id] - Fynd Platform order ID
|
|
637
|
+
* @property {string} [payment_id] - A unique identifier associated with a
|
|
638
|
+
* specific payment transaction
|
|
639
|
+
* @property {string} [current_status] - Represents the current state or
|
|
640
|
+
* condition of an object, such as an order or payment.
|
|
639
641
|
* @property {string} [payment_gateway]
|
|
640
|
-
* @property {string} [key]
|
|
642
|
+
* @property {string} [key] - Specifies the name or identifier of the payment
|
|
643
|
+
* gateway. This will deprecated in future version. We recommend switching to
|
|
644
|
+
* `payment_gateway_slug` to ensure uninterrupted payment processing.
|
|
645
|
+
* @property {string} [payment_gateway_slug] - A simplified, URL-friendly string
|
|
646
|
+
* that represents the name of the payment gateway and it will used for refund PG.
|
|
641
647
|
*/
|
|
642
648
|
/**
|
|
643
649
|
* @typedef MultiTenderPaymentMethod
|
|
@@ -3443,11 +3449,32 @@ type OrderBeneficiaryResponse = {
|
|
|
3443
3449
|
declare function MultiTenderPaymentMeta(): MultiTenderPaymentMeta;
|
|
3444
3450
|
type MultiTenderPaymentMeta = {
|
|
3445
3451
|
extra_meta?: any;
|
|
3452
|
+
/**
|
|
3453
|
+
* - Fynd Platform order ID
|
|
3454
|
+
*/
|
|
3446
3455
|
order_id?: string;
|
|
3456
|
+
/**
|
|
3457
|
+
* - A unique identifier associated with a
|
|
3458
|
+
* specific payment transaction
|
|
3459
|
+
*/
|
|
3447
3460
|
payment_id?: string;
|
|
3461
|
+
/**
|
|
3462
|
+
* - Represents the current state or
|
|
3463
|
+
* condition of an object, such as an order or payment.
|
|
3464
|
+
*/
|
|
3448
3465
|
current_status?: string;
|
|
3449
3466
|
payment_gateway?: string;
|
|
3467
|
+
/**
|
|
3468
|
+
* - Specifies the name or identifier of the payment
|
|
3469
|
+
* gateway. This will deprecated in future version. We recommend switching to
|
|
3470
|
+
* `payment_gateway_slug` to ensure uninterrupted payment processing.
|
|
3471
|
+
*/
|
|
3450
3472
|
key?: string;
|
|
3473
|
+
/**
|
|
3474
|
+
* - A simplified, URL-friendly string
|
|
3475
|
+
* that represents the name of the payment gateway and it will used for refund PG.
|
|
3476
|
+
*/
|
|
3477
|
+
payment_gateway_slug?: string;
|
|
3451
3478
|
};
|
|
3452
3479
|
/** @returns {MultiTenderPaymentMethod} */
|
|
3453
3480
|
declare function MultiTenderPaymentMethod(): MultiTenderPaymentMethod;
|
|
@@ -704,11 +704,17 @@ const Joi = require("joi");
|
|
|
704
704
|
/**
|
|
705
705
|
* @typedef MultiTenderPaymentMeta
|
|
706
706
|
* @property {Object} [extra_meta]
|
|
707
|
-
* @property {string} [order_id]
|
|
708
|
-
* @property {string} [payment_id]
|
|
709
|
-
*
|
|
707
|
+
* @property {string} [order_id] - Fynd Platform order ID
|
|
708
|
+
* @property {string} [payment_id] - A unique identifier associated with a
|
|
709
|
+
* specific payment transaction
|
|
710
|
+
* @property {string} [current_status] - Represents the current state or
|
|
711
|
+
* condition of an object, such as an order or payment.
|
|
710
712
|
* @property {string} [payment_gateway]
|
|
711
|
-
* @property {string} [key]
|
|
713
|
+
* @property {string} [key] - Specifies the name or identifier of the payment
|
|
714
|
+
* gateway. This will deprecated in future version. We recommend switching to
|
|
715
|
+
* `payment_gateway_slug` to ensure uninterrupted payment processing.
|
|
716
|
+
* @property {string} [payment_gateway_slug] - A simplified, URL-friendly string
|
|
717
|
+
* that represents the name of the payment gateway and it will used for refund PG.
|
|
712
718
|
*/
|
|
713
719
|
|
|
714
720
|
/**
|
|
@@ -3301,6 +3307,7 @@ class PaymentPlatformModel {
|
|
|
3301
3307
|
current_status: Joi.string().allow(""),
|
|
3302
3308
|
payment_gateway: Joi.string().allow(""),
|
|
3303
3309
|
key: Joi.string().allow(""),
|
|
3310
|
+
payment_gateway_slug: Joi.string().allow(""),
|
|
3304
3311
|
});
|
|
3305
3312
|
}
|
|
3306
3313
|
|
|
@@ -369,7 +369,7 @@ declare class Serviceability {
|
|
|
369
369
|
* @summary: Get zones
|
|
370
370
|
* @description: Retrieves a list of delivery zones. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getZones/).
|
|
371
371
|
*/
|
|
372
|
-
getZones({ stage, type, pageSize, pageNo, isActive, q, countryIsoCode, pincode, state, city, sector, requestHeaders, }?: ServiceabilityPlatformApplicationValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponseV2>;
|
|
372
|
+
getZones({ stage, type, accessLevel, status, pageSize, pageNo, isActive, q, countryIsoCode, pincode, state, city, sector, requestHeaders, }?: ServiceabilityPlatformApplicationValidator.GetZonesParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.ListViewResponseV2>;
|
|
373
373
|
/**
|
|
374
374
|
* @param {ServiceabilityPlatformApplicationValidator.InsertApplicationConfigParam} arg
|
|
375
375
|
* - Arg object
|
|
@@ -2280,6 +2280,8 @@ class Serviceability {
|
|
|
2280
2280
|
{
|
|
2281
2281
|
stage,
|
|
2282
2282
|
type,
|
|
2283
|
+
accessLevel,
|
|
2284
|
+
status,
|
|
2283
2285
|
pageSize,
|
|
2284
2286
|
pageNo,
|
|
2285
2287
|
isActive,
|
|
@@ -2299,6 +2301,8 @@ class Serviceability {
|
|
|
2299
2301
|
{
|
|
2300
2302
|
stage,
|
|
2301
2303
|
type,
|
|
2304
|
+
accessLevel,
|
|
2305
|
+
status,
|
|
2302
2306
|
pageSize,
|
|
2303
2307
|
pageNo,
|
|
2304
2308
|
isActive,
|
|
@@ -2322,6 +2326,8 @@ class Serviceability {
|
|
|
2322
2326
|
{
|
|
2323
2327
|
stage,
|
|
2324
2328
|
type,
|
|
2329
|
+
accessLevel,
|
|
2330
|
+
status,
|
|
2325
2331
|
pageSize,
|
|
2326
2332
|
pageNo,
|
|
2327
2333
|
isActive,
|
|
@@ -2344,6 +2350,8 @@ class Serviceability {
|
|
|
2344
2350
|
const query_params = {};
|
|
2345
2351
|
query_params["stage"] = stage;
|
|
2346
2352
|
query_params["type"] = type;
|
|
2353
|
+
query_params["access_level"] = accessLevel;
|
|
2354
|
+
query_params["status"] = status;
|
|
2347
2355
|
query_params["page_size"] = pageSize;
|
|
2348
2356
|
query_params["page_no"] = pageNo;
|
|
2349
2357
|
query_params["is_active"] = isActive;
|
|
@@ -115,6 +115,10 @@ export = ServiceabilityPlatformApplicationValidator;
|
|
|
115
115
|
* @typedef GetZonesParam
|
|
116
116
|
* @property {string} [stage] - Identifies the specific stage of zone bing requested.
|
|
117
117
|
* @property {string} [type] - Using type, you can filter custom or default zones
|
|
118
|
+
* @property {string} [accessLevel] - Using access level, you can filter public
|
|
119
|
+
* and private zones as marketplace owner
|
|
120
|
+
* @property {string} [status] - Using status zones listing can be filttered for
|
|
121
|
+
* marketplace owner and 3p sellers
|
|
118
122
|
* @property {number} [pageSize] - Defines the number of items displayed per page.
|
|
119
123
|
* @property {number} [pageNo] - Current page number.
|
|
120
124
|
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
@@ -454,6 +458,16 @@ type GetZonesParam = {
|
|
|
454
458
|
* - Using type, you can filter custom or default zones
|
|
455
459
|
*/
|
|
456
460
|
type?: string;
|
|
461
|
+
/**
|
|
462
|
+
* - Using access level, you can filter public
|
|
463
|
+
* and private zones as marketplace owner
|
|
464
|
+
*/
|
|
465
|
+
accessLevel?: string;
|
|
466
|
+
/**
|
|
467
|
+
* - Using status zones listing can be filttered for
|
|
468
|
+
* marketplace owner and 3p sellers
|
|
469
|
+
*/
|
|
470
|
+
status?: string;
|
|
457
471
|
/**
|
|
458
472
|
* - Defines the number of items displayed per page.
|
|
459
473
|
*/
|
|
@@ -145,6 +145,10 @@ const ServiceabilityPlatformModel = require("./ServiceabilityPlatformModel");
|
|
|
145
145
|
* @typedef GetZonesParam
|
|
146
146
|
* @property {string} [stage] - Identifies the specific stage of zone bing requested.
|
|
147
147
|
* @property {string} [type] - Using type, you can filter custom or default zones
|
|
148
|
+
* @property {string} [accessLevel] - Using access level, you can filter public
|
|
149
|
+
* and private zones as marketplace owner
|
|
150
|
+
* @property {string} [status] - Using status zones listing can be filttered for
|
|
151
|
+
* marketplace owner and 3p sellers
|
|
148
152
|
* @property {number} [pageSize] - Defines the number of items displayed per page.
|
|
149
153
|
* @property {number} [pageNo] - Current page number.
|
|
150
154
|
* @property {boolean} [isActive] - Status of Zone (either active or inactive)
|
|
@@ -437,6 +441,8 @@ class ServiceabilityPlatformApplicationValidator {
|
|
|
437
441
|
return Joi.object({
|
|
438
442
|
stage: Joi.string().allow(""),
|
|
439
443
|
type: Joi.string().allow(""),
|
|
444
|
+
accessLevel: Joi.string().allow(""),
|
|
445
|
+
status: Joi.string().allow(""),
|
|
440
446
|
pageSize: Joi.number(),
|
|
441
447
|
pageNo: Joi.number(),
|
|
442
448
|
isActive: Joi.boolean(),
|
|
@@ -174,6 +174,30 @@ declare class Serviceability {
|
|
|
174
174
|
q?: string;
|
|
175
175
|
name?: string;
|
|
176
176
|
}): Paginator<ServiceabilityPlatformModel.GetLocalities>;
|
|
177
|
+
/**
|
|
178
|
+
* @param {ServiceabilityPlatformValidator.GetLocalitiesByPrefixParam} arg
|
|
179
|
+
* - Arg object
|
|
180
|
+
*
|
|
181
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
182
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
183
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetLocalities>} - Success response
|
|
184
|
+
* @name getLocalitiesByPrefix
|
|
185
|
+
* @summary: Get Localities by Name Prefix
|
|
186
|
+
* @description: Get localities that start with a specified prefix. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getLocalitiesByPrefix/).
|
|
187
|
+
*/
|
|
188
|
+
getLocalitiesByPrefix({ pageNo, pageSize, q, requestHeaders }?: ServiceabilityPlatformValidator.GetLocalitiesByPrefixParam, { responseHeaders }?: object): Promise<ServiceabilityPlatformModel.GetLocalities>;
|
|
189
|
+
/**
|
|
190
|
+
* @param {Object} arg - Arg object.
|
|
191
|
+
* @param {number} [arg.pageSize] - Number of items per page.
|
|
192
|
+
* @param {string} [arg.q] - Localities starting with the specified prefix.
|
|
193
|
+
* @returns {Paginator<ServiceabilityPlatformModel.GetLocalities>}
|
|
194
|
+
* @summary: Get Localities by Name Prefix
|
|
195
|
+
* @description: Get localities that start with a specified prefix.
|
|
196
|
+
*/
|
|
197
|
+
getLocalitiesByPrefixPaginator({ pageSize, q }?: {
|
|
198
|
+
pageSize?: number;
|
|
199
|
+
q?: string;
|
|
200
|
+
}): Paginator<ServiceabilityPlatformModel.GetLocalities>;
|
|
177
201
|
/**
|
|
178
202
|
* @param {ServiceabilityPlatformValidator.GetLocalityParam} arg - Arg object
|
|
179
203
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -1148,6 +1148,125 @@ class Serviceability {
|
|
|
1148
1148
|
return paginator;
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
/**
|
|
1152
|
+
* @param {ServiceabilityPlatformValidator.GetLocalitiesByPrefixParam} arg
|
|
1153
|
+
* - Arg object
|
|
1154
|
+
*
|
|
1155
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1156
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1157
|
+
* @returns {Promise<ServiceabilityPlatformModel.GetLocalities>} - Success response
|
|
1158
|
+
* @name getLocalitiesByPrefix
|
|
1159
|
+
* @summary: Get Localities by Name Prefix
|
|
1160
|
+
* @description: Get localities that start with a specified prefix. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/serviceability/getLocalitiesByPrefix/).
|
|
1161
|
+
*/
|
|
1162
|
+
async getLocalitiesByPrefix(
|
|
1163
|
+
{ pageNo, pageSize, q, requestHeaders } = { requestHeaders: {} },
|
|
1164
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1165
|
+
) {
|
|
1166
|
+
const {
|
|
1167
|
+
error,
|
|
1168
|
+
} = ServiceabilityPlatformValidator.getLocalitiesByPrefix().validate(
|
|
1169
|
+
{
|
|
1170
|
+
pageNo,
|
|
1171
|
+
pageSize,
|
|
1172
|
+
q,
|
|
1173
|
+
},
|
|
1174
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1175
|
+
);
|
|
1176
|
+
if (error) {
|
|
1177
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// Showing warrnings if extra unknown parameters are found
|
|
1181
|
+
const {
|
|
1182
|
+
error: warrning,
|
|
1183
|
+
} = ServiceabilityPlatformValidator.getLocalitiesByPrefix().validate(
|
|
1184
|
+
{
|
|
1185
|
+
pageNo,
|
|
1186
|
+
pageSize,
|
|
1187
|
+
q,
|
|
1188
|
+
},
|
|
1189
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1190
|
+
);
|
|
1191
|
+
if (warrning) {
|
|
1192
|
+
Logger({
|
|
1193
|
+
level: "WARN",
|
|
1194
|
+
message: `Parameter Validation warrnings for platform > Serviceability > getLocalitiesByPrefix \n ${warrning}`,
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
const query_params = {};
|
|
1199
|
+
query_params["page_no"] = pageNo;
|
|
1200
|
+
query_params["page_size"] = pageSize;
|
|
1201
|
+
query_params["q"] = q;
|
|
1202
|
+
|
|
1203
|
+
const xHeaders = {};
|
|
1204
|
+
|
|
1205
|
+
const response = await PlatformAPIClient.execute(
|
|
1206
|
+
this.config,
|
|
1207
|
+
"get",
|
|
1208
|
+
`/service/platform/logistics/v1.0/company/${this.config.companyId}/localities`,
|
|
1209
|
+
query_params,
|
|
1210
|
+
undefined,
|
|
1211
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1212
|
+
{ responseHeaders }
|
|
1213
|
+
);
|
|
1214
|
+
|
|
1215
|
+
let responseData = response;
|
|
1216
|
+
if (responseHeaders) {
|
|
1217
|
+
responseData = response[0];
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
const {
|
|
1221
|
+
error: res_error,
|
|
1222
|
+
} = ServiceabilityPlatformModel.GetLocalities().validate(responseData, {
|
|
1223
|
+
abortEarly: false,
|
|
1224
|
+
allowUnknown: true,
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
if (res_error) {
|
|
1228
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
1229
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1230
|
+
} else {
|
|
1231
|
+
Logger({
|
|
1232
|
+
level: "WARN",
|
|
1233
|
+
message: `Response Validation Warnings for platform > Serviceability > getLocalitiesByPrefix \n ${res_error}`,
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
return response;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* @param {Object} arg - Arg object.
|
|
1243
|
+
* @param {number} [arg.pageSize] - Number of items per page.
|
|
1244
|
+
* @param {string} [arg.q] - Localities starting with the specified prefix.
|
|
1245
|
+
* @returns {Paginator<ServiceabilityPlatformModel.GetLocalities>}
|
|
1246
|
+
* @summary: Get Localities by Name Prefix
|
|
1247
|
+
* @description: Get localities that start with a specified prefix.
|
|
1248
|
+
*/
|
|
1249
|
+
getLocalitiesByPrefixPaginator({ pageSize, q } = {}) {
|
|
1250
|
+
const paginator = new Paginator();
|
|
1251
|
+
const callback = async () => {
|
|
1252
|
+
const pageId = paginator.nextId;
|
|
1253
|
+
const pageNo = paginator.pageNo;
|
|
1254
|
+
const pageType = "number";
|
|
1255
|
+
const data = await this.getLocalitiesByPrefix({
|
|
1256
|
+
pageNo: pageNo,
|
|
1257
|
+
pageSize: pageSize,
|
|
1258
|
+
q: q,
|
|
1259
|
+
});
|
|
1260
|
+
paginator.setPaginator({
|
|
1261
|
+
hasNext: data.page.has_next ? true : false,
|
|
1262
|
+
nextId: data.page.next_id,
|
|
1263
|
+
});
|
|
1264
|
+
return data;
|
|
1265
|
+
};
|
|
1266
|
+
paginator.setCallback(callback.bind(this));
|
|
1267
|
+
return paginator;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1151
1270
|
/**
|
|
1152
1271
|
* @param {ServiceabilityPlatformValidator.GetLocalityParam} arg - Arg object
|
|
1153
1272
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|