spitfirepm 23.8711.3 → 23.8711.4
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 +74 -26
- 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.4";
|
|
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
|
}
|
|
@@ -2833,10 +2845,13 @@ class sfRestClient {
|
|
|
2833
2845
|
pgname = pgHash; // for xb style
|
|
2834
2846
|
if (pgname.endsWith("pvp.aspx"))
|
|
2835
2847
|
pgname = this.GetPageQueryParameterByName("vpg");
|
|
2836
|
-
|
|
2848
|
+
const lowerPG = pgname.toLowerCase();
|
|
2849
|
+
if (lowerPG.includes("arr.aspx"))
|
|
2837
2850
|
pgname = "arr"; // maps to RouteWizard
|
|
2838
|
-
if (
|
|
2851
|
+
else if (lowerPG.includes("sscontent.aspx"))
|
|
2839
2852
|
pgname = "sscontent"; // maps to RouteWizard
|
|
2853
|
+
else if (lowerPG.includes("go.aspx"))
|
|
2854
|
+
pgname = "go"; // external
|
|
2840
2855
|
if (pgname.indexOf("/") >= 0)
|
|
2841
2856
|
pgname = pgname.substring(pgname.lastIndexOf("/") + 1);
|
|
2842
2857
|
if (pgname.indexOf("?") >= 0)
|
|
@@ -2961,7 +2976,7 @@ class sfRestClient {
|
|
|
2961
2976
|
result = sfRestClient._WCC.Project;
|
|
2962
2977
|
else {
|
|
2963
2978
|
const pageName = this.ResolvePageName();
|
|
2964
|
-
if (["executiveDashboard", "catalog", "home", "pivot", "diagnostic-tools"].find(el => el === pageName))
|
|
2979
|
+
if (["executiveDashboard", "catalog", "home", "pivot", "diagnostic-tools", "go"].find(el => el === pageName))
|
|
2965
2980
|
noResultOK = true;
|
|
2966
2981
|
}
|
|
2967
2982
|
if (!result && !noResultOK)
|
|
@@ -5303,12 +5318,22 @@ class sfRestClient {
|
|
|
5303
5318
|
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for hub */ }, 123);
|
|
5304
5319
|
return;
|
|
5305
5320
|
}
|
|
5306
|
-
|
|
5321
|
+
const isWebix = RESTClient.isWebix();
|
|
5322
|
+
if (this.IsPageOfType(this.PageTypeNames.Unauthenticated)) {
|
|
5307
5323
|
if (sfRestClient._Options.LogLevel >= LoggingLevels.Verbose)
|
|
5308
|
-
console.log(
|
|
5324
|
+
console.log(`pingServer() Log in pending (ignored ${sfRestClient._RepeatedPingRetryDelay})`);
|
|
5309
5325
|
this.CheckForSystemNotification();
|
|
5310
|
-
|
|
5311
|
-
|
|
5326
|
+
const returnTo = RESTClient.GetPageQueryParameterByName("ReturnUrl");
|
|
5327
|
+
if (returnTo) {
|
|
5328
|
+
const m = RESTClient.GetPowerUXRouteHelper().helpers.GenerateMessage("FYI:The requested resource requires authentication...", "debug");
|
|
5329
|
+
if (isWebix) {
|
|
5330
|
+
self.webix?.message(m);
|
|
5331
|
+
}
|
|
5332
|
+
else
|
|
5333
|
+
RESTClient.DisplayUserNotification(m.text);
|
|
5334
|
+
}
|
|
5335
|
+
sfRestClient._RepeatedPingRetryDelay++;
|
|
5336
|
+
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for login */ }, 2345 + (sfRestClient._RepeatedPingRetryDelay * 555));
|
|
5312
5337
|
return;
|
|
5313
5338
|
}
|
|
5314
5339
|
const isDocumentPage = RESTClient.IsDocumentPage();
|
|
@@ -5324,6 +5349,7 @@ class sfRestClient {
|
|
|
5324
5349
|
sfRestClient._NextPingTimerID = setTimeout(() => { RESTClient.pingServer(); /* wait for doc context */ }, 345);
|
|
5325
5350
|
return;
|
|
5326
5351
|
}
|
|
5352
|
+
sfRestClient._RepeatedPingRetryDelay = 0;
|
|
5327
5353
|
var retryInterval = (sfRestClient._Options.BasicPingServerInterval * (1.1 + Math.random()));
|
|
5328
5354
|
var $ALERT;
|
|
5329
5355
|
var ActionAfterAlert = "";
|
|
@@ -5518,16 +5544,34 @@ class sfRestClient {
|
|
|
5518
5544
|
console.log("pingServer() NAK persists....");
|
|
5519
5545
|
const AuthenticationMessage = sfRestClient.PageNotificationCount < 2 ? 'Authentication required' : 'Lost authentication.';
|
|
5520
5546
|
RESTClient.DisplayUserNotification(AuthenticationMessage, 65432);
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5547
|
+
let defaultLogoutOnTimer = true;
|
|
5548
|
+
if (self.webix) {
|
|
5549
|
+
if (1 === 1) { //RESTClient.DevMode()
|
|
5550
|
+
self.webix
|
|
5551
|
+
.confirm({ title: "Connection Check",
|
|
5552
|
+
ok: 'Logout',
|
|
5553
|
+
text: `Authentication ${sfRestClient.PageNotificationCount < 2 ? 'Required' : 'Revoked'}. <br/> Returning to login page!`,
|
|
5554
|
+
type: "alert-warning",
|
|
5555
|
+
}).then((r) => {
|
|
5556
|
+
if (r)
|
|
5557
|
+
this.NavigateToLogout("auth-lost-immediate");
|
|
5558
|
+
else
|
|
5559
|
+
self.webix?.message("ok...");
|
|
5560
|
+
});
|
|
5561
|
+
defaultLogoutOnTimer = false;
|
|
5562
|
+
}
|
|
5563
|
+
else
|
|
5564
|
+
self.webix
|
|
5565
|
+
.alert({ title: "Connection Check",
|
|
5566
|
+
ok: 'Dismiss',
|
|
5567
|
+
text: `Authentication ${sfRestClient.PageNotificationCount < 2 ? 'Required' : 'Revoked'}. <br/> Returning to login page!`,
|
|
5568
|
+
type: "alert-warning",
|
|
5569
|
+
}).then((r) => {
|
|
5570
|
+
this.NavigateToLogout("auth-lost-immediate");
|
|
5571
|
+
});
|
|
5572
|
+
}
|
|
5573
|
+
if (defaultLogoutOnTimer)
|
|
5574
|
+
this.NavigateToLogout("auth-lost", 19753);
|
|
5531
5575
|
}
|
|
5532
5576
|
else {
|
|
5533
5577
|
responseText = "NAK:Rejuvinated";
|
|
@@ -5696,12 +5740,14 @@ class sfRestClient {
|
|
|
5696
5740
|
*/
|
|
5697
5741
|
DevMode(minVerbosity) {
|
|
5698
5742
|
let result = top?.sfClient?.GetPageContextValue("DevMode", false);
|
|
5743
|
+
if (!result && !location.hostname.includes("."))
|
|
5744
|
+
result = true;
|
|
5699
5745
|
if (minVerbosity && result) {
|
|
5700
5746
|
result = (sfRestClient._Options.LogLevel >= minVerbosity);
|
|
5701
5747
|
}
|
|
5702
5748
|
return result;
|
|
5703
5749
|
}
|
|
5704
|
-
/** Returns
|
|
5750
|
+
/** Returns a UI object for working with a database field */
|
|
5705
5751
|
DBF2TableandTblField(source) {
|
|
5706
5752
|
var result = { isValid: false, table: "", field: "", dbf: "", isRO: false };
|
|
5707
5753
|
let dbf = "";
|
|
@@ -5819,8 +5865,9 @@ class sfRestClient {
|
|
|
5819
5865
|
Document: 1024,
|
|
5820
5866
|
Unknown: 8092,
|
|
5821
5867
|
Unauthenticated: 16384,
|
|
5822
|
-
|
|
5823
|
-
|
|
5868
|
+
UnauthenticatedLogin: 16385,
|
|
5869
|
+
UnauthenticatedWizard: 16386,
|
|
5870
|
+
UnauthenticatedLink: 16388,
|
|
5824
5871
|
UserAccountRecovery: 16387,
|
|
5825
5872
|
DiagUtilities: 32768,
|
|
5826
5873
|
PopupAdminTool: 131072,
|
|
@@ -6066,6 +6113,7 @@ sfRestClient.ResolvedIntlFormat = {
|
|
|
6066
6113
|
NumericGroupSeparator: ","
|
|
6067
6114
|
};
|
|
6068
6115
|
sfRestClient._NextPingTimerID = undefined;
|
|
6116
|
+
sfRestClient._RepeatedPingRetryDelay = 0;
|
|
6069
6117
|
sfRestClient.PageServerPingAttempts = 0;
|
|
6070
6118
|
sfRestClient.PageServerPingOK = 0;
|
|
6071
6119
|
sfRestClient.PageServerPingFailRunCount = 0;
|