@ethlete/query-devtools 1.0.0-next.7 → 1.0.0-next.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/query-devtools",
3
- "version": "1.0.0-next.7",
3
+ "version": "1.0.0-next.9",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { Signal, WritableSignal, OnInit } from '@angular/core';
3
3
  import * as _ethlete_query from '@ethlete/query';
4
- import { JsonPath, QueryDevtoolsOverridesRecorder, QueryRefreshCause, QueryRepositoryEntryDestroyedCause, Query, QueryRepositoryCacheEntry, HttpRequestRetryState, HttpRequestLoadingProgressState, QueryDevtoolsStats, QueryDevtoolsStatsHandle, QueryDevtoolsEntry, AnyQueryBatchItemResult, QueryRepository, QueryClient, QueryKeyLockState, QueryDevtoolsFeature, QueryDevtoolsFault, AnyQueryStack, AnyPagedQueryStack, QuerySequence, AnyQueryBatch, AnyBearerAuthProvider, WebSocketDevtoolsHandle, QueryDevtoolsFormHandle, QuerySequenceStatus, AnyQuerySnapshot, QueryDevtoolsRun, QueryDevtoolsRunError, WebSocketDevtoolsMessage, QueryDevtoolsStorageScope } from '@ethlete/query';
4
+ import { JsonPath, QueryDevtoolsOverridesRecorder, QueryRefreshCause, QueryRepositoryEntryDestroyedCause, Query, QueryRepositoryCacheEntry, HttpRequestRetryState, HttpRequestLoadingProgressState, QueryDevtoolsStats, QueryDevtoolsStatsHandle, QueryDevtoolsEntry, AnyQueryBatchItemResult, QueryRepository, QueryClient, QueryKeyLockState, QueryDevtoolsFeature, QueryDevtoolsFault, AnyQueryStack, AnyPagedQueryStack, QuerySequence, AnyQueryBatch, AnyBearerAuthProvider, WebSocketDevtoolsHandle, QueryDevtoolsFormHandle, QuerySequenceStatus, AnyQuerySnapshot, QueryDevtoolsRun, QueryDevtoolsRunError, WebSocketDevtoolsMessage, QueryDevtoolsStorageScope, QueryDevtoolsApiEnvSwitch } from '@ethlete/query';
5
5
  import { ResizeEdge, DragMoveEvent, ResizeMoveEvent } from '@ethlete/core';
6
6
 
7
7
  type AboutRow = {
@@ -96,7 +96,7 @@ declare class QueryDevtoolsJsonComponent {
96
96
  private togglePath;
97
97
  private defaultExpanded;
98
98
  private localExpanded;
99
- protected expanded: _angular_core.Signal<boolean>;
99
+ private expanded;
100
100
  /** Only slices that actually contain a match unfold while searching, so a filter stays cheap. */
101
101
  private chunkHasHit;
102
102
  protected effectiveExpanded: _angular_core.Signal<boolean>;
@@ -494,6 +494,11 @@ type QueryDevtoolsHost = {
494
494
  requestUrl(query: AnyQuery): string | null;
495
495
  requestPath(url: string): string;
496
496
  queryArgs(query: AnyQuery): unknown;
497
+ /**
498
+ * The headers the query's last run sent, or - before it has run - the ones its args and its client
499
+ * resolve to now. `null` when there are none, or while a header provider cannot resolve yet.
500
+ */
501
+ requestHeaders(query: AnyQuery): Record<string, string> | null;
497
502
  routeSegments(entry: QueryDevtoolsEntry | undefined, query: AnyQuery): RouteSegment[];
498
503
  queryActivity(entry: QueryDevtoolsEntry): QueryActivity;
499
504
  linkActivity(link: QueryLink): QueryActivity;
@@ -726,7 +731,7 @@ type QueryDevtoolsHost = {
726
731
  resetPaneSize(pane: PaneTarget): void;
727
732
  };
728
733
 
729
- type ScopeKey = 'viewState' | 'pins' | 'overrides' | 'mocks' | 'armedMocks' | 'armedFaults';
734
+ type ScopeKey = 'viewState' | 'pins' | 'overrides' | 'mocks' | 'armedMocks' | 'armedFaults' | 'authSessions';
730
735
  type ScopeRow = {
731
736
  key: ScopeKey;
732
737
  label: string;
@@ -755,6 +760,7 @@ type LimitRow = {
755
760
  * otherwise hold as constants, and the toggles their own tabs also carry.
756
761
  */
757
762
  declare class QueryDevtoolsSettingsComponent {
763
+ private document;
758
764
  protected host: QueryDevtoolsHost;
759
765
  protected readonly SCOPE_ROWS: ScopeRow[];
760
766
  protected readonly SCOPES: {
@@ -769,9 +775,27 @@ declare class QueryDevtoolsSettingsComponent {
769
775
  /** What queries actually retain, which is the application's value unless this panel raised it. */
770
776
  protected responseHistory: _angular_core.Signal<number>;
771
777
  protected mockCount: _angular_core.Signal<number>;
778
+ protected sessionCount: _angular_core.Signal<number>;
772
779
  protected armedMockCount: _angular_core.Signal<number>;
773
780
  protected armedFaultCount: _angular_core.Signal<number>;
774
781
  protected resetConfirming: _angular_core.WritableSignal<boolean>;
782
+ protected readonly FORGET_SESSIONS: () => void;
783
+ /** The backends the application declared, or an empty list - the card renders only for a declared one. */
784
+ protected apiEnvs: _angular_core.Signal<QueryDevtoolsApiEnvSwitch[]>;
785
+ /** The env id (or typed URL) a switch's key holds, or `null` while the application picks for itself. */
786
+ protected apiEnvValue(apiSwitch: QueryDevtoolsApiEnvSwitch): string | null;
787
+ /** The env a switch falls back to with nothing stored, described for the default button. */
788
+ protected apiEnvFallback(apiSwitch: QueryDevtoolsApiEnvSwitch): {
789
+ label: string;
790
+ production: boolean;
791
+ };
792
+ /** Whether the pick in force - the stored env, or the fallback behind an unwritten key - is production. */
793
+ protected apiEnvIsProduction(apiSwitch: QueryDevtoolsApiEnvSwitch): boolean;
794
+ /** A stored value no declared env carries, which is a URL somebody typed in below. */
795
+ protected apiEnvCustomUrl(apiSwitch: QueryDevtoolsApiEnvSwitch): string;
796
+ /** Writes the application's own key and reloads - it is read before Angular boots, so nothing else can. */
797
+ protected pickApiEnv(apiSwitch: QueryDevtoolsApiEnvSwitch, value: string | null): void;
798
+ protected setCustomApiUrl(apiSwitch: QueryDevtoolsApiEnvSwitch, value: string): void;
775
799
  protected settings(): _ethlete_query.QueryDevtoolsSettings;
776
800
  protected scopeOf(key: ScopeKey): QueryDevtoolsStorageScope;
777
801
  protected limitOf(key: LimitKey): number;
@@ -814,21 +838,6 @@ type FloatRect = {
814
838
  width: number;
815
839
  height: number;
816
840
  };
817
- /**
818
- * A drag in progress: the panel's docked edge, the floating panel being moved or resized, or the
819
- * divider between a two-pane tab's panes.
820
- */
821
- type ResizeDrag = {
822
- /** The document the pointer moves in - a popped-out panel lives in a window of its own. */
823
- doc: Document;
824
- } & ({
825
- kind: 'panel';
826
- } | {
827
- kind: 'pane';
828
- pane: PaneTarget;
829
- axis: PaneAxis;
830
- container: HTMLElement;
831
- });
832
841
  type PersistedState = {
833
842
  open?: boolean;
834
843
  height?: number;
@@ -1020,7 +1029,7 @@ declare class QueryDevtoolsComponent implements OnInit {
1020
1029
  protected drawerWidth: WritableSignal<number | null>;
1021
1030
  protected listHeight: WritableSignal<number | null>;
1022
1031
  protected drawerHeight: WritableSignal<number | null>;
1023
- protected drag: WritableSignal<ResizeDrag | null>;
1032
+ private drag;
1024
1033
  protected resizing: _angular_core.Signal<boolean>;
1025
1034
  /** Which edge the panel is docked to, or `float` for a window of its own inside the page. */
1026
1035
  protected dock: WritableSignal<DevtoolsDock>;
@@ -1222,7 +1231,8 @@ declare class QueryDevtoolsComponent implements OnInit {
1222
1231
  lockRows: _angular_core.Signal<DevtoolsLockRow[] | null>;
1223
1232
  /** "Inspect" mode: hover the live UI to find the query that a component created. */
1224
1233
  protected inspectActive: WritableSignal<boolean>;
1225
- protected inspectHover: WritableSignal<{
1234
+ /** @internal */
1235
+ inspectHover: WritableSignal<{
1226
1236
  rect: DOMRect;
1227
1237
  entries: QueryDevtoolsEntry[];
1228
1238
  } | null>;
@@ -1525,6 +1535,19 @@ declare class QueryDevtoolsComponent implements OnInit {
1525
1535
  * its current request was built from stand in.
1526
1536
  */
1527
1537
  queryArgs(query: AnyQuery): Omit<any, "response" | "rawResponse"> | null;
1538
+ /**
1539
+ * The headers a query's request carries, as a plain `name: value` record, or `null` for a query that
1540
+ * has none the panel can read. The set the last run sent, so it stays readable after the token it
1541
+ * used was replaced; for a query that has not run, what its current args and its client resolve to
1542
+ * now. `null` while a header provider throws - a secure query's needs an access token.
1543
+ *
1544
+ * The args tree cannot answer this on its own: a `withArgs` query reads its args from the feature's
1545
+ * source, which the secure `Authorization` provider is never written back to, and client-level
1546
+ * headers are merged in per execution rather than being part of the args at all.
1547
+ */
1548
+ requestHeaders(query: AnyQuery): {
1549
+ [k: string]: string;
1550
+ } | null;
1528
1551
  queryStatus(query: AnyQuery): QueryStatus;
1529
1552
  /**
1530
1553
  * A request in flight is already refreshing, so reporting it as stale on top of `loading` is noise -
@@ -1803,6 +1826,12 @@ declare class QueryDevtoolsComponent implements OnInit {
1803
1826
  content: string;
1804
1827
  type: string;
1805
1828
  }): void;
1829
+ /**
1830
+ * The headers an execution of this request would resolve to now: the client's with the per-request
1831
+ * ones merged on top, providers called. `undefined` when a provider throws, which for a secure query
1832
+ * means no access token is available yet.
1833
+ */
1834
+ private resolvedHeaders;
1806
1835
  /**
1807
1836
  * The same route rendered from a set of args rather than from a query, which is what a batch item leaves
1808
1837
  * behind: the batch destroys its query the moment the item settles.
@@ -1953,7 +1982,7 @@ declare class QueryDevtoolsComponent implements OnInit {
1953
1982
  declare const QUERY_DEVTOOLS_IMPORTS: readonly [typeof QueryDevtoolsComponent];
1954
1983
 
1955
1984
  /** The version of `@ethlete/query-devtools` this build was cut from. */
1956
- declare const QUERY_DEVTOOLS_VERSION = "1.0.0-next.7";
1985
+ declare const QUERY_DEVTOOLS_VERSION = "1.0.0-next.9";
1957
1986
 
1958
1987
  export { QUERY_DEVTOOLS_IMPORTS, QUERY_DEVTOOLS_VERSION, QueryDevtoolsAboutComponent, QueryDevtoolsComponent, QueryDevtoolsJsonComponent, QueryDevtoolsJsonStylesComponent, QueryDevtoolsSettingsComponent, QueryDevtoolsTimelineStylesComponent, clampFloatToPeek, kindOf, resizedFloatRect, settledFloatRect };
1959
1988
  export type { JsonKind };