@aurigma/axios-storefront-api-client 2.41.2 → 2.42.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/dist/cjs/storefront-api-client.d.ts +29 -0
- package/dist/cjs/storefront-api-client.js +62 -0
- package/dist/cjs/storefront-api-client.js.map +1 -1
- package/dist/esm/storefront-api-client.d.ts +29 -0
- package/dist/esm/storefront-api-client.js +62 -0
- package/dist/esm/storefront-api-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -842,6 +842,12 @@ export interface ITenantInfoApiClient {
|
|
|
842
842
|
* @return Success
|
|
843
843
|
*/
|
|
844
844
|
getInfo(tenantId?: number | null | undefined): Promise<TenantInfoDto>;
|
|
845
|
+
/**
|
|
846
|
+
* Returns an information about the tenant measure units.
|
|
847
|
+
* @param tenantId (optional) Tenant identifier.
|
|
848
|
+
* @return Success
|
|
849
|
+
*/
|
|
850
|
+
getMeasureUnitsInfo(tenantId?: number | null | undefined): Promise<TenantMeasureUnitsInfoDto>;
|
|
845
851
|
/**
|
|
846
852
|
* Returns a list of tenant users.
|
|
847
853
|
* @param tenantId (optional) Tenant identifier.
|
|
@@ -868,6 +874,13 @@ export declare class TenantInfoApiClient extends ApiClientBase implements ITenan
|
|
|
868
874
|
*/
|
|
869
875
|
getInfo(tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<TenantInfoDto>;
|
|
870
876
|
protected processGetInfo(response: AxiosResponse): Promise<TenantInfoDto>;
|
|
877
|
+
/**
|
|
878
|
+
* Returns an information about the tenant measure units.
|
|
879
|
+
* @param tenantId (optional) Tenant identifier.
|
|
880
|
+
* @return Success
|
|
881
|
+
*/
|
|
882
|
+
getMeasureUnitsInfo(tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<TenantMeasureUnitsInfoDto>;
|
|
883
|
+
protected processGetMeasureUnitsInfo(response: AxiosResponse): Promise<TenantMeasureUnitsInfoDto>;
|
|
871
884
|
/**
|
|
872
885
|
* Returns a list of tenant users.
|
|
873
886
|
* @param tenantId (optional) Tenant identifier.
|
|
@@ -1428,6 +1441,22 @@ export interface TenantInfoDto {
|
|
|
1428
1441
|
/** Tenant activeness status. */
|
|
1429
1442
|
isActive?: boolean;
|
|
1430
1443
|
}
|
|
1444
|
+
/** Dto class, containing information about size measure unit. */
|
|
1445
|
+
export interface SizeMeasureUnitDto {
|
|
1446
|
+
/** Measure unit full name. */
|
|
1447
|
+
name?: string | null;
|
|
1448
|
+
/** Measure unit short name. */
|
|
1449
|
+
shortName?: string | null;
|
|
1450
|
+
/** Measure unit ratio. */
|
|
1451
|
+
ratio?: number;
|
|
1452
|
+
/** Indicates if measure unit should be used by default. */
|
|
1453
|
+
isDefault?: boolean;
|
|
1454
|
+
}
|
|
1455
|
+
/** Dto class, containing information about tenant measure units. */
|
|
1456
|
+
export interface TenantMeasureUnitsInfoDto {
|
|
1457
|
+
/** A list of all 'size' measure units of the tenant. */
|
|
1458
|
+
sizeMeasureUntis?: SizeMeasureUnitDto[] | null;
|
|
1459
|
+
}
|
|
1431
1460
|
export interface TenantUserInfoDto {
|
|
1432
1461
|
/** Tenant identifier. */
|
|
1433
1462
|
tenantId?: number;
|
|
@@ -3585,6 +3585,68 @@ export class TenantInfoApiClient extends ApiClientBase {
|
|
|
3585
3585
|
}
|
|
3586
3586
|
return Promise.resolve(null);
|
|
3587
3587
|
}
|
|
3588
|
+
/**
|
|
3589
|
+
* Returns an information about the tenant measure units.
|
|
3590
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3591
|
+
* @return Success
|
|
3592
|
+
*/
|
|
3593
|
+
getMeasureUnitsInfo(tenantId, cancelToken) {
|
|
3594
|
+
let url_ = this.baseUrl + "/api/storefront/v1/tenant-info/measure-units?";
|
|
3595
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3596
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3597
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3598
|
+
let options_ = {
|
|
3599
|
+
method: "GET",
|
|
3600
|
+
url: url_,
|
|
3601
|
+
headers: {
|
|
3602
|
+
"Accept": "text/plain"
|
|
3603
|
+
},
|
|
3604
|
+
cancelToken
|
|
3605
|
+
};
|
|
3606
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
3607
|
+
return this.instance.request(transformedOptions_);
|
|
3608
|
+
}).catch((_error) => {
|
|
3609
|
+
if (isAxiosError(_error) && _error.response) {
|
|
3610
|
+
return _error.response;
|
|
3611
|
+
}
|
|
3612
|
+
else {
|
|
3613
|
+
throw _error;
|
|
3614
|
+
}
|
|
3615
|
+
}).then((_response) => {
|
|
3616
|
+
return this.transformResult(url_, _response, (_response) => this.processGetMeasureUnitsInfo(_response));
|
|
3617
|
+
});
|
|
3618
|
+
}
|
|
3619
|
+
processGetMeasureUnitsInfo(response) {
|
|
3620
|
+
const status = response.status;
|
|
3621
|
+
let _headers = {};
|
|
3622
|
+
if (response.headers && typeof response.headers === "object") {
|
|
3623
|
+
for (let k in response.headers) {
|
|
3624
|
+
if (response.headers.hasOwnProperty(k)) {
|
|
3625
|
+
_headers[k] = response.headers[k];
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
if (status === 200) {
|
|
3630
|
+
const _responseText = response.data;
|
|
3631
|
+
let result200 = null;
|
|
3632
|
+
let resultData200 = _responseText;
|
|
3633
|
+
result200 = JSON.parse(resultData200);
|
|
3634
|
+
return Promise.resolve(result200);
|
|
3635
|
+
}
|
|
3636
|
+
else if (status === 401) {
|
|
3637
|
+
const _responseText = response.data;
|
|
3638
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3639
|
+
}
|
|
3640
|
+
else if (status === 403) {
|
|
3641
|
+
const _responseText = response.data;
|
|
3642
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3643
|
+
}
|
|
3644
|
+
else if (status !== 200 && status !== 204) {
|
|
3645
|
+
const _responseText = response.data;
|
|
3646
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3647
|
+
}
|
|
3648
|
+
return Promise.resolve(null);
|
|
3649
|
+
}
|
|
3588
3650
|
/**
|
|
3589
3651
|
* Returns a list of tenant users.
|
|
3590
3652
|
* @param tenantId (optional) Tenant identifier.
|