@targetprocess/work-sharing-p2p-client 1.160.2-p2p-v.2 → 1.160.3
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/bin/client.d.ts +0 -46
- package/bin/client.js +0 -73
- package/bin/client.js.map +1 -1
- package/package.json +1 -1
package/bin/client.d.ts
CHANGED
|
@@ -4,12 +4,6 @@ export interface IClient {
|
|
|
4
4
|
* @return List of P2P profiles matching the public specification.
|
|
5
5
|
*/
|
|
6
6
|
getProfiles(host: string, x_alternative_host: string): Promise<P2pProfile[]>;
|
|
7
|
-
/**
|
|
8
|
-
* Install profile with P2P package mappings
|
|
9
|
-
* @param body Profile installation request
|
|
10
|
-
* @return Profile installed successfully
|
|
11
|
-
*/
|
|
12
|
-
installProfile(host: string, x_alternative_host: string, body: P2PProfileInstallDto): Promise<P2PProfileResultDto>;
|
|
13
7
|
}
|
|
14
8
|
export declare class Client implements IClient {
|
|
15
9
|
private http;
|
|
@@ -24,13 +18,6 @@ export declare class Client implements IClient {
|
|
|
24
18
|
*/
|
|
25
19
|
getProfiles(host: string, x_alternative_host: string): Promise<P2pProfile[]>;
|
|
26
20
|
protected processGetProfiles(response: Response): Promise<P2pProfile[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Install profile with P2P package mappings
|
|
29
|
-
* @param body Profile installation request
|
|
30
|
-
* @return Profile installed successfully
|
|
31
|
-
*/
|
|
32
|
-
installProfile(host: string, x_alternative_host: string, body: P2PProfileInstallDto): Promise<P2PProfileResultDto>;
|
|
33
|
-
protected processInstallProfile(response: Response): Promise<P2PProfileResultDto>;
|
|
34
21
|
}
|
|
35
22
|
export interface P2pToolRef {
|
|
36
23
|
type: string;
|
|
@@ -164,39 +151,6 @@ export interface P2pProfile {
|
|
|
164
151
|
targetTool: P2pToolRef;
|
|
165
152
|
mappings: P2pProfileMapping[];
|
|
166
153
|
}
|
|
167
|
-
export interface P2PTypeMappingInstallDto {
|
|
168
|
-
/** Source type mapping data from the P2P package to apply (or null to remove) */
|
|
169
|
-
sourceTypeMapping: any;
|
|
170
|
-
/** Existing target type mapping to update (or null to create new) */
|
|
171
|
-
targetTypeMapping?: any;
|
|
172
|
-
}
|
|
173
|
-
export interface P2PProfileMappingInstallDto {
|
|
174
|
-
typeMappings: P2PTypeMappingInstallDto[];
|
|
175
|
-
}
|
|
176
|
-
export interface P2PProfileInstallDto {
|
|
177
|
-
id: string;
|
|
178
|
-
mappings: P2PProfileMappingInstallDto[];
|
|
179
|
-
}
|
|
180
|
-
export interface P2PProfileResultDto {
|
|
181
|
-
/** ID of the processed profile */
|
|
182
|
-
profileId: string;
|
|
183
|
-
/** Whether this profile was installed successfully */
|
|
184
|
-
status: P2PProfileResultDtoStatus;
|
|
185
|
-
/** Error message if the profile installation failed */
|
|
186
|
-
error?: string;
|
|
187
|
-
/** Number of new type mappings created */
|
|
188
|
-
typeMappingsCreated: number;
|
|
189
|
-
/** Number of existing type mappings updated */
|
|
190
|
-
typeMappingsUpdated: number;
|
|
191
|
-
/** Number of new field mappings created */
|
|
192
|
-
fieldMappingsCreated: number;
|
|
193
|
-
/** Number of existing field mappings updated */
|
|
194
|
-
fieldMappingsUpdated: number;
|
|
195
|
-
}
|
|
196
|
-
export declare enum P2PProfileResultDtoStatus {
|
|
197
|
-
Success = "success",
|
|
198
|
-
Failure = "failure",
|
|
199
|
-
}
|
|
200
154
|
export declare class ApiException extends Error {
|
|
201
155
|
message: string;
|
|
202
156
|
status: number;
|
package/bin/client.js
CHANGED
|
@@ -78,74 +78,6 @@ var Client = /** @class */ (function () {
|
|
|
78
78
|
}
|
|
79
79
|
return Promise.resolve(null);
|
|
80
80
|
};
|
|
81
|
-
/**
|
|
82
|
-
* Install profile with P2P package mappings
|
|
83
|
-
* @param body Profile installation request
|
|
84
|
-
* @return Profile installed successfully
|
|
85
|
-
*/
|
|
86
|
-
Client.prototype.installProfile = function (host, x_alternative_host, body) {
|
|
87
|
-
var _this = this;
|
|
88
|
-
var url_ = this.baseUrl + "/p2p/profile";
|
|
89
|
-
url_ = url_.replace(/[?&]$/, "");
|
|
90
|
-
var content_ = JSON.stringify(body);
|
|
91
|
-
var options_ = {
|
|
92
|
-
body: content_,
|
|
93
|
-
method: "POST",
|
|
94
|
-
headers: {
|
|
95
|
-
"host": host !== undefined && host !== null ? "" + host : "",
|
|
96
|
-
"x-alternative-host": x_alternative_host !== undefined && x_alternative_host !== null ? "" + x_alternative_host : "",
|
|
97
|
-
"Content-Type": "application/json",
|
|
98
|
-
"Accept": "application/json"
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
102
|
-
return _this.processInstallProfile(_response);
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
Client.prototype.processInstallProfile = function (response) {
|
|
106
|
-
var _this = this;
|
|
107
|
-
var status = response.status;
|
|
108
|
-
var _headers = {};
|
|
109
|
-
if (response.headers && response.headers.forEach) {
|
|
110
|
-
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
111
|
-
}
|
|
112
|
-
;
|
|
113
|
-
if (status === 200) {
|
|
114
|
-
return response.text().then(function (_responseText) {
|
|
115
|
-
var result200 = null;
|
|
116
|
-
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
117
|
-
return result200;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
else if (status === 401) {
|
|
121
|
-
return response.text().then(function (_responseText) {
|
|
122
|
-
return throwException("Unauthorized - Invalid or missing authentication token", status, _responseText, _headers);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
else if (status === 403) {
|
|
126
|
-
return response.text().then(function (_responseText) {
|
|
127
|
-
return throwException("Forbidden - Insufficient permissions (requires work-sharing:profiles:manage scope)", status, _responseText, _headers);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
else if (status === 422) {
|
|
131
|
-
return response.text().then(function (_responseText) {
|
|
132
|
-
var result422 = null;
|
|
133
|
-
result422 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
134
|
-
return throwException("Profile installation failed - validation error or operation failure", status, _responseText, _headers, result422);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
else if (status === 500) {
|
|
138
|
-
return response.text().then(function (_responseText) {
|
|
139
|
-
return throwException("Internal server error", status, _responseText, _headers);
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
else if (status !== 200 && status !== 204) {
|
|
143
|
-
return response.text().then(function (_responseText) {
|
|
144
|
-
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
return Promise.resolve(null);
|
|
148
|
-
};
|
|
149
81
|
return Client;
|
|
150
82
|
}());
|
|
151
83
|
exports.Client = Client;
|
|
@@ -155,11 +87,6 @@ var P2pMappingDirectionDto;
|
|
|
155
87
|
P2pMappingDirectionDto["TargetToSource"] = "TargetToSource";
|
|
156
88
|
P2pMappingDirectionDto["Bidirectional"] = "Bidirectional";
|
|
157
89
|
})(P2pMappingDirectionDto = exports.P2pMappingDirectionDto || (exports.P2pMappingDirectionDto = {}));
|
|
158
|
-
var P2PProfileResultDtoStatus;
|
|
159
|
-
(function (P2PProfileResultDtoStatus) {
|
|
160
|
-
P2PProfileResultDtoStatus["Success"] = "success";
|
|
161
|
-
P2PProfileResultDtoStatus["Failure"] = "failure";
|
|
162
|
-
})(P2PProfileResultDtoStatus = exports.P2PProfileResultDtoStatus || (exports.P2PProfileResultDtoStatus = {}));
|
|
163
90
|
var ApiException = /** @class */ (function (_super) {
|
|
164
91
|
__extends(ApiException, _super);
|
|
165
92
|
function ApiException(message, status, response, headers, result) {
|
package/bin/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client/src/client.ts"],"names":[],"mappings":";AAAA,wBAAwB;AACxB,mBAAmB;AACnB,8HAA8H;AAC9H,oBAAoB;A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