spitfirepm 23.8711.3 → 23.8711.5
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/globals.d.ts +27 -0
- package/dist/sfRESTClient.d.ts +7 -3
- package/dist/sfRESTClient.js +78 -28
- package/dist/sfRESTClient.js.map +1 -1
- package/package.json +1 -1
package/dist/globals.d.ts
CHANGED
|
@@ -118,12 +118,39 @@ declare global {
|
|
|
118
118
|
type?: "alert-warning" | "alert-error";
|
|
119
119
|
}): Promise<boolean>;
|
|
120
120
|
};
|
|
121
|
+
confirm: {
|
|
122
|
+
(options: {
|
|
123
|
+
title: string;
|
|
124
|
+
ok?: string;
|
|
125
|
+
text: string;
|
|
126
|
+
type?: "alert-warning" | "alert-error";
|
|
127
|
+
}): Promise<boolean>;
|
|
128
|
+
};
|
|
129
|
+
message: {
|
|
130
|
+
(msg: string | iWebixMessage): void;
|
|
131
|
+
};
|
|
121
132
|
}
|
|
122
133
|
export interface iWebixSpinner {
|
|
123
134
|
show: {
|
|
124
135
|
(): void;
|
|
125
136
|
};
|
|
126
137
|
}
|
|
138
|
+
export type iWebixMessageType = 'info' | 'debug' | 'success' | 'error';
|
|
139
|
+
export interface iWebixMessage {
|
|
140
|
+
text: string;
|
|
141
|
+
type: iWebixMessageType;
|
|
142
|
+
expire: number;
|
|
143
|
+
id: string;
|
|
144
|
+
}
|
|
145
|
+
export interface iRouteHelperService {
|
|
146
|
+
_appContext: object;
|
|
147
|
+
helpers: {
|
|
148
|
+
OpenEmail: {
|
|
149
|
+
(to: string, subject: string, cc?: string, body?: string): void;
|
|
150
|
+
};
|
|
151
|
+
GenerateMessage(what: string, type: iWebixMessageType): iWebixMessage;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
127
154
|
export interface iPowerUXDocumentUI {
|
|
128
155
|
ReallyReady: Promise<boolean>;
|
|
129
156
|
app: object;
|
package/dist/sfRESTClient.d.ts
CHANGED
|
@@ -256,8 +256,9 @@ export declare class sfRestClient {
|
|
|
256
256
|
Document: number;
|
|
257
257
|
Unknown: number;
|
|
258
258
|
Unauthenticated: number;
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
UnauthenticatedLogin: number;
|
|
260
|
+
UnauthenticatedWizard: number;
|
|
261
|
+
UnauthenticatedLink: number;
|
|
261
262
|
UserAccountRecovery: number;
|
|
262
263
|
DiagUtilities: number;
|
|
263
264
|
PopupAdminTool: number;
|
|
@@ -661,6 +662,8 @@ export declare class sfRestClient {
|
|
|
661
662
|
/** returns a references to the page document UI, including header */
|
|
662
663
|
GetPowerUXDocumentUI(): iPowerUXDocumentUI | undefined;
|
|
663
664
|
isWebix(): boolean;
|
|
665
|
+
/** requires isWebix() to be true */
|
|
666
|
+
GetPowerUXRouteHelper(): iRouteHelperService;
|
|
664
667
|
IsDocExclusiveToMe(): boolean;
|
|
665
668
|
static IsPowerUXPage(): boolean;
|
|
666
669
|
IsPowerUXPage(): boolean;
|
|
@@ -982,6 +985,7 @@ export declare class sfRestClient {
|
|
|
982
985
|
heartbeat(): void;
|
|
983
986
|
ResetUnsavedChangesAndCloseThisWindow(): void;
|
|
984
987
|
protected static _NextPingTimerID: number | undefined;
|
|
988
|
+
protected static _RepeatedPingRetryDelay: number;
|
|
985
989
|
pingServer(): Promise<void>;
|
|
986
990
|
static PageServerPingAttempts: number;
|
|
987
991
|
static PageServerPingOK: number;
|
|
@@ -1003,7 +1007,7 @@ export declare class sfRestClient {
|
|
|
1003
1007
|
* @comment Turn DevMode on or off from console: top.sfClient.exports.sfRestClient._WCC.DevMode = false; (or true)
|
|
1004
1008
|
*/
|
|
1005
1009
|
DevMode(minVerbosity?: LoggingLevels): boolean;
|
|
1006
|
-
/** Returns
|
|
1010
|
+
/** Returns a UI object for working with a database field */
|
|
1007
1011
|
DBF2TableandTblField(source: string | JQuery<HTMLElement>): TableAndFieldInfo;
|
|
1008
1012
|
/** returns true if Event Tracing is on (1) or if Dev Mode (0) AND the event name is not filtered out by Options.WxEventFilter
|
|
1009
1013
|
*
|
package/dist/sfRESTClient.js
CHANGED
|
@@ -8,7 +8,7 @@ const BrowserExtensionChecker_1 = require("./BrowserExtensionChecker");
|
|
|
8
8
|
const RESTClientBase = require("./APIClientBase"); // avoid conflict with same in SwaggerClient when loaded by classic UI
|
|
9
9
|
const string_extensions_1 = require("./string.extensions");
|
|
10
10
|
//import {dialog} from "jquery-ui";
|
|
11
|
-
const ClientPackageVersion = "23.8711.
|
|
11
|
+
const ClientPackageVersion = "23.8711.5";
|
|
12
12
|
// originally modified for typescript and linter requirements by Uladzislau Kumakou
|
|
13
13
|
var LoggingLevels;
|
|
14
14
|
(function (LoggingLevels) {
|
|
@@ -1867,7 +1867,7 @@ class sfRestClient {
|
|
|
1867
1867
|
console.log(`LoadUserSessionInfo(getWCC) catch`, x);
|
|
1868
1868
|
if (RESTClient.IsRESTErrorResponse(x)) {
|
|
1869
1869
|
if (x.ThisStatus === 401) {
|
|
1870
|
-
let IsLoginRelatedPage = RESTClient.IsPageOfType(RESTClient.PageTypeNames.
|
|
1870
|
+
let IsLoginRelatedPage = RESTClient.IsPageOfType(RESTClient.PageTypeNames.UnauthenticatedLogin);
|
|
1871
1871
|
if (!IsLoginRelatedPage && RESTClient.IsPageOfType(RESTClient.PageTypeNames.UserAccountRecovery))
|
|
1872
1872
|
IsLoginRelatedPage = true;
|
|
1873
1873
|
if (!IsLoginRelatedPage && (top?.name === "Dashboard" || this.IsHomeDashboardPage())) { // do we need more here?
|
|
@@ -2687,6 +2687,10 @@ class sfRestClient {
|
|
|
2687
2687
|
isWebix() {
|
|
2688
2688
|
return typeof self.$$ === "function";
|
|
2689
2689
|
}
|
|
2690
|
+
/** requires isWebix() to be true */
|
|
2691
|
+
GetPowerUXRouteHelper() {
|
|
2692
|
+
return self.$$("$layout1").$scope.app._services.routetools;
|
|
2693
|
+
}
|
|
2690
2694
|
IsDocExclusiveToMe() {
|
|
2691
2695
|
return ((!this.IsDocumentPage()) || (sfRestClient._WCC.DataLockFlag >= "2"));
|
|
2692
2696
|
}
|
|
@@ -2724,7 +2728,11 @@ class sfRestClient {
|
|
|
2724
2728
|
if (typeof pageWanted === "string") {
|
|
2725
2729
|
pageWanted = this.ResolveStringPageNametoPageTypeName(pageWanted);
|
|
2726
2730
|
}
|
|
2727
|
-
|
|
2731
|
+
const pageType = this.ResolvePageTypeName();
|
|
2732
|
+
let result = (pageType === pageWanted);
|
|
2733
|
+
if (!result && pageWanted === this.PageTypeNames.Unauthenticated)
|
|
2734
|
+
result = ((this.ResolvePageTypeName() & pageWanted) === pageWanted);
|
|
2735
|
+
return result;
|
|
2728
2736
|
}
|
|
2729
2737
|
IsGlobalInstance() {
|
|
2730
2738
|
return (window.sfClient && window.sfClient === this);
|
|
@@ -2772,11 +2780,14 @@ class sfRestClient {
|
|
|
2772
2780
|
case "login":
|
|
2773
2781
|
case "Logout":
|
|
2774
2782
|
case "loginRequired":
|
|
2775
|
-
result = this.PageTypeNames.
|
|
2783
|
+
result = this.PageTypeNames.UnauthenticatedLogin;
|
|
2776
2784
|
break;
|
|
2777
2785
|
case "arr":
|
|
2778
2786
|
case "sscontent":
|
|
2779
|
-
result = this.PageTypeNames.
|
|
2787
|
+
result = this.PageTypeNames.UnauthenticatedWizard;
|
|
2788
|
+
break;
|
|
2789
|
+
case "go":
|
|
2790
|
+
result = this.PageTypeNames.UnauthenticatedLink;
|
|
2780
2791
|
break;
|
|
2781
2792
|
case "dxutil":
|
|
2782
2793
|
case "diagnostic-tools":
|
|
@@ -2807,7 +2818,8 @@ class sfRestClient {
|
|
|
2807
2818
|
result = this.PageTypeNames.RichTextEdit;
|
|
2808
2819
|
break;
|
|
2809
2820
|
default:
|
|
2810
|
-
console.warn("
|
|
2821
|
+
console.warn("Unrecognized page type: ", pageNameString);
|
|
2822
|
+
//debugger;
|
|
2811
2823
|
result = this.PageTypeNames.Unknown;
|
|
2812
2824
|
break;
|
|
2813
2825
|
}
|
|
@@ -2827,16 +2839,21 @@ class sfRestClient {
|
|
|
2827
2839
|
return sfRestClient.ResolvedPageInfo.LastResolvedPageName;
|
|
2828
2840
|
const prefixLength = sfRestClient.__SiteRootURL.length + self.location.hostname.length + 1;
|
|
2829
2841
|
const hashPos = fromHref.indexOf("#");
|
|
2830
|
-
|
|
2831
|
-
|
|
2842
|
+
let pgname = fromHref.substring(prefixLength, hashPos);
|
|
2843
|
+
let pgHash = fromHref.substring(hashPos);
|
|
2832
2844
|
if (pgHash.length > 0)
|
|
2833
2845
|
pgname = pgHash; // for xb style
|
|
2846
|
+
if (pgname.includes("ReturnUrl"))
|
|
2847
|
+
pgname = this.SetNameValuePairInString(pgname, "ReturnUrl", "1");
|
|
2834
2848
|
if (pgname.endsWith("pvp.aspx"))
|
|
2835
2849
|
pgname = this.GetPageQueryParameterByName("vpg");
|
|
2836
|
-
|
|
2850
|
+
const lowerPG = pgname.toLowerCase();
|
|
2851
|
+
if (lowerPG.includes("arr.aspx"))
|
|
2837
2852
|
pgname = "arr"; // maps to RouteWizard
|
|
2838
|
-
if (
|
|
2853
|
+
else if (lowerPG.includes("sscontent.aspx"))
|
|
2839
2854
|
pgname = "sscontent"; // maps to RouteWizard
|
|
2855
|
+
else if (lowerPG.includes("go.aspx"))
|
|
2856
|
+
pgname = "go"; // external
|
|
2840
2857
|
if (pgname.indexOf("/") >= 0)
|
|
2841
2858
|
pgname = pgname.substring(pgname.lastIndexOf("/") + 1);
|
|
2842
2859
|
if (pgname.indexOf("?") >= 0)
|
|
@@ -2961,7 +2978,7 @@ class sfRestClient {
|
|
|
2961
2978
|
result = sfRestClient._WCC.Project;
|
|
2962
2979
|
else {
|
|
2963
2980
|
const pageName = this.ResolvePageName();
|
|
2964
|
-
if (["executiveDashboard", "catalog", "home", "pivot", "diagnostic-tools"].find(el => el === pageName))
|
|
2981
|
+
if (["executiveDashboard", "catalog", "home", "pivot", "diagnostic-tools", "go"].find(el => el === pageName))
|
|
2965
2982
|
noResultOK = true;
|
|
2966
2983
|
}
|
|
2967
2984
|
if (!result && !noResultOK)
|
|
@@ -5303,12 +5320,22 @@ class sfRestClient {
|
|
|
5303
5320
|
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for hub */ }, 123);
|
|
5304
5321
|
return;
|
|
5305
5322
|
}
|
|
5306
|
-
|
|
5323
|
+
const isWebix = RESTClient.isWebix();
|
|
5324
|
+
if (this.IsPageOfType(this.PageTypeNames.Unauthenticated)) {
|
|
5307
5325
|
if (sfRestClient._Options.LogLevel >= LoggingLevels.Verbose)
|
|
5308
|
-
console.log(
|
|
5326
|
+
console.log(`pingServer() Log in pending (ignored ${sfRestClient._RepeatedPingRetryDelay})`);
|
|
5309
5327
|
this.CheckForSystemNotification();
|
|
5310
|
-
|
|
5311
|
-
|
|
5328
|
+
const returnTo = RESTClient.GetPageQueryParameterByName("ReturnUrl");
|
|
5329
|
+
if (returnTo) {
|
|
5330
|
+
const m = RESTClient.GetPowerUXRouteHelper().helpers.GenerateMessage("FYI:The requested resource requires authentication...", "debug");
|
|
5331
|
+
if (isWebix) {
|
|
5332
|
+
self.webix?.message(m);
|
|
5333
|
+
}
|
|
5334
|
+
else
|
|
5335
|
+
RESTClient.DisplayUserNotification(m.text);
|
|
5336
|
+
}
|
|
5337
|
+
sfRestClient._RepeatedPingRetryDelay++;
|
|
5338
|
+
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for login */ }, 2345 + (sfRestClient._RepeatedPingRetryDelay * 555));
|
|
5312
5339
|
return;
|
|
5313
5340
|
}
|
|
5314
5341
|
const isDocumentPage = RESTClient.IsDocumentPage();
|
|
@@ -5324,6 +5351,7 @@ class sfRestClient {
|
|
|
5324
5351
|
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for doc context */ }, 345);
|
|
5325
5352
|
return;
|
|
5326
5353
|
}
|
|
5354
|
+
sfRestClient._RepeatedPingRetryDelay = 0;
|
|
5327
5355
|
var retryInterval = (sfRestClient._Options.BasicPingServerInterval * (1.1 + Math.random()));
|
|
5328
5356
|
var $ALERT;
|
|
5329
5357
|
var ActionAfterAlert = "";
|
|
@@ -5518,16 +5546,34 @@ class sfRestClient {
|
|
|
5518
5546
|
console.log("pingServer() NAK persists....");
|
|
5519
5547
|
const AuthenticationMessage = sfRestClient.PageNotificationCount < 2 ? 'Authentication required' : 'Lost authentication.';
|
|
5520
5548
|
RESTClient.DisplayUserNotification(AuthenticationMessage, 65432);
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5549
|
+
let defaultLogoutOnTimer = true;
|
|
5550
|
+
if (self.webix) {
|
|
5551
|
+
if (1 === 1) { //RESTClient.DevMode()
|
|
5552
|
+
self.webix
|
|
5553
|
+
.confirm({ title: "Connection Check",
|
|
5554
|
+
ok: 'Logout',
|
|
5555
|
+
text: `Authentication ${sfRestClient.PageNotificationCount < 2 ? 'Required' : 'Revoked'}. <br/> Returning to login page!`,
|
|
5556
|
+
type: "alert-warning",
|
|
5557
|
+
}).then((r) => {
|
|
5558
|
+
if (r)
|
|
5559
|
+
this.NavigateToLogout("auth-lost-immediate");
|
|
5560
|
+
else
|
|
5561
|
+
self.webix?.message("ok...");
|
|
5562
|
+
});
|
|
5563
|
+
defaultLogoutOnTimer = false;
|
|
5564
|
+
}
|
|
5565
|
+
else
|
|
5566
|
+
self.webix
|
|
5567
|
+
.alert({ title: "Connection Check",
|
|
5568
|
+
ok: 'Dismiss',
|
|
5569
|
+
text: `Authentication ${sfRestClient.PageNotificationCount < 2 ? 'Required' : 'Revoked'}. <br/> Returning to login page!`,
|
|
5570
|
+
type: "alert-warning",
|
|
5571
|
+
}).then((r) => {
|
|
5572
|
+
this.NavigateToLogout("auth-lost-immediate");
|
|
5573
|
+
});
|
|
5574
|
+
}
|
|
5575
|
+
if (defaultLogoutOnTimer)
|
|
5576
|
+
this.NavigateToLogout("auth-lost", 19753);
|
|
5531
5577
|
}
|
|
5532
5578
|
else {
|
|
5533
5579
|
responseText = "NAK:Rejuvinated";
|
|
@@ -5696,12 +5742,14 @@ class sfRestClient {
|
|
|
5696
5742
|
*/
|
|
5697
5743
|
DevMode(minVerbosity) {
|
|
5698
5744
|
let result = top?.sfClient?.GetPageContextValue("DevMode", false);
|
|
5745
|
+
if (!result && !location.hostname.includes("."))
|
|
5746
|
+
result = true;
|
|
5699
5747
|
if (minVerbosity && result) {
|
|
5700
5748
|
result = (sfRestClient._Options.LogLevel >= minVerbosity);
|
|
5701
5749
|
}
|
|
5702
5750
|
return result;
|
|
5703
5751
|
}
|
|
5704
|
-
/** Returns
|
|
5752
|
+
/** Returns a UI object for working with a database field */
|
|
5705
5753
|
DBF2TableandTblField(source) {
|
|
5706
5754
|
var result = { isValid: false, table: "", field: "", dbf: "", isRO: false };
|
|
5707
5755
|
let dbf = "";
|
|
@@ -5819,8 +5867,9 @@ class sfRestClient {
|
|
|
5819
5867
|
Document: 1024,
|
|
5820
5868
|
Unknown: 8092,
|
|
5821
5869
|
Unauthenticated: 16384,
|
|
5822
|
-
|
|
5823
|
-
|
|
5870
|
+
UnauthenticatedLogin: 16385,
|
|
5871
|
+
UnauthenticatedWizard: 16386,
|
|
5872
|
+
UnauthenticatedLink: 16388,
|
|
5824
5873
|
UserAccountRecovery: 16387,
|
|
5825
5874
|
DiagUtilities: 32768,
|
|
5826
5875
|
PopupAdminTool: 131072,
|
|
@@ -6066,6 +6115,7 @@ sfRestClient.ResolvedIntlFormat = {
|
|
|
6066
6115
|
NumericGroupSeparator: ","
|
|
6067
6116
|
};
|
|
6068
6117
|
sfRestClient._NextPingTimerID = undefined;
|
|
6118
|
+
sfRestClient._RepeatedPingRetryDelay = 0;
|
|
6069
6119
|
sfRestClient.PageServerPingAttempts = 0;
|
|
6070
6120
|
sfRestClient.PageServerPingOK = 0;
|
|
6071
6121
|
sfRestClient.PageServerPingFailRunCount = 0;
|