@ignos/api-client 20250521.0.11811 → 20250526.0.11831
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/lib/ignosportal-api.d.ts +55 -0
- package/lib/ignosportal-api.js +331 -0
- package/package.json +1 -1
- package/src/ignosportal-api.ts +370 -0
package/lib/ignosportal-api.d.ts
CHANGED
|
@@ -1737,6 +1737,34 @@ export declare class MoveTrackingClient extends AuthorizedApiBase implements IMo
|
|
|
1737
1737
|
deleteTrackingHistory(trackingId: string): Promise<void>;
|
|
1738
1738
|
protected processDeleteTrackingHistory(response: Response): Promise<void>;
|
|
1739
1739
|
}
|
|
1740
|
+
export interface IParcelCategoryClient {
|
|
1741
|
+
getSettings(): Promise<ParcelCategorySettingsDto>;
|
|
1742
|
+
create(cmd: CreateParcelCategoryCommand): Promise<string>;
|
|
1743
|
+
listCategories(): Promise<string[]>;
|
|
1744
|
+
assign(kind: ParcelKindDto, labels: string[]): Promise<FileResponse>;
|
|
1745
|
+
delete(label: string): Promise<void>;
|
|
1746
|
+
removeAssignment(kind: ParcelKindDto, label: string): Promise<FileResponse>;
|
|
1747
|
+
}
|
|
1748
|
+
export declare class ParcelCategoryClient extends AuthorizedApiBase implements IParcelCategoryClient {
|
|
1749
|
+
private http;
|
|
1750
|
+
private baseUrl;
|
|
1751
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
1752
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: {
|
|
1753
|
+
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1754
|
+
});
|
|
1755
|
+
getSettings(): Promise<ParcelCategorySettingsDto>;
|
|
1756
|
+
protected processGetSettings(response: Response): Promise<ParcelCategorySettingsDto>;
|
|
1757
|
+
create(cmd: CreateParcelCategoryCommand): Promise<string>;
|
|
1758
|
+
protected processCreate(response: Response): Promise<string>;
|
|
1759
|
+
listCategories(): Promise<string[]>;
|
|
1760
|
+
protected processListCategories(response: Response): Promise<string[]>;
|
|
1761
|
+
assign(kind: ParcelKindDto, labels: string[]): Promise<FileResponse>;
|
|
1762
|
+
protected processAssign(response: Response): Promise<FileResponse>;
|
|
1763
|
+
delete(label: string): Promise<void>;
|
|
1764
|
+
protected processDelete(response: Response): Promise<void>;
|
|
1765
|
+
removeAssignment(kind: ParcelKindDto, label: string): Promise<FileResponse>;
|
|
1766
|
+
protected processRemoveAssignment(response: Response): Promise<FileResponse>;
|
|
1767
|
+
}
|
|
1740
1768
|
export interface IInventoryClient {
|
|
1741
1769
|
listVendorBatches(request: ListVendorBatches): Promise<VendorBatchLookupDto[]>;
|
|
1742
1770
|
}
|
|
@@ -9798,6 +9826,33 @@ export declare class TrackingHistoryUpdateDto implements ITrackingHistoryUpdateD
|
|
|
9798
9826
|
export interface ITrackingHistoryUpdateDto {
|
|
9799
9827
|
parcelId: string;
|
|
9800
9828
|
}
|
|
9829
|
+
export declare class ParcelCategorySettingsDto implements IParcelCategorySettingsDto {
|
|
9830
|
+
categories?: string[];
|
|
9831
|
+
assignments?: {
|
|
9832
|
+
[key in ParcelKind]?: string[];
|
|
9833
|
+
};
|
|
9834
|
+
constructor(data?: IParcelCategorySettingsDto);
|
|
9835
|
+
init(_data?: any): void;
|
|
9836
|
+
static fromJS(data: any): ParcelCategorySettingsDto;
|
|
9837
|
+
toJSON(data?: any): any;
|
|
9838
|
+
}
|
|
9839
|
+
export interface IParcelCategorySettingsDto {
|
|
9840
|
+
categories?: string[];
|
|
9841
|
+
assignments?: {
|
|
9842
|
+
[key in ParcelKind]?: string[];
|
|
9843
|
+
};
|
|
9844
|
+
}
|
|
9845
|
+
export type ParcelKind = 0 | 1 | 2 | 3 | 4;
|
|
9846
|
+
export declare class CreateParcelCategoryCommand implements ICreateParcelCategoryCommand {
|
|
9847
|
+
label?: string;
|
|
9848
|
+
constructor(data?: ICreateParcelCategoryCommand);
|
|
9849
|
+
init(_data?: any): void;
|
|
9850
|
+
static fromJS(data: any): CreateParcelCategoryCommand;
|
|
9851
|
+
toJSON(data?: any): any;
|
|
9852
|
+
}
|
|
9853
|
+
export interface ICreateParcelCategoryCommand {
|
|
9854
|
+
label?: string;
|
|
9855
|
+
}
|
|
9801
9856
|
export declare class VendorBatchLookupDto implements IVendorBatchLookupDto {
|
|
9802
9857
|
batchNumber?: string;
|
|
9803
9858
|
vendorBatchNumber?: string | null;
|
package/lib/ignosportal-api.js
CHANGED
|
@@ -14482,6 +14482,263 @@ export class MoveTrackingClient extends AuthorizedApiBase {
|
|
|
14482
14482
|
return Promise.resolve(null);
|
|
14483
14483
|
}
|
|
14484
14484
|
}
|
|
14485
|
+
export class ParcelCategoryClient extends AuthorizedApiBase {
|
|
14486
|
+
constructor(configuration, baseUrl, http) {
|
|
14487
|
+
super(configuration);
|
|
14488
|
+
this.jsonParseReviver = undefined;
|
|
14489
|
+
this.http = http ? http : window;
|
|
14490
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
|
|
14491
|
+
}
|
|
14492
|
+
getSettings() {
|
|
14493
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories";
|
|
14494
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14495
|
+
let options_ = {
|
|
14496
|
+
method: "GET",
|
|
14497
|
+
headers: {
|
|
14498
|
+
"Accept": "application/json"
|
|
14499
|
+
}
|
|
14500
|
+
};
|
|
14501
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14502
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14503
|
+
}).then((_response) => {
|
|
14504
|
+
return this.processGetSettings(_response);
|
|
14505
|
+
});
|
|
14506
|
+
}
|
|
14507
|
+
processGetSettings(response) {
|
|
14508
|
+
const status = response.status;
|
|
14509
|
+
let _headers = {};
|
|
14510
|
+
if (response.headers && response.headers.forEach) {
|
|
14511
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14512
|
+
}
|
|
14513
|
+
;
|
|
14514
|
+
if (status === 200) {
|
|
14515
|
+
return response.text().then((_responseText) => {
|
|
14516
|
+
let result200 = null;
|
|
14517
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
14518
|
+
result200 = ParcelCategorySettingsDto.fromJS(resultData200);
|
|
14519
|
+
return result200;
|
|
14520
|
+
});
|
|
14521
|
+
}
|
|
14522
|
+
else if (status !== 200 && status !== 204) {
|
|
14523
|
+
return response.text().then((_responseText) => {
|
|
14524
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14525
|
+
});
|
|
14526
|
+
}
|
|
14527
|
+
return Promise.resolve(null);
|
|
14528
|
+
}
|
|
14529
|
+
create(cmd) {
|
|
14530
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories";
|
|
14531
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14532
|
+
const content_ = JSON.stringify(cmd);
|
|
14533
|
+
let options_ = {
|
|
14534
|
+
body: content_,
|
|
14535
|
+
method: "POST",
|
|
14536
|
+
headers: {
|
|
14537
|
+
"Content-Type": "application/json",
|
|
14538
|
+
"Accept": "application/json"
|
|
14539
|
+
}
|
|
14540
|
+
};
|
|
14541
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14542
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14543
|
+
}).then((_response) => {
|
|
14544
|
+
return this.processCreate(_response);
|
|
14545
|
+
});
|
|
14546
|
+
}
|
|
14547
|
+
processCreate(response) {
|
|
14548
|
+
const status = response.status;
|
|
14549
|
+
let _headers = {};
|
|
14550
|
+
if (response.headers && response.headers.forEach) {
|
|
14551
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14552
|
+
}
|
|
14553
|
+
;
|
|
14554
|
+
if (status === 200) {
|
|
14555
|
+
return response.text().then((_responseText) => {
|
|
14556
|
+
let result200 = null;
|
|
14557
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
14558
|
+
result200 = resultData200;
|
|
14559
|
+
return result200;
|
|
14560
|
+
});
|
|
14561
|
+
}
|
|
14562
|
+
else if (status !== 200 && status !== 204) {
|
|
14563
|
+
return response.text().then((_responseText) => {
|
|
14564
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14565
|
+
});
|
|
14566
|
+
}
|
|
14567
|
+
return Promise.resolve(null);
|
|
14568
|
+
}
|
|
14569
|
+
listCategories() {
|
|
14570
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/list";
|
|
14571
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14572
|
+
let options_ = {
|
|
14573
|
+
method: "GET",
|
|
14574
|
+
headers: {
|
|
14575
|
+
"Accept": "application/json"
|
|
14576
|
+
}
|
|
14577
|
+
};
|
|
14578
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14579
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14580
|
+
}).then((_response) => {
|
|
14581
|
+
return this.processListCategories(_response);
|
|
14582
|
+
});
|
|
14583
|
+
}
|
|
14584
|
+
processListCategories(response) {
|
|
14585
|
+
const status = response.status;
|
|
14586
|
+
let _headers = {};
|
|
14587
|
+
if (response.headers && response.headers.forEach) {
|
|
14588
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14589
|
+
}
|
|
14590
|
+
;
|
|
14591
|
+
if (status === 200) {
|
|
14592
|
+
return response.text().then((_responseText) => {
|
|
14593
|
+
let result200 = null;
|
|
14594
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
14595
|
+
if (Array.isArray(resultData200)) {
|
|
14596
|
+
result200 = [];
|
|
14597
|
+
for (let item of resultData200)
|
|
14598
|
+
result200.push(item);
|
|
14599
|
+
}
|
|
14600
|
+
return result200;
|
|
14601
|
+
});
|
|
14602
|
+
}
|
|
14603
|
+
else if (status !== 200 && status !== 204) {
|
|
14604
|
+
return response.text().then((_responseText) => {
|
|
14605
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14606
|
+
});
|
|
14607
|
+
}
|
|
14608
|
+
return Promise.resolve(null);
|
|
14609
|
+
}
|
|
14610
|
+
assign(kind, labels) {
|
|
14611
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/assign/{kind}";
|
|
14612
|
+
if (kind === undefined || kind === null)
|
|
14613
|
+
throw new Error("The parameter 'kind' must be defined.");
|
|
14614
|
+
url_ = url_.replace("{kind}", encodeURIComponent("" + kind));
|
|
14615
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14616
|
+
const content_ = JSON.stringify(labels);
|
|
14617
|
+
let options_ = {
|
|
14618
|
+
body: content_,
|
|
14619
|
+
method: "POST",
|
|
14620
|
+
headers: {
|
|
14621
|
+
"Content-Type": "application/json",
|
|
14622
|
+
"Accept": "application/octet-stream"
|
|
14623
|
+
}
|
|
14624
|
+
};
|
|
14625
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14626
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14627
|
+
}).then((_response) => {
|
|
14628
|
+
return this.processAssign(_response);
|
|
14629
|
+
});
|
|
14630
|
+
}
|
|
14631
|
+
processAssign(response) {
|
|
14632
|
+
const status = response.status;
|
|
14633
|
+
let _headers = {};
|
|
14634
|
+
if (response.headers && response.headers.forEach) {
|
|
14635
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14636
|
+
}
|
|
14637
|
+
;
|
|
14638
|
+
if (status === 200 || status === 206) {
|
|
14639
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
14640
|
+
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
|
14641
|
+
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
|
14642
|
+
if (fileName) {
|
|
14643
|
+
fileName = decodeURIComponent(fileName);
|
|
14644
|
+
}
|
|
14645
|
+
else {
|
|
14646
|
+
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
14647
|
+
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
14648
|
+
}
|
|
14649
|
+
return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
|
|
14650
|
+
}
|
|
14651
|
+
else if (status !== 200 && status !== 204) {
|
|
14652
|
+
return response.text().then((_responseText) => {
|
|
14653
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14654
|
+
});
|
|
14655
|
+
}
|
|
14656
|
+
return Promise.resolve(null);
|
|
14657
|
+
}
|
|
14658
|
+
delete(label) {
|
|
14659
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/{label}";
|
|
14660
|
+
if (label === undefined || label === null)
|
|
14661
|
+
throw new Error("The parameter 'label' must be defined.");
|
|
14662
|
+
url_ = url_.replace("{label}", encodeURIComponent("" + label));
|
|
14663
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14664
|
+
let options_ = {
|
|
14665
|
+
method: "DELETE",
|
|
14666
|
+
headers: {}
|
|
14667
|
+
};
|
|
14668
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14669
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14670
|
+
}).then((_response) => {
|
|
14671
|
+
return this.processDelete(_response);
|
|
14672
|
+
});
|
|
14673
|
+
}
|
|
14674
|
+
processDelete(response) {
|
|
14675
|
+
const status = response.status;
|
|
14676
|
+
let _headers = {};
|
|
14677
|
+
if (response.headers && response.headers.forEach) {
|
|
14678
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14679
|
+
}
|
|
14680
|
+
;
|
|
14681
|
+
if (status === 204) {
|
|
14682
|
+
return response.text().then((_responseText) => {
|
|
14683
|
+
return;
|
|
14684
|
+
});
|
|
14685
|
+
}
|
|
14686
|
+
else if (status !== 200 && status !== 204) {
|
|
14687
|
+
return response.text().then((_responseText) => {
|
|
14688
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14689
|
+
});
|
|
14690
|
+
}
|
|
14691
|
+
return Promise.resolve(null);
|
|
14692
|
+
}
|
|
14693
|
+
removeAssignment(kind, label) {
|
|
14694
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/assign/{kind}/{label}";
|
|
14695
|
+
if (kind === undefined || kind === null)
|
|
14696
|
+
throw new Error("The parameter 'kind' must be defined.");
|
|
14697
|
+
url_ = url_.replace("{kind}", encodeURIComponent("" + kind));
|
|
14698
|
+
if (label === undefined || label === null)
|
|
14699
|
+
throw new Error("The parameter 'label' must be defined.");
|
|
14700
|
+
url_ = url_.replace("{label}", encodeURIComponent("" + label));
|
|
14701
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
14702
|
+
let options_ = {
|
|
14703
|
+
method: "DELETE",
|
|
14704
|
+
headers: {
|
|
14705
|
+
"Accept": "application/octet-stream"
|
|
14706
|
+
}
|
|
14707
|
+
};
|
|
14708
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
14709
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
14710
|
+
}).then((_response) => {
|
|
14711
|
+
return this.processRemoveAssignment(_response);
|
|
14712
|
+
});
|
|
14713
|
+
}
|
|
14714
|
+
processRemoveAssignment(response) {
|
|
14715
|
+
const status = response.status;
|
|
14716
|
+
let _headers = {};
|
|
14717
|
+
if (response.headers && response.headers.forEach) {
|
|
14718
|
+
response.headers.forEach((v, k) => _headers[k] = v);
|
|
14719
|
+
}
|
|
14720
|
+
;
|
|
14721
|
+
if (status === 200 || status === 206) {
|
|
14722
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
14723
|
+
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
|
14724
|
+
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
|
14725
|
+
if (fileName) {
|
|
14726
|
+
fileName = decodeURIComponent(fileName);
|
|
14727
|
+
}
|
|
14728
|
+
else {
|
|
14729
|
+
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
14730
|
+
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
14731
|
+
}
|
|
14732
|
+
return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
|
|
14733
|
+
}
|
|
14734
|
+
else if (status !== 200 && status !== 204) {
|
|
14735
|
+
return response.text().then((_responseText) => {
|
|
14736
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
14737
|
+
});
|
|
14738
|
+
}
|
|
14739
|
+
return Promise.resolve(null);
|
|
14740
|
+
}
|
|
14741
|
+
}
|
|
14485
14742
|
export class InventoryClient extends AuthorizedApiBase {
|
|
14486
14743
|
constructor(configuration, baseUrl, http) {
|
|
14487
14744
|
super(configuration);
|
|
@@ -36642,6 +36899,80 @@ export class TrackingHistoryUpdateDto {
|
|
|
36642
36899
|
return data;
|
|
36643
36900
|
}
|
|
36644
36901
|
}
|
|
36902
|
+
export class ParcelCategorySettingsDto {
|
|
36903
|
+
constructor(data) {
|
|
36904
|
+
if (data) {
|
|
36905
|
+
for (var property in data) {
|
|
36906
|
+
if (data.hasOwnProperty(property))
|
|
36907
|
+
this[property] = data[property];
|
|
36908
|
+
}
|
|
36909
|
+
}
|
|
36910
|
+
}
|
|
36911
|
+
init(_data) {
|
|
36912
|
+
if (_data) {
|
|
36913
|
+
if (Array.isArray(_data["categories"])) {
|
|
36914
|
+
this.categories = [];
|
|
36915
|
+
for (let item of _data["categories"])
|
|
36916
|
+
this.categories.push(item);
|
|
36917
|
+
}
|
|
36918
|
+
if (_data["assignments"]) {
|
|
36919
|
+
this.assignments = {};
|
|
36920
|
+
for (let key in _data["assignments"]) {
|
|
36921
|
+
if (_data["assignments"].hasOwnProperty(key))
|
|
36922
|
+
this.assignments[key] = _data["assignments"][key] !== undefined ? _data["assignments"][key] : [];
|
|
36923
|
+
}
|
|
36924
|
+
}
|
|
36925
|
+
}
|
|
36926
|
+
}
|
|
36927
|
+
static fromJS(data) {
|
|
36928
|
+
data = typeof data === 'object' ? data : {};
|
|
36929
|
+
let result = new ParcelCategorySettingsDto();
|
|
36930
|
+
result.init(data);
|
|
36931
|
+
return result;
|
|
36932
|
+
}
|
|
36933
|
+
toJSON(data) {
|
|
36934
|
+
data = typeof data === 'object' ? data : {};
|
|
36935
|
+
if (Array.isArray(this.categories)) {
|
|
36936
|
+
data["categories"] = [];
|
|
36937
|
+
for (let item of this.categories)
|
|
36938
|
+
data["categories"].push(item);
|
|
36939
|
+
}
|
|
36940
|
+
if (this.assignments) {
|
|
36941
|
+
data["assignments"] = {};
|
|
36942
|
+
for (let key in this.assignments) {
|
|
36943
|
+
if (this.assignments.hasOwnProperty(key))
|
|
36944
|
+
data["assignments"][key] = this.assignments[key];
|
|
36945
|
+
}
|
|
36946
|
+
}
|
|
36947
|
+
return data;
|
|
36948
|
+
}
|
|
36949
|
+
}
|
|
36950
|
+
export class CreateParcelCategoryCommand {
|
|
36951
|
+
constructor(data) {
|
|
36952
|
+
if (data) {
|
|
36953
|
+
for (var property in data) {
|
|
36954
|
+
if (data.hasOwnProperty(property))
|
|
36955
|
+
this[property] = data[property];
|
|
36956
|
+
}
|
|
36957
|
+
}
|
|
36958
|
+
}
|
|
36959
|
+
init(_data) {
|
|
36960
|
+
if (_data) {
|
|
36961
|
+
this.label = _data["label"];
|
|
36962
|
+
}
|
|
36963
|
+
}
|
|
36964
|
+
static fromJS(data) {
|
|
36965
|
+
data = typeof data === 'object' ? data : {};
|
|
36966
|
+
let result = new CreateParcelCategoryCommand();
|
|
36967
|
+
result.init(data);
|
|
36968
|
+
return result;
|
|
36969
|
+
}
|
|
36970
|
+
toJSON(data) {
|
|
36971
|
+
data = typeof data === 'object' ? data : {};
|
|
36972
|
+
data["label"] = this.label;
|
|
36973
|
+
return data;
|
|
36974
|
+
}
|
|
36975
|
+
}
|
|
36645
36976
|
export class VendorBatchLookupDto {
|
|
36646
36977
|
constructor(data) {
|
|
36647
36978
|
if (data) {
|
package/package.json
CHANGED
package/src/ignosportal-api.ts
CHANGED
|
@@ -15461,6 +15461,278 @@ export class MoveTrackingClient extends AuthorizedApiBase implements IMoveTracki
|
|
|
15461
15461
|
}
|
|
15462
15462
|
}
|
|
15463
15463
|
|
|
15464
|
+
export interface IParcelCategoryClient {
|
|
15465
|
+
|
|
15466
|
+
getSettings(): Promise<ParcelCategorySettingsDto>;
|
|
15467
|
+
|
|
15468
|
+
create(cmd: CreateParcelCategoryCommand): Promise<string>;
|
|
15469
|
+
|
|
15470
|
+
listCategories(): Promise<string[]>;
|
|
15471
|
+
|
|
15472
|
+
assign(kind: ParcelKindDto, labels: string[]): Promise<FileResponse>;
|
|
15473
|
+
|
|
15474
|
+
delete(label: string): Promise<void>;
|
|
15475
|
+
|
|
15476
|
+
removeAssignment(kind: ParcelKindDto, label: string): Promise<FileResponse>;
|
|
15477
|
+
}
|
|
15478
|
+
|
|
15479
|
+
export class ParcelCategoryClient extends AuthorizedApiBase implements IParcelCategoryClient {
|
|
15480
|
+
private http: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> };
|
|
15481
|
+
private baseUrl: string;
|
|
15482
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
|
|
15483
|
+
|
|
15484
|
+
constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) {
|
|
15485
|
+
super(configuration);
|
|
15486
|
+
this.http = http ? http : window as any;
|
|
15487
|
+
this.baseUrl = baseUrl ?? "";
|
|
15488
|
+
}
|
|
15489
|
+
|
|
15490
|
+
getSettings(): Promise<ParcelCategorySettingsDto> {
|
|
15491
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories";
|
|
15492
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15493
|
+
|
|
15494
|
+
let options_: RequestInit = {
|
|
15495
|
+
method: "GET",
|
|
15496
|
+
headers: {
|
|
15497
|
+
"Accept": "application/json"
|
|
15498
|
+
}
|
|
15499
|
+
};
|
|
15500
|
+
|
|
15501
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15502
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15503
|
+
}).then((_response: Response) => {
|
|
15504
|
+
return this.processGetSettings(_response);
|
|
15505
|
+
});
|
|
15506
|
+
}
|
|
15507
|
+
|
|
15508
|
+
protected processGetSettings(response: Response): Promise<ParcelCategorySettingsDto> {
|
|
15509
|
+
const status = response.status;
|
|
15510
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15511
|
+
if (status === 200) {
|
|
15512
|
+
return response.text().then((_responseText) => {
|
|
15513
|
+
let result200: any = null;
|
|
15514
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
15515
|
+
result200 = ParcelCategorySettingsDto.fromJS(resultData200);
|
|
15516
|
+
return result200;
|
|
15517
|
+
});
|
|
15518
|
+
} else if (status !== 200 && status !== 204) {
|
|
15519
|
+
return response.text().then((_responseText) => {
|
|
15520
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15521
|
+
});
|
|
15522
|
+
}
|
|
15523
|
+
return Promise.resolve<ParcelCategorySettingsDto>(null as any);
|
|
15524
|
+
}
|
|
15525
|
+
|
|
15526
|
+
create(cmd: CreateParcelCategoryCommand): Promise<string> {
|
|
15527
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories";
|
|
15528
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15529
|
+
|
|
15530
|
+
const content_ = JSON.stringify(cmd);
|
|
15531
|
+
|
|
15532
|
+
let options_: RequestInit = {
|
|
15533
|
+
body: content_,
|
|
15534
|
+
method: "POST",
|
|
15535
|
+
headers: {
|
|
15536
|
+
"Content-Type": "application/json",
|
|
15537
|
+
"Accept": "application/json"
|
|
15538
|
+
}
|
|
15539
|
+
};
|
|
15540
|
+
|
|
15541
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15542
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15543
|
+
}).then((_response: Response) => {
|
|
15544
|
+
return this.processCreate(_response);
|
|
15545
|
+
});
|
|
15546
|
+
}
|
|
15547
|
+
|
|
15548
|
+
protected processCreate(response: Response): Promise<string> {
|
|
15549
|
+
const status = response.status;
|
|
15550
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15551
|
+
if (status === 200) {
|
|
15552
|
+
return response.text().then((_responseText) => {
|
|
15553
|
+
let result200: any = null;
|
|
15554
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
15555
|
+
result200 = resultData200;
|
|
15556
|
+
|
|
15557
|
+
return result200;
|
|
15558
|
+
});
|
|
15559
|
+
} else if (status !== 200 && status !== 204) {
|
|
15560
|
+
return response.text().then((_responseText) => {
|
|
15561
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15562
|
+
});
|
|
15563
|
+
}
|
|
15564
|
+
return Promise.resolve<string>(null as any);
|
|
15565
|
+
}
|
|
15566
|
+
|
|
15567
|
+
listCategories(): Promise<string[]> {
|
|
15568
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/list";
|
|
15569
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15570
|
+
|
|
15571
|
+
let options_: RequestInit = {
|
|
15572
|
+
method: "GET",
|
|
15573
|
+
headers: {
|
|
15574
|
+
"Accept": "application/json"
|
|
15575
|
+
}
|
|
15576
|
+
};
|
|
15577
|
+
|
|
15578
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15579
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15580
|
+
}).then((_response: Response) => {
|
|
15581
|
+
return this.processListCategories(_response);
|
|
15582
|
+
});
|
|
15583
|
+
}
|
|
15584
|
+
|
|
15585
|
+
protected processListCategories(response: Response): Promise<string[]> {
|
|
15586
|
+
const status = response.status;
|
|
15587
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15588
|
+
if (status === 200) {
|
|
15589
|
+
return response.text().then((_responseText) => {
|
|
15590
|
+
let result200: any = null;
|
|
15591
|
+
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
15592
|
+
if (Array.isArray(resultData200)) {
|
|
15593
|
+
result200 = [] as any;
|
|
15594
|
+
for (let item of resultData200)
|
|
15595
|
+
result200!.push(item);
|
|
15596
|
+
}
|
|
15597
|
+
return result200;
|
|
15598
|
+
});
|
|
15599
|
+
} else if (status !== 200 && status !== 204) {
|
|
15600
|
+
return response.text().then((_responseText) => {
|
|
15601
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15602
|
+
});
|
|
15603
|
+
}
|
|
15604
|
+
return Promise.resolve<string[]>(null as any);
|
|
15605
|
+
}
|
|
15606
|
+
|
|
15607
|
+
assign(kind: ParcelKindDto, labels: string[]): Promise<FileResponse> {
|
|
15608
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/assign/{kind}";
|
|
15609
|
+
if (kind === undefined || kind === null)
|
|
15610
|
+
throw new Error("The parameter 'kind' must be defined.");
|
|
15611
|
+
url_ = url_.replace("{kind}", encodeURIComponent("" + kind));
|
|
15612
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15613
|
+
|
|
15614
|
+
const content_ = JSON.stringify(labels);
|
|
15615
|
+
|
|
15616
|
+
let options_: RequestInit = {
|
|
15617
|
+
body: content_,
|
|
15618
|
+
method: "POST",
|
|
15619
|
+
headers: {
|
|
15620
|
+
"Content-Type": "application/json",
|
|
15621
|
+
"Accept": "application/octet-stream"
|
|
15622
|
+
}
|
|
15623
|
+
};
|
|
15624
|
+
|
|
15625
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15626
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15627
|
+
}).then((_response: Response) => {
|
|
15628
|
+
return this.processAssign(_response);
|
|
15629
|
+
});
|
|
15630
|
+
}
|
|
15631
|
+
|
|
15632
|
+
protected processAssign(response: Response): Promise<FileResponse> {
|
|
15633
|
+
const status = response.status;
|
|
15634
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15635
|
+
if (status === 200 || status === 206) {
|
|
15636
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
15637
|
+
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
|
15638
|
+
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
|
15639
|
+
if (fileName) {
|
|
15640
|
+
fileName = decodeURIComponent(fileName);
|
|
15641
|
+
} else {
|
|
15642
|
+
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
15643
|
+
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
15644
|
+
}
|
|
15645
|
+
return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
|
|
15646
|
+
} else if (status !== 200 && status !== 204) {
|
|
15647
|
+
return response.text().then((_responseText) => {
|
|
15648
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15649
|
+
});
|
|
15650
|
+
}
|
|
15651
|
+
return Promise.resolve<FileResponse>(null as any);
|
|
15652
|
+
}
|
|
15653
|
+
|
|
15654
|
+
delete(label: string): Promise<void> {
|
|
15655
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/{label}";
|
|
15656
|
+
if (label === undefined || label === null)
|
|
15657
|
+
throw new Error("The parameter 'label' must be defined.");
|
|
15658
|
+
url_ = url_.replace("{label}", encodeURIComponent("" + label));
|
|
15659
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15660
|
+
|
|
15661
|
+
let options_: RequestInit = {
|
|
15662
|
+
method: "DELETE",
|
|
15663
|
+
headers: {
|
|
15664
|
+
}
|
|
15665
|
+
};
|
|
15666
|
+
|
|
15667
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15668
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15669
|
+
}).then((_response: Response) => {
|
|
15670
|
+
return this.processDelete(_response);
|
|
15671
|
+
});
|
|
15672
|
+
}
|
|
15673
|
+
|
|
15674
|
+
protected processDelete(response: Response): Promise<void> {
|
|
15675
|
+
const status = response.status;
|
|
15676
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15677
|
+
if (status === 204) {
|
|
15678
|
+
return response.text().then((_responseText) => {
|
|
15679
|
+
return;
|
|
15680
|
+
});
|
|
15681
|
+
} else if (status !== 200 && status !== 204) {
|
|
15682
|
+
return response.text().then((_responseText) => {
|
|
15683
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15684
|
+
});
|
|
15685
|
+
}
|
|
15686
|
+
return Promise.resolve<void>(null as any);
|
|
15687
|
+
}
|
|
15688
|
+
|
|
15689
|
+
removeAssignment(kind: ParcelKindDto, label: string): Promise<FileResponse> {
|
|
15690
|
+
let url_ = this.baseUrl + "/move/settings/parcelcategories/assign/{kind}/{label}";
|
|
15691
|
+
if (kind === undefined || kind === null)
|
|
15692
|
+
throw new Error("The parameter 'kind' must be defined.");
|
|
15693
|
+
url_ = url_.replace("{kind}", encodeURIComponent("" + kind));
|
|
15694
|
+
if (label === undefined || label === null)
|
|
15695
|
+
throw new Error("The parameter 'label' must be defined.");
|
|
15696
|
+
url_ = url_.replace("{label}", encodeURIComponent("" + label));
|
|
15697
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
15698
|
+
|
|
15699
|
+
let options_: RequestInit = {
|
|
15700
|
+
method: "DELETE",
|
|
15701
|
+
headers: {
|
|
15702
|
+
"Accept": "application/octet-stream"
|
|
15703
|
+
}
|
|
15704
|
+
};
|
|
15705
|
+
|
|
15706
|
+
return this.transformOptions(options_).then(transformedOptions_ => {
|
|
15707
|
+
return this.http.fetch(url_, transformedOptions_);
|
|
15708
|
+
}).then((_response: Response) => {
|
|
15709
|
+
return this.processRemoveAssignment(_response);
|
|
15710
|
+
});
|
|
15711
|
+
}
|
|
15712
|
+
|
|
15713
|
+
protected processRemoveAssignment(response: Response): Promise<FileResponse> {
|
|
15714
|
+
const status = response.status;
|
|
15715
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
15716
|
+
if (status === 200 || status === 206) {
|
|
15717
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
15718
|
+
let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
|
|
15719
|
+
let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
|
|
15720
|
+
if (fileName) {
|
|
15721
|
+
fileName = decodeURIComponent(fileName);
|
|
15722
|
+
} else {
|
|
15723
|
+
fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
15724
|
+
fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
15725
|
+
}
|
|
15726
|
+
return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
|
|
15727
|
+
} else if (status !== 200 && status !== 204) {
|
|
15728
|
+
return response.text().then((_responseText) => {
|
|
15729
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
15730
|
+
});
|
|
15731
|
+
}
|
|
15732
|
+
return Promise.resolve<FileResponse>(null as any);
|
|
15733
|
+
}
|
|
15734
|
+
}
|
|
15735
|
+
|
|
15464
15736
|
export interface IInventoryClient {
|
|
15465
15737
|
|
|
15466
15738
|
listVendorBatches(request: ListVendorBatches): Promise<VendorBatchLookupDto[]>;
|
|
@@ -45313,6 +45585,104 @@ export interface ITrackingHistoryUpdateDto {
|
|
|
45313
45585
|
parcelId: string;
|
|
45314
45586
|
}
|
|
45315
45587
|
|
|
45588
|
+
export class ParcelCategorySettingsDto implements IParcelCategorySettingsDto {
|
|
45589
|
+
categories?: string[];
|
|
45590
|
+
assignments?: { [key in ParcelKind]?: string[]; };
|
|
45591
|
+
|
|
45592
|
+
constructor(data?: IParcelCategorySettingsDto) {
|
|
45593
|
+
if (data) {
|
|
45594
|
+
for (var property in data) {
|
|
45595
|
+
if (data.hasOwnProperty(property))
|
|
45596
|
+
(<any>this)[property] = (<any>data)[property];
|
|
45597
|
+
}
|
|
45598
|
+
}
|
|
45599
|
+
}
|
|
45600
|
+
|
|
45601
|
+
init(_data?: any) {
|
|
45602
|
+
if (_data) {
|
|
45603
|
+
if (Array.isArray(_data["categories"])) {
|
|
45604
|
+
this.categories = [] as any;
|
|
45605
|
+
for (let item of _data["categories"])
|
|
45606
|
+
this.categories!.push(item);
|
|
45607
|
+
}
|
|
45608
|
+
if (_data["assignments"]) {
|
|
45609
|
+
this.assignments = {} as any;
|
|
45610
|
+
for (let key in _data["assignments"]) {
|
|
45611
|
+
if (_data["assignments"].hasOwnProperty(key))
|
|
45612
|
+
(<any>this.assignments)![key] = _data["assignments"][key] !== undefined ? _data["assignments"][key] : [];
|
|
45613
|
+
}
|
|
45614
|
+
}
|
|
45615
|
+
}
|
|
45616
|
+
}
|
|
45617
|
+
|
|
45618
|
+
static fromJS(data: any): ParcelCategorySettingsDto {
|
|
45619
|
+
data = typeof data === 'object' ? data : {};
|
|
45620
|
+
let result = new ParcelCategorySettingsDto();
|
|
45621
|
+
result.init(data);
|
|
45622
|
+
return result;
|
|
45623
|
+
}
|
|
45624
|
+
|
|
45625
|
+
toJSON(data?: any) {
|
|
45626
|
+
data = typeof data === 'object' ? data : {};
|
|
45627
|
+
if (Array.isArray(this.categories)) {
|
|
45628
|
+
data["categories"] = [];
|
|
45629
|
+
for (let item of this.categories)
|
|
45630
|
+
data["categories"].push(item);
|
|
45631
|
+
}
|
|
45632
|
+
if (this.assignments) {
|
|
45633
|
+
data["assignments"] = {};
|
|
45634
|
+
for (let key in this.assignments) {
|
|
45635
|
+
if (this.assignments.hasOwnProperty(key))
|
|
45636
|
+
(<any>data["assignments"])[key] = (<any>this.assignments)[key];
|
|
45637
|
+
}
|
|
45638
|
+
}
|
|
45639
|
+
return data;
|
|
45640
|
+
}
|
|
45641
|
+
}
|
|
45642
|
+
|
|
45643
|
+
export interface IParcelCategorySettingsDto {
|
|
45644
|
+
categories?: string[];
|
|
45645
|
+
assignments?: { [key in ParcelKind]?: string[]; };
|
|
45646
|
+
}
|
|
45647
|
+
|
|
45648
|
+
export type ParcelKind = 0 | 1 | 2 | 3 | 4;
|
|
45649
|
+
|
|
45650
|
+
export class CreateParcelCategoryCommand implements ICreateParcelCategoryCommand {
|
|
45651
|
+
label?: string;
|
|
45652
|
+
|
|
45653
|
+
constructor(data?: ICreateParcelCategoryCommand) {
|
|
45654
|
+
if (data) {
|
|
45655
|
+
for (var property in data) {
|
|
45656
|
+
if (data.hasOwnProperty(property))
|
|
45657
|
+
(<any>this)[property] = (<any>data)[property];
|
|
45658
|
+
}
|
|
45659
|
+
}
|
|
45660
|
+
}
|
|
45661
|
+
|
|
45662
|
+
init(_data?: any) {
|
|
45663
|
+
if (_data) {
|
|
45664
|
+
this.label = _data["label"];
|
|
45665
|
+
}
|
|
45666
|
+
}
|
|
45667
|
+
|
|
45668
|
+
static fromJS(data: any): CreateParcelCategoryCommand {
|
|
45669
|
+
data = typeof data === 'object' ? data : {};
|
|
45670
|
+
let result = new CreateParcelCategoryCommand();
|
|
45671
|
+
result.init(data);
|
|
45672
|
+
return result;
|
|
45673
|
+
}
|
|
45674
|
+
|
|
45675
|
+
toJSON(data?: any) {
|
|
45676
|
+
data = typeof data === 'object' ? data : {};
|
|
45677
|
+
data["label"] = this.label;
|
|
45678
|
+
return data;
|
|
45679
|
+
}
|
|
45680
|
+
}
|
|
45681
|
+
|
|
45682
|
+
export interface ICreateParcelCategoryCommand {
|
|
45683
|
+
label?: string;
|
|
45684
|
+
}
|
|
45685
|
+
|
|
45316
45686
|
export class VendorBatchLookupDto implements IVendorBatchLookupDto {
|
|
45317
45687
|
batchNumber?: string;
|
|
45318
45688
|
vendorBatchNumber?: string | null;
|