spitfirepm 23.9600.11 → 23.9600.12
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 +2 -1
- package/dist/SwaggerClients.d.ts +120 -0
- package/dist/SwaggerClients.js +306 -1
- package/dist/SwaggerClients.js.map +1 -1
- package/dist/sfRESTClient.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ apiResult.then( (a) => {
|
|
|
25
25
|
### Change Log
|
|
26
26
|
|
|
27
27
|
```
|
|
28
|
-
23.9600.
|
|
28
|
+
23.9600.12 - ARR endpoints
|
|
29
|
+
23.9600.11 - Adds Admin and Manage Tool Data Models and Endpoints
|
|
29
30
|
23.9600.10 - Adds csi-maintenance
|
|
30
31
|
23.9600.9 - Adds BuildWCCInfoTableHTML
|
|
31
32
|
23.9600.8 - Project SOP links and Send Log Endpoint
|
package/dist/SwaggerClients.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ export declare class AccountClient extends APIClientBase {
|
|
|
26
26
|
private getAccessAllowsWithCallbacks;
|
|
27
27
|
private processGetAccessAllowsWithCallbacks;
|
|
28
28
|
protected processGetAccessAllows(xhr: any): PermissionFlags | null;
|
|
29
|
+
/**
|
|
30
|
+
* Mint a short-lived download-session cookie
|
|
31
|
+
* @return Download cookie set (or an sfSession cookie was already present)
|
|
32
|
+
*/
|
|
33
|
+
postDownloadSession(): Promise<string>;
|
|
34
|
+
private postDownloadSessionWithCallbacks;
|
|
35
|
+
private processPostDownloadSessionWithCallbacks;
|
|
36
|
+
protected processPostDownloadSession(xhr: any): string | null;
|
|
29
37
|
/**
|
|
30
38
|
* Digest an identity from an Google token
|
|
31
39
|
* @param subId google nonvolatile id
|
|
@@ -370,6 +378,36 @@ export declare class LookupClient extends APIClientBase {
|
|
|
370
378
|
private processGetDisplayValueCollectionWithCallbacks;
|
|
371
379
|
protected processGetDisplayValueCollection(xhr: any): Suggestion[] | null | null;
|
|
372
380
|
}
|
|
381
|
+
export declare class ARRClient extends APIClientBase {
|
|
382
|
+
baseUrl: string;
|
|
383
|
+
beforeSend: any;
|
|
384
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
385
|
+
constructor(baseUrl?: string);
|
|
386
|
+
/**
|
|
387
|
+
* Build the routed-content download package
|
|
388
|
+
* @param data download request {RouteID}
|
|
389
|
+
*/
|
|
390
|
+
getContent(data: ArrResponseData): Promise<string | null>;
|
|
391
|
+
private getContentWithCallbacks;
|
|
392
|
+
private processGetContentWithCallbacks;
|
|
393
|
+
protected processGetContent(xhr: any): string | null | null;
|
|
394
|
+
/**
|
|
395
|
+
* Open a route-response link
|
|
396
|
+
* @param request open request {StepKey, RouteID}
|
|
397
|
+
*/
|
|
398
|
+
openRoute(request: ArrOpenRequest): Promise<ArrOpenResult | null>;
|
|
399
|
+
private openRouteWithCallbacks;
|
|
400
|
+
private processOpenRouteWithCallbacks;
|
|
401
|
+
protected processOpenRoute(xhr: any): ArrOpenResult | null | null;
|
|
402
|
+
/**
|
|
403
|
+
* Record a route response
|
|
404
|
+
* @param data response data
|
|
405
|
+
*/
|
|
406
|
+
recordResponse(data: ArrResponseData): Promise<ArrResponseResult | null>;
|
|
407
|
+
private recordResponseWithCallbacks;
|
|
408
|
+
private processRecordResponseWithCallbacks;
|
|
409
|
+
protected processRecordResponse(xhr: any): ArrResponseResult | null | null;
|
|
410
|
+
}
|
|
373
411
|
export declare class CatalogClient extends APIClientBase {
|
|
374
412
|
baseUrl: string;
|
|
375
413
|
beforeSend: any;
|
|
@@ -3732,6 +3770,88 @@ export interface APIData {
|
|
|
3732
3770
|
/** when true, data has been uri encoded (encodeURIComponent) */
|
|
3733
3771
|
IsURIEncoded?: boolean;
|
|
3734
3772
|
}
|
|
3773
|
+
/** Route Response Wizard (ARR / case 36631) data-transfer objects, shared between the sfPMS web app (ARRController) and the OpenAPI/Swagger client. Moved here from ARRController.vb so they live with the rest of the DataSupportModels. */
|
|
3774
|
+
export interface ArrOpenRequest {
|
|
3775
|
+
/** RouteStepKey from the link. */
|
|
3776
|
+
StepKey?: string;
|
|
3777
|
+
/** RouteID from the link. */
|
|
3778
|
+
RouteID?: string;
|
|
3779
|
+
}
|
|
3780
|
+
/** Everything the Webix arr view needs to render, plus the (optional) ARR session token. */
|
|
3781
|
+
export interface ArrOpenResult {
|
|
3782
|
+
/** RouteStepKey echoed back. */
|
|
3783
|
+
StepKey?: string;
|
|
3784
|
+
/** RouteID echoed back. */
|
|
3785
|
+
RouteID?: string;
|
|
3786
|
+
/** Document the route belongs to. */
|
|
3787
|
+
DocMasterKey?: string;
|
|
3788
|
+
/** Document type of the document. */
|
|
3789
|
+
DocTypeKey?: string;
|
|
3790
|
+
/** Document title for display. */
|
|
3791
|
+
DocTitle?: string | undefined;
|
|
3792
|
+
/** Display name of the routee (the "For" person). */
|
|
3793
|
+
RouteeUserName?: string | undefined;
|
|
3794
|
+
/** Routee email (used for the confirmation checkbox; also a phase-2 verification target). */
|
|
3795
|
+
RouteeEmail?: string | undefined;
|
|
3796
|
+
/** Display name of the person the route replies to. */
|
|
3797
|
+
FromUserName?: string | undefined;
|
|
3798
|
+
/** Route instructions/request text. */
|
|
3799
|
+
Instructions?: string | undefined;
|
|
3800
|
+
/** Timestamp the routed content was set/resolved. */
|
|
3801
|
+
ContentAsOf?: Date;
|
|
3802
|
+
/** True when there is routed content available to download. */
|
|
3803
|
+
HasContent?: boolean;
|
|
3804
|
+
/** When the routee first viewed this route, if ever. */
|
|
3805
|
+
FirstViewed?: Date | undefined;
|
|
3806
|
+
/** When the routee last responded to this route, if ever. */
|
|
3807
|
+
Responded?: Date | undefined;
|
|
3808
|
+
/** True when the document is confidential. */
|
|
3809
|
+
IsConfidential?: boolean;
|
|
3810
|
+
/** Phase 1: when true, no AccessToken is issued and the view shows a "verification coming soon" state. */
|
|
3811
|
+
RequiresVerification?: boolean;
|
|
3812
|
+
/** Whether the free-form response area should be shown. */
|
|
3813
|
+
ShowRouteResponseArea?: boolean;
|
|
3814
|
+
/** Whether the response-code dropdown should be shown. */
|
|
3815
|
+
ShowRouteResponseCode?: boolean;
|
|
3816
|
+
/** Whether the response text may still be edited. */
|
|
3817
|
+
CanEditRouteResponse?: boolean;
|
|
3818
|
+
/** Whether the response code may still be changed. */
|
|
3819
|
+
CanEditRouteResponseCode?: boolean;
|
|
3820
|
+
/** Whether the routee is permitted to send the document back. */
|
|
3821
|
+
AllowSendBack?: boolean;
|
|
3822
|
+
/** Whether the routee is permitted to restart the route. */
|
|
3823
|
+
AllowRestart?: boolean;
|
|
3824
|
+
/** Existing response HTML, if any. */
|
|
3825
|
+
ResponseHtml?: string | undefined;
|
|
3826
|
+
/** Existing response code, if any. */
|
|
3827
|
+
ResponseCode?: string | undefined;
|
|
3828
|
+
/** Available response-code choices (Key = code, Value = description). */
|
|
3829
|
+
ResponseCodeChoices?: SelectCodeNode[] | undefined;
|
|
3830
|
+
/** 59-minute MachineKey-protected token; sent back as the X-SF-ARR header on subsequent ARR calls. */
|
|
3831
|
+
AccessToken?: string | undefined;
|
|
3832
|
+
}
|
|
3833
|
+
/** Request body for ARRController.RecordResponse. */
|
|
3834
|
+
export interface ArrResponseData {
|
|
3835
|
+
/** SendOn | SendBack | Restart */
|
|
3836
|
+
Mode?: string | undefined;
|
|
3837
|
+
/** Route being acted on (must match the ARR token's route). */
|
|
3838
|
+
RouteID?: string;
|
|
3839
|
+
/** Response HTML produced by the editor. */
|
|
3840
|
+
ResponseHtml?: string | undefined;
|
|
3841
|
+
/** Selected response code, if any. */
|
|
3842
|
+
ResponseCode?: string | undefined;
|
|
3843
|
+
/** When true, email a confirmation to the routee. */
|
|
3844
|
+
SendConfirmation?: boolean;
|
|
3845
|
+
}
|
|
3846
|
+
/** Result of ARRController.RecordResponse. */
|
|
3847
|
+
export interface ArrResponseResult {
|
|
3848
|
+
/** True when the response was saved. */
|
|
3849
|
+
Saved?: boolean;
|
|
3850
|
+
/** Resulting route status code. */
|
|
3851
|
+
Status?: string | undefined;
|
|
3852
|
+
/** Human-readable result message. */
|
|
3853
|
+
Message?: string | undefined;
|
|
3854
|
+
}
|
|
3735
3855
|
export interface AuthenticationExchangeData {
|
|
3736
3856
|
XID?: string | undefined;
|
|
3737
3857
|
IsValid?: boolean;
|
package/dist/SwaggerClients.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// </auto-generated>
|
|
6
6
|
//----------------------
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ApiException = exports.SeatType = exports.PermissionFlags = exports.HttpStatusCode = exports.XTSClient = exports.UICFGClient = exports.SystemClient = exports.SessionClient = exports.ProjectsClient = exports.ProjectTeamClient = exports.ProjectKPIClient = exports.ProjectDocListClient = exports.ProjectToolsClient = exports.ExcelToolsClient = exports.DocumentToolsClient = exports.ContactClient = exports.ConfigClient = exports.CatalogClient = exports.LookupClient = exports.AlertsClient = exports.ActionItemsClient = exports.AccountClient = void 0;
|
|
8
|
+
exports.ApiException = exports.SeatType = exports.PermissionFlags = exports.HttpStatusCode = exports.XTSClient = exports.UICFGClient = exports.SystemClient = exports.SessionClient = exports.ProjectsClient = exports.ProjectTeamClient = exports.ProjectKPIClient = exports.ProjectDocListClient = exports.ProjectToolsClient = exports.ExcelToolsClient = exports.DocumentToolsClient = exports.ContactClient = exports.ConfigClient = exports.CatalogClient = exports.ARRClient = exports.LookupClient = exports.AlertsClient = exports.ActionItemsClient = exports.AccountClient = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
// ReSharper disable InconsistentNaming
|
|
11
11
|
const APIClientBase_1 = require("./APIClientBase");
|
|
@@ -232,6 +232,64 @@ class AccountClient extends APIClientBase_1.APIClientBase {
|
|
|
232
232
|
}
|
|
233
233
|
return null;
|
|
234
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Mint a short-lived download-session cookie
|
|
237
|
+
* @return Download cookie set (or an sfSession cookie was already present)
|
|
238
|
+
*/
|
|
239
|
+
postDownloadSession() {
|
|
240
|
+
return new Promise((resolve, reject) => {
|
|
241
|
+
this.postDownloadSessionWithCallbacks((result) => resolve(result), (exception, _reason) => reject(exception));
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
postDownloadSessionWithCallbacks(onSuccess, onFail) {
|
|
245
|
+
let url_ = this.baseUrl + "/api/account/downloadsession";
|
|
246
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
247
|
+
jQuery.ajax({
|
|
248
|
+
url: url_,
|
|
249
|
+
beforeSend: this.beforeSend,
|
|
250
|
+
type: "post",
|
|
251
|
+
dataType: "text",
|
|
252
|
+
headers: {
|
|
253
|
+
"Accept": "application/json"
|
|
254
|
+
}
|
|
255
|
+
}).done((_data, _textStatus, xhr) => {
|
|
256
|
+
this.processPostDownloadSessionWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
257
|
+
}).fail((xhr) => {
|
|
258
|
+
this.processPostDownloadSessionWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
processPostDownloadSessionWithCallbacks(_url, xhr, onSuccess, onFail) {
|
|
262
|
+
try {
|
|
263
|
+
let result = this.transformResult(_url, xhr, (xhr) => this.processPostDownloadSession(xhr));
|
|
264
|
+
if (onSuccess !== undefined)
|
|
265
|
+
onSuccess(result);
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
if (onFail !== undefined)
|
|
269
|
+
onFail(e, "http_service_exception");
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
processPostDownloadSession(xhr) {
|
|
273
|
+
const status = xhr.status;
|
|
274
|
+
let _headers = {};
|
|
275
|
+
if (status === 204) {
|
|
276
|
+
const _responseText = xhr.responseText;
|
|
277
|
+
let result204 = null;
|
|
278
|
+
result204 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
279
|
+
return result204;
|
|
280
|
+
}
|
|
281
|
+
else if (status === 401) {
|
|
282
|
+
const _responseText = xhr.responseText;
|
|
283
|
+
let result401 = null;
|
|
284
|
+
result401 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
285
|
+
return throwException("No recognized identity", status, _responseText, _headers, result401);
|
|
286
|
+
}
|
|
287
|
+
else if (status !== 200 && status !== 204) {
|
|
288
|
+
const _responseText = xhr.responseText;
|
|
289
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
290
|
+
}
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
235
293
|
/**
|
|
236
294
|
* Digest an identity from an Google token
|
|
237
295
|
* @param subId google nonvolatile id
|
|
@@ -2858,6 +2916,253 @@ class LookupClient extends APIClientBase_1.APIClientBase {
|
|
|
2858
2916
|
}
|
|
2859
2917
|
}
|
|
2860
2918
|
exports.LookupClient = LookupClient;
|
|
2919
|
+
class ARRClient extends APIClientBase_1.APIClientBase {
|
|
2920
|
+
baseUrl;
|
|
2921
|
+
beforeSend = undefined;
|
|
2922
|
+
jsonParseReviver = undefined;
|
|
2923
|
+
constructor(baseUrl) {
|
|
2924
|
+
super();
|
|
2925
|
+
this.baseUrl = baseUrl ?? this.getBaseUrl("https://dev.spitfirepm.com:8443/SFPMS");
|
|
2926
|
+
}
|
|
2927
|
+
/**
|
|
2928
|
+
* Build the routed-content download package
|
|
2929
|
+
* @param data download request {RouteID}
|
|
2930
|
+
*/
|
|
2931
|
+
getContent(data) {
|
|
2932
|
+
return new Promise((resolve, reject) => {
|
|
2933
|
+
this.getContentWithCallbacks(data, (result) => resolve(result), (exception, _reason) => reject(exception));
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
getContentWithCallbacks(data, onSuccess, onFail) {
|
|
2937
|
+
let url_ = this.baseUrl + "/api/arr/content";
|
|
2938
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2939
|
+
const content_ = JSON.stringify(data);
|
|
2940
|
+
jQuery.ajax({
|
|
2941
|
+
url: url_,
|
|
2942
|
+
beforeSend: this.beforeSend,
|
|
2943
|
+
type: "post",
|
|
2944
|
+
data: content_,
|
|
2945
|
+
dataType: "text",
|
|
2946
|
+
headers: {
|
|
2947
|
+
"Content-Type": "application/json",
|
|
2948
|
+
"Accept": "application/json"
|
|
2949
|
+
}
|
|
2950
|
+
}).done((_data, _textStatus, xhr) => {
|
|
2951
|
+
this.processGetContentWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
2952
|
+
}).fail((xhr) => {
|
|
2953
|
+
this.processGetContentWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
processGetContentWithCallbacks(_url, xhr, onSuccess, onFail) {
|
|
2957
|
+
try {
|
|
2958
|
+
let result = this.transformResult(_url, xhr, (xhr) => this.processGetContent(xhr));
|
|
2959
|
+
if (onSuccess !== undefined)
|
|
2960
|
+
onSuccess(result);
|
|
2961
|
+
}
|
|
2962
|
+
catch (e) {
|
|
2963
|
+
if (onFail !== undefined)
|
|
2964
|
+
onFail(e, "http_service_exception");
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
processGetContent(xhr) {
|
|
2968
|
+
const status = xhr.status;
|
|
2969
|
+
let _headers = {};
|
|
2970
|
+
if (status === 200) {
|
|
2971
|
+
const _responseText = xhr.responseText;
|
|
2972
|
+
let result200 = null;
|
|
2973
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2974
|
+
return result200;
|
|
2975
|
+
}
|
|
2976
|
+
else if (status === 401) {
|
|
2977
|
+
const _responseText = xhr.responseText;
|
|
2978
|
+
let result401 = null;
|
|
2979
|
+
result401 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2980
|
+
return throwException("ARR token missing/expired", status, _responseText, _headers, result401);
|
|
2981
|
+
}
|
|
2982
|
+
else if (status === 404) {
|
|
2983
|
+
const _responseText = xhr.responseText;
|
|
2984
|
+
let result404 = null;
|
|
2985
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2986
|
+
return throwException("Route/content not found", status, _responseText, _headers, result404);
|
|
2987
|
+
}
|
|
2988
|
+
else if (status === 409) {
|
|
2989
|
+
const _responseText = xhr.responseText;
|
|
2990
|
+
let result409 = null;
|
|
2991
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2992
|
+
return throwException("Token does not match this route", status, _responseText, _headers, result409);
|
|
2993
|
+
}
|
|
2994
|
+
else if (status === 500) {
|
|
2995
|
+
const _responseText = xhr.responseText;
|
|
2996
|
+
let result500 = null;
|
|
2997
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2998
|
+
return throwException("Could not build package; see response", status, _responseText, _headers, result500);
|
|
2999
|
+
}
|
|
3000
|
+
else if (status !== 200 && status !== 204) {
|
|
3001
|
+
const _responseText = xhr.responseText;
|
|
3002
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3003
|
+
}
|
|
3004
|
+
return null;
|
|
3005
|
+
}
|
|
3006
|
+
/**
|
|
3007
|
+
* Open a route-response link
|
|
3008
|
+
* @param request open request {StepKey, RouteID}
|
|
3009
|
+
*/
|
|
3010
|
+
openRoute(request) {
|
|
3011
|
+
return new Promise((resolve, reject) => {
|
|
3012
|
+
this.openRouteWithCallbacks(request, (result) => resolve(result), (exception, _reason) => reject(exception));
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
openRouteWithCallbacks(request, onSuccess, onFail) {
|
|
3016
|
+
let url_ = this.baseUrl + "/api/arr/open";
|
|
3017
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3018
|
+
const content_ = JSON.stringify(request);
|
|
3019
|
+
jQuery.ajax({
|
|
3020
|
+
url: url_,
|
|
3021
|
+
beforeSend: this.beforeSend,
|
|
3022
|
+
type: "post",
|
|
3023
|
+
data: content_,
|
|
3024
|
+
dataType: "text",
|
|
3025
|
+
headers: {
|
|
3026
|
+
"Content-Type": "application/json",
|
|
3027
|
+
"Accept": "application/json"
|
|
3028
|
+
}
|
|
3029
|
+
}).done((_data, _textStatus, xhr) => {
|
|
3030
|
+
this.processOpenRouteWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
3031
|
+
}).fail((xhr) => {
|
|
3032
|
+
this.processOpenRouteWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
processOpenRouteWithCallbacks(_url, xhr, onSuccess, onFail) {
|
|
3036
|
+
try {
|
|
3037
|
+
let result = this.transformResult(_url, xhr, (xhr) => this.processOpenRoute(xhr));
|
|
3038
|
+
if (onSuccess !== undefined)
|
|
3039
|
+
onSuccess(result);
|
|
3040
|
+
}
|
|
3041
|
+
catch (e) {
|
|
3042
|
+
if (onFail !== undefined)
|
|
3043
|
+
onFail(e, "http_service_exception");
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
processOpenRoute(xhr) {
|
|
3047
|
+
const status = xhr.status;
|
|
3048
|
+
let _headers = {};
|
|
3049
|
+
if (status === 200) {
|
|
3050
|
+
const _responseText = xhr.responseText;
|
|
3051
|
+
let result200 = null;
|
|
3052
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3053
|
+
return result200;
|
|
3054
|
+
}
|
|
3055
|
+
else if (status === 400) {
|
|
3056
|
+
const _responseText = xhr.responseText;
|
|
3057
|
+
let result400 = null;
|
|
3058
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3059
|
+
return throwException("Keys missing or malformed", status, _responseText, _headers, result400);
|
|
3060
|
+
}
|
|
3061
|
+
else if (status === 404) {
|
|
3062
|
+
const _responseText = xhr.responseText;
|
|
3063
|
+
let result404 = null;
|
|
3064
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3065
|
+
return throwException("Route step or route not found / withdrawn", status, _responseText, _headers, result404);
|
|
3066
|
+
}
|
|
3067
|
+
else if (status === 500) {
|
|
3068
|
+
const _responseText = xhr.responseText;
|
|
3069
|
+
let result500 = null;
|
|
3070
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3071
|
+
return throwException("Internal failure; see response", status, _responseText, _headers, result500);
|
|
3072
|
+
}
|
|
3073
|
+
else if (status !== 200 && status !== 204) {
|
|
3074
|
+
const _responseText = xhr.responseText;
|
|
3075
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3076
|
+
}
|
|
3077
|
+
return null;
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* Record a route response
|
|
3081
|
+
* @param data response data
|
|
3082
|
+
*/
|
|
3083
|
+
recordResponse(data) {
|
|
3084
|
+
return new Promise((resolve, reject) => {
|
|
3085
|
+
this.recordResponseWithCallbacks(data, (result) => resolve(result), (exception, _reason) => reject(exception));
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
recordResponseWithCallbacks(data, onSuccess, onFail) {
|
|
3089
|
+
let url_ = this.baseUrl + "/api/arr/response";
|
|
3090
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3091
|
+
const content_ = JSON.stringify(data);
|
|
3092
|
+
jQuery.ajax({
|
|
3093
|
+
url: url_,
|
|
3094
|
+
beforeSend: this.beforeSend,
|
|
3095
|
+
type: "post",
|
|
3096
|
+
data: content_,
|
|
3097
|
+
dataType: "text",
|
|
3098
|
+
headers: {
|
|
3099
|
+
"Content-Type": "application/json",
|
|
3100
|
+
"Accept": "application/json"
|
|
3101
|
+
}
|
|
3102
|
+
}).done((_data, _textStatus, xhr) => {
|
|
3103
|
+
this.processRecordResponseWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
3104
|
+
}).fail((xhr) => {
|
|
3105
|
+
this.processRecordResponseWithCallbacks(url_, xhr, onSuccess, onFail);
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
processRecordResponseWithCallbacks(_url, xhr, onSuccess, onFail) {
|
|
3109
|
+
try {
|
|
3110
|
+
let result = this.transformResult(_url, xhr, (xhr) => this.processRecordResponse(xhr));
|
|
3111
|
+
if (onSuccess !== undefined)
|
|
3112
|
+
onSuccess(result);
|
|
3113
|
+
}
|
|
3114
|
+
catch (e) {
|
|
3115
|
+
if (onFail !== undefined)
|
|
3116
|
+
onFail(e, "http_service_exception");
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
processRecordResponse(xhr) {
|
|
3120
|
+
const status = xhr.status;
|
|
3121
|
+
let _headers = {};
|
|
3122
|
+
if (status === 200) {
|
|
3123
|
+
const _responseText = xhr.responseText;
|
|
3124
|
+
let result200 = null;
|
|
3125
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3126
|
+
return result200;
|
|
3127
|
+
}
|
|
3128
|
+
else if (status === 400) {
|
|
3129
|
+
const _responseText = xhr.responseText;
|
|
3130
|
+
let result400 = null;
|
|
3131
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3132
|
+
return throwException("Request missing required information", status, _responseText, _headers, result400);
|
|
3133
|
+
}
|
|
3134
|
+
else if (status === 401) {
|
|
3135
|
+
const _responseText = xhr.responseText;
|
|
3136
|
+
let result401 = null;
|
|
3137
|
+
result401 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3138
|
+
return throwException("ARR token missing/expired", status, _responseText, _headers, result401);
|
|
3139
|
+
}
|
|
3140
|
+
else if (status === 404) {
|
|
3141
|
+
const _responseText = xhr.responseText;
|
|
3142
|
+
let result404 = null;
|
|
3143
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3144
|
+
return throwException("Route not found", status, _responseText, _headers, result404);
|
|
3145
|
+
}
|
|
3146
|
+
else if (status === 409) {
|
|
3147
|
+
const _responseText = xhr.responseText;
|
|
3148
|
+
let result409 = null;
|
|
3149
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3150
|
+
return throwException("Token does not match this route", status, _responseText, _headers, result409);
|
|
3151
|
+
}
|
|
3152
|
+
else if (status === 500) {
|
|
3153
|
+
const _responseText = xhr.responseText;
|
|
3154
|
+
let result500 = null;
|
|
3155
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3156
|
+
return throwException("Could not save; see response", status, _responseText, _headers, result500);
|
|
3157
|
+
}
|
|
3158
|
+
else if (status !== 200 && status !== 204) {
|
|
3159
|
+
const _responseText = xhr.responseText;
|
|
3160
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3161
|
+
}
|
|
3162
|
+
return null;
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
exports.ARRClient = ARRClient;
|
|
2861
3166
|
class CatalogClient extends APIClientBase_1.APIClientBase {
|
|
2862
3167
|
baseUrl;
|
|
2863
3168
|
beforeSend = undefined;
|