@xh/hoist 67.0.0-SNAPSHOT.1723839594443 → 67.0.0-SNAPSHOT.1724286422850
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/CHANGELOG.md +1 -1
- package/admin/tabs/monitor/editor/MonitorEditorDialog.ts +2 -2
- package/build/types/core/XH.d.ts +0 -5
- package/build/types/svc/FetchService.d.ts +4 -2
- package/core/XH.ts +0 -10
- package/package.json +1 -1
- package/security/BaseOAuthClient.ts +5 -3
- package/svc/FetchService.ts +6 -3
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
new `FetchOptions.track` API (see below).
|
|
16
16
|
* If set on a fetch request, Correlation IDs are passed through to downstream error reporting
|
|
17
17
|
and are available for review in the Admin Console.
|
|
18
|
-
* New `XH.genUUID()` method to generate UUIDs for use as Correlation IDs or elsewhere.
|
|
19
18
|
* New `FetchOptions.track` - specify `TrackOptions` or message `string` to track a request via
|
|
20
19
|
Hoist activity tracking. The request's Correlation ID and LoadSpec will be included automatically.
|
|
21
20
|
* New global interceptors on `FetchService`. See `FetchService.addInterceptor()`.
|
|
22
21
|
* New property `FetchOptions.asJson` to instruct `FetchService` to decode an HTTP response as JSON.
|
|
23
22
|
Note that `FetchService` methods suffixed with `Json` will set this property automatically.
|
|
24
23
|
* `GridModel` will now accept `contextMenu: false` to omit context menus.
|
|
24
|
+
* Swapped locations of `primaryOnly` and `active` sliders in `MonitorEditorDialog`.
|
|
25
25
|
|
|
26
26
|
### 🐞 Bug Fixes
|
|
27
27
|
|
|
@@ -88,14 +88,14 @@ const modelSpec: RestGridConfig = {
|
|
|
88
88
|
editors: [
|
|
89
89
|
{field: 'code'},
|
|
90
90
|
{field: 'name'},
|
|
91
|
-
{field: '
|
|
91
|
+
{field: 'active'},
|
|
92
92
|
{field: 'metricType'},
|
|
93
93
|
{field: 'warnThreshold'},
|
|
94
94
|
{field: 'failThreshold'},
|
|
95
95
|
{field: 'metricUnit'},
|
|
96
96
|
{field: 'params'},
|
|
97
97
|
{field: 'notes', formField: {item: textArea()}},
|
|
98
|
-
{field: '
|
|
98
|
+
{field: 'primaryOnly'},
|
|
99
99
|
{field: 'sortOrder'},
|
|
100
100
|
{field: 'lastUpdated'},
|
|
101
101
|
{field: 'lastUpdatedBy'}
|
package/build/types/core/XH.d.ts
CHANGED
|
@@ -398,12 +398,7 @@ export declare class XHApi {
|
|
|
398
398
|
* Deliberately *not* intended to be globally unique, suitable for reuse, or to appear as such.
|
|
399
399
|
*/
|
|
400
400
|
genId(): string;
|
|
401
|
-
/**
|
|
402
|
-
* Generate a universally unique identifier (UUID). Useful for generating Correlation IDs.
|
|
403
|
-
*/
|
|
404
|
-
genUUID(): string;
|
|
405
401
|
private get acm();
|
|
406
|
-
private shortUniqueId;
|
|
407
402
|
}
|
|
408
403
|
/** The app-wide singleton instance. */
|
|
409
404
|
export declare const XH: XHApi;
|
|
@@ -24,14 +24,16 @@ import { IStringifyOptions } from 'qs';
|
|
|
24
24
|
export declare class FetchService extends HoistService {
|
|
25
25
|
static instance: FetchService;
|
|
26
26
|
NO_JSON_RESPONSES: StatusCodes[];
|
|
27
|
+
private idGenerator;
|
|
27
28
|
private autoAborters;
|
|
28
29
|
private _defaultHeaders;
|
|
29
30
|
private _interceptors;
|
|
30
31
|
/** True to auto-generate a Correlation ID for each request unless otherwise specified. */
|
|
31
32
|
autoGenCorrelationIds: boolean;
|
|
32
33
|
/**
|
|
33
|
-
* Method for generating Correlation ID's. Defaults to
|
|
34
|
-
*
|
|
34
|
+
* Method for generating Correlation ID's. Defaults to a 16 character random string with
|
|
35
|
+
* an extremely low probability of collisions. Applications may customize
|
|
36
|
+
* to improve readability or provide a stronger uniqueness guarantee.
|
|
35
37
|
*/
|
|
36
38
|
genCorrelationId: () => string;
|
|
37
39
|
/** Request header name to be used for Correlation ID tracking. */
|
package/core/XH.ts
CHANGED
|
@@ -63,7 +63,6 @@ import {
|
|
|
63
63
|
import {installServicesAsync} from './impl/InstallServices';
|
|
64
64
|
import {instanceManager} from './impl/InstanceManager';
|
|
65
65
|
import {HoistModel, ModelSelector, RefreshContextModel} from './model';
|
|
66
|
-
import ShortUniqueId from 'short-unique-id';
|
|
67
66
|
|
|
68
67
|
export const MIN_HOIST_CORE_VERSION = '18.0';
|
|
69
68
|
|
|
@@ -780,21 +779,12 @@ export class XHApi {
|
|
|
780
779
|
return uniqueId('xh-id-');
|
|
781
780
|
}
|
|
782
781
|
|
|
783
|
-
/**
|
|
784
|
-
* Generate a universally unique identifier (UUID). Useful for generating Correlation IDs.
|
|
785
|
-
*/
|
|
786
|
-
genUUID(): string {
|
|
787
|
-
return this.shortUniqueId.rnd();
|
|
788
|
-
}
|
|
789
|
-
|
|
790
782
|
//----------------
|
|
791
783
|
// Implementation
|
|
792
784
|
//----------------
|
|
793
785
|
private get acm(): AppContainerModel {
|
|
794
786
|
return this.appContainerModel;
|
|
795
787
|
}
|
|
796
|
-
|
|
797
|
-
private shortUniqueId = new ShortUniqueId({length: 16});
|
|
798
788
|
}
|
|
799
789
|
|
|
800
790
|
/** The app-wide singleton instance. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "67.0.0-SNAPSHOT.
|
|
3
|
+
"version": "67.0.0-SNAPSHOT.1724286422850",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|
|
@@ -11,6 +11,7 @@ import {Timer} from '@xh/hoist/utils/async';
|
|
|
11
11
|
import {MINUTES, olderThan, ONE_MINUTE, SECONDS} from '@xh/hoist/utils/datetime';
|
|
12
12
|
import {isJSON, throwIf} from '@xh/hoist/utils/js';
|
|
13
13
|
import {find, forEach, isEmpty, isObject, keys, pickBy, union} from 'lodash';
|
|
14
|
+
import ShortUniqueId from 'short-unique-id';
|
|
14
15
|
|
|
15
16
|
export type LoginMethod = 'REDIRECT' | 'POPUP';
|
|
16
17
|
|
|
@@ -253,11 +254,12 @@ export abstract class BaseOAuthClient<C extends BaseOAuthClientConfig<S>, S> ext
|
|
|
253
254
|
*/
|
|
254
255
|
protected captureRedirectState(): string {
|
|
255
256
|
const {pathname, search} = window.location,
|
|
257
|
+
key = new ShortUniqueId({length: 8}).rnd(),
|
|
256
258
|
state = {
|
|
257
|
-
key
|
|
258
|
-
timestamp: Date.now(),
|
|
259
|
+
key,
|
|
259
260
|
pathname,
|
|
260
|
-
search
|
|
261
|
+
search,
|
|
262
|
+
timestamp: Date.now()
|
|
261
263
|
};
|
|
262
264
|
|
|
263
265
|
const recs = this.getLocalStorage('xhOAuthState', []).filter(
|
package/svc/FetchService.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {apiDeprecated, warnIf} from '@xh/hoist/utils/js';
|
|
|
19
19
|
import {StatusCodes} from 'http-status-codes';
|
|
20
20
|
import {isDate, isFunction, isNil, isObject, isString, omit, omitBy} from 'lodash';
|
|
21
21
|
import {IStringifyOptions, stringify} from 'qs';
|
|
22
|
+
import ShortUniqueId from 'short-unique-id';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Service for making managed HTTP requests, both to the app's own Hoist server and to remote APIs.
|
|
@@ -44,6 +45,7 @@ export class FetchService extends HoistService {
|
|
|
44
45
|
|
|
45
46
|
NO_JSON_RESPONSES = [StatusCodes.NO_CONTENT, StatusCodes.RESET_CONTENT];
|
|
46
47
|
|
|
48
|
+
private idGenerator = new ShortUniqueId({length: 16});
|
|
47
49
|
private autoAborters = {};
|
|
48
50
|
private _defaultHeaders: DefaultHeaders[] = [];
|
|
49
51
|
private _interceptors: FetchInterceptor[] = [];
|
|
@@ -54,10 +56,11 @@ export class FetchService extends HoistService {
|
|
|
54
56
|
autoGenCorrelationIds = false;
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
|
-
* Method for generating Correlation ID's. Defaults to
|
|
58
|
-
*
|
|
59
|
+
* Method for generating Correlation ID's. Defaults to a 16 character random string with
|
|
60
|
+
* an extremely low probability of collisions. Applications may customize
|
|
61
|
+
* to improve readability or provide a stronger uniqueness guarantee.
|
|
59
62
|
*/
|
|
60
|
-
genCorrelationId: () => string = () =>
|
|
63
|
+
genCorrelationId: () => string = () => this.idGenerator.rnd();
|
|
61
64
|
|
|
62
65
|
/** Request header name to be used for Correlation ID tracking. */
|
|
63
66
|
correlationIdHeaderKey: string = 'X-Correlation-ID';
|