@genesislcap/foundation-comms 14.187.1-accessibility.1 → 14.187.1-alpha-3406925.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/dts/connect/connect.d.ts +11 -6
  2. package/dist/dts/connect/connect.d.ts.map +1 -1
  3. package/dist/dts/connect/http.connect.d.ts +2 -2
  4. package/dist/dts/connect/http.connect.d.ts.map +1 -1
  5. package/dist/dts/connect/message.d.ts +11 -0
  6. package/dist/dts/connect/message.d.ts.map +1 -1
  7. package/dist/dts/connect/socket.d.ts +6 -2
  8. package/dist/dts/connect/socket.d.ts.map +1 -1
  9. package/dist/dts/datasource/datasource.config.d.ts +44 -0
  10. package/dist/dts/datasource/datasource.config.d.ts.map +1 -0
  11. package/dist/dts/datasource/datasource.d.ts +49 -19
  12. package/dist/dts/datasource/datasource.d.ts.map +1 -1
  13. package/dist/dts/datasource/datasource.mixins.d.ts +367 -0
  14. package/dist/dts/datasource/datasource.mixins.d.ts.map +1 -0
  15. package/dist/dts/datasource/datasource.types.d.ts +14 -22
  16. package/dist/dts/datasource/datasource.types.d.ts.map +1 -1
  17. package/dist/dts/datasource/entityDatasource.d.ts +5 -8
  18. package/dist/dts/datasource/entityDatasource.d.ts.map +1 -1
  19. package/dist/dts/datasource/index.d.ts +2 -0
  20. package/dist/dts/datasource/index.d.ts.map +1 -1
  21. package/dist/dts/index.d.ts +1 -0
  22. package/dist/dts/index.d.ts.map +1 -1
  23. package/dist/dts/resources/genesis/config.d.ts +81 -0
  24. package/dist/dts/resources/genesis/config.d.ts.map +1 -0
  25. package/dist/dts/resources/genesis/genesis.d.ts +69 -0
  26. package/dist/dts/resources/genesis/genesis.d.ts.map +1 -0
  27. package/dist/dts/resources/genesis/index.d.ts +4 -0
  28. package/dist/dts/resources/genesis/index.d.ts.map +1 -0
  29. package/dist/dts/resources/genesis/types.d.ts +19 -0
  30. package/dist/dts/resources/genesis/types.d.ts.map +1 -0
  31. package/dist/dts/resources/index.d.ts +2 -0
  32. package/dist/dts/resources/index.d.ts.map +1 -0
  33. package/dist/dts/testing/mocks/auth/auth.d.ts +3 -0
  34. package/dist/dts/testing/mocks/auth/auth.d.ts.map +1 -1
  35. package/dist/dts/testing/mocks/connect/connect.d.ts +3 -2
  36. package/dist/dts/testing/mocks/connect/connect.d.ts.map +1 -1
  37. package/dist/dts/testing/mocks/connect/socket.d.ts +1 -0
  38. package/dist/dts/testing/mocks/connect/socket.d.ts.map +1 -1
  39. package/dist/dts/testing/mocks/datasource/datasource.d.ts +22 -4
  40. package/dist/dts/testing/mocks/datasource/datasource.d.ts.map +1 -1
  41. package/dist/dts/testing/mocks/index.d.ts +1 -0
  42. package/dist/dts/testing/mocks/index.d.ts.map +1 -1
  43. package/dist/dts/testing/mocks/resources/genesis/genesis.d.ts +16 -0
  44. package/dist/dts/testing/mocks/resources/genesis/genesis.d.ts.map +1 -0
  45. package/dist/dts/testing/mocks/resources/genesis/index.d.ts +2 -0
  46. package/dist/dts/testing/mocks/resources/genesis/index.d.ts.map +1 -0
  47. package/dist/dts/testing/mocks/resources/index.d.ts +2 -0
  48. package/dist/dts/testing/mocks/resources/index.d.ts.map +1 -0
  49. package/dist/esm/connect/connect.js +12 -15
  50. package/dist/esm/connect/http.connect.js +5 -3
  51. package/dist/esm/connect/message.js +2 -0
  52. package/dist/esm/connect/socket.js +19 -6
  53. package/dist/esm/datasource/datasource.config.js +41 -0
  54. package/dist/esm/datasource/datasource.js +133 -58
  55. package/dist/esm/datasource/datasource.mixins.js +86 -0
  56. package/dist/esm/datasource/datasource.types.js +2 -18
  57. package/dist/esm/datasource/entityDatasource.js +6 -0
  58. package/dist/esm/datasource/index.js +2 -0
  59. package/dist/esm/index.js +1 -0
  60. package/dist/esm/resources/genesis/config.js +51 -0
  61. package/dist/esm/resources/genesis/genesis.js +114 -0
  62. package/dist/esm/resources/genesis/index.js +3 -0
  63. package/dist/esm/resources/genesis/types.js +4 -0
  64. package/dist/esm/resources/index.js +1 -0
  65. package/dist/esm/testing/mocks/auth/auth.js +10 -0
  66. package/dist/esm/testing/mocks/connect/connect.js +9 -2
  67. package/dist/esm/testing/mocks/connect/socket.js +2 -0
  68. package/dist/esm/testing/mocks/datasource/datasource.js +59 -0
  69. package/dist/esm/testing/mocks/index.js +1 -0
  70. package/dist/esm/testing/mocks/resources/genesis/genesis.js +25 -0
  71. package/dist/esm/testing/mocks/resources/genesis/index.js +1 -0
  72. package/dist/esm/testing/mocks/resources/index.js +1 -0
  73. package/dist/foundation-comms.api.json +11047 -6292
  74. package/dist/foundation-comms.d.ts +696 -37
  75. package/docs/api/foundation-comms.connect.connect.md +2 -2
  76. package/docs/api/foundation-comms.connect.getavailableresources.md +2 -2
  77. package/docs/api/foundation-comms.connect.host.md +11 -0
  78. package/docs/api/foundation-comms.connect.md +1 -0
  79. package/docs/api/foundation-comms.datasource.init.md +2 -2
  80. package/docs/api/foundation-comms.datasource.md +3 -2
  81. package/docs/api/{foundation-comms.datasource.fieldmetadata.md → foundation-comms.datasource.status.md} +3 -4
  82. package/docs/api/foundation-comms.datasourceconfig.eventemitter.md +18 -0
  83. package/docs/api/foundation-comms.datasourceconfig.md +2 -1
  84. package/docs/api/foundation-comms.datasourceeventhandler.md +353 -0
  85. package/docs/api/foundation-comms.datasourcemetadata.availableindexes.md +11 -0
  86. package/docs/api/foundation-comms.datasourcemetadata.fetchmetadatarequired.md +11 -0
  87. package/docs/api/foundation-comms.datasourcemetadata.fieldmetadata.md +11 -0
  88. package/docs/api/foundation-comms.datasourcemetadata.md +24 -0
  89. package/docs/api/foundation-comms.datasourcemetadata.originalfielddef.md +11 -0
  90. package/docs/api/foundation-comms.datasourcemetadata.requestfields.md +11 -0
  91. package/docs/api/foundation-comms.datasourcestatus.md +21 -0
  92. package/docs/api/foundation-comms.datasourcestatuschanged.md +13 -0
  93. package/docs/api/foundation-comms.datasourcestatuschangedevent.md +15 -0
  94. package/docs/api/foundation-comms.defaultconnect.connect.md +2 -2
  95. package/docs/api/foundation-comms.defaultconnect.getavailableresources.md +2 -2
  96. package/docs/api/foundation-comms.defaultconnect.host.md +11 -0
  97. package/docs/api/foundation-comms.defaultconnect.md +1 -0
  98. package/docs/api/foundation-comms.defaultdatasource._constructor_.md +3 -2
  99. package/docs/api/foundation-comms.defaultdatasource.availableindexes.md +2 -1
  100. package/docs/api/foundation-comms.defaultdatasource.fetchandapplymetadata.md +22 -0
  101. package/docs/api/{foundation-comms.defaultdatasource._stream.md → foundation-comms.defaultdatasource.fetchmetadatarequired.md} +4 -3
  102. package/docs/api/foundation-comms.defaultdatasource.fieldmetadata.md +1 -0
  103. package/docs/api/foundation-comms.defaultdatasource.initialized.md +3 -1
  104. package/docs/api/foundation-comms.defaultdatasource.md +10 -7
  105. package/docs/api/foundation-comms.defaultdatasource.originalfielddef.md +2 -1
  106. package/docs/api/foundation-comms.defaultdatasource.requestfields.md +2 -1
  107. package/docs/api/foundation-comms.defaultdatasource.resources.md +11 -0
  108. package/docs/api/foundation-comms.defaultdatasource.status.md +12 -0
  109. package/docs/api/foundation-comms.defaultdatasource.stream.md +1 -1
  110. package/docs/api/foundation-comms.defaultdatasource.validresourcename.md +5 -0
  111. package/docs/api/foundation-comms.defaultdatasourceconfig.md +1 -1
  112. package/docs/api/foundation-comms.defaultgenesisresources._constructor_.md +21 -0
  113. package/docs/api/foundation-comms.defaultgenesisresources.config.md +11 -0
  114. package/docs/api/foundation-comms.defaultgenesisresources.connect.md +11 -0
  115. package/docs/api/foundation-comms.defaultgenesisresources.destroy.md +17 -0
  116. package/docs/api/foundation-comms.defaultgenesisresources.getresources.md +15 -0
  117. package/docs/api/foundation-comms.defaultgenesisresources.getresourcetypefor.md +24 -0
  118. package/docs/api/foundation-comms.defaultgenesisresources.isvalidresource.md +24 -0
  119. package/docs/api/foundation-comms.defaultgenesisresources.md +40 -0
  120. package/docs/api/foundation-comms.defaultgenesisresources.postloadedmessage.md +15 -0
  121. package/docs/api/foundation-comms.defaultgenesisresources.resources.md +11 -0
  122. package/docs/api/foundation-comms.defaultgenesisresources.resourcespromise.md +11 -0
  123. package/docs/api/foundation-comms.defaultgenesisresourcesconfig.md +13 -0
  124. package/docs/api/foundation-comms.defaulthttpconnect.getavailableresources.md +2 -2
  125. package/docs/api/foundation-comms.defaultsocket._constructor_.md +2 -1
  126. package/docs/api/foundation-comms.defaultsocket.config.md +11 -0
  127. package/docs/api/foundation-comms.defaultsocket.connect.md +2 -2
  128. package/docs/api/foundation-comms.defaultsocket.host.md +11 -0
  129. package/docs/api/foundation-comms.defaultsocket.md +3 -1
  130. package/docs/api/foundation-comms.eventmessagetype.md +2 -0
  131. package/docs/api/foundation-comms.genesisresources.destroy.md +13 -0
  132. package/docs/api/foundation-comms.genesisresources.getresourcetypefor.md +13 -0
  133. package/docs/api/foundation-comms.genesisresources.isvalidresource.md +13 -0
  134. package/docs/api/foundation-comms.genesisresources.md +26 -0
  135. package/docs/api/foundation-comms.genesisresourceschannel.md +33 -0
  136. package/docs/api/foundation-comms.genesisresourceschannelid.md +12 -0
  137. package/docs/api/foundation-comms.genesisresourcesconfig.md +21 -0
  138. package/docs/api/foundation-comms.genesisresourcesconfig.throwwhenunavailable.md +13 -0
  139. package/docs/api/foundation-comms.genesisresourcesconfig.throwwhenunknown.md +13 -0
  140. package/docs/api/foundation-comms.genesisresourcesevents.md +17 -0
  141. package/docs/api/foundation-comms.genesisresourcesmock.destroy.md +15 -0
  142. package/docs/api/foundation-comms.genesisresourcesmock.getresourcetypefor.md +24 -0
  143. package/docs/api/foundation-comms.genesisresourcesmock.isvalidresource.md +24 -0
  144. package/docs/api/foundation-comms.genesisresourcesmock.md +30 -0
  145. package/docs/api/foundation-comms.genesisresourcesmock.nextisvalidresourceresponse.md +11 -0
  146. package/docs/api/foundation-comms.genesisresourcesmock.nextresourcetypeforresponse.md +11 -0
  147. package/docs/api/foundation-comms.genesisresourcesmock.resources.md +11 -0
  148. package/docs/api/foundation-comms.getgenesisresources.md +30 -0
  149. package/docs/api/foundation-comms.getgenesisresourceschannel.md +39 -0
  150. package/docs/api/foundation-comms.md +19 -2
  151. package/docs/api/foundation-comms.resourceitem.md +15 -0
  152. package/docs/api/foundation-comms.resourcesmessage.md +18 -0
  153. package/docs/api/foundation-comms.socket.host.md +11 -0
  154. package/docs/api/foundation-comms.socket.md +6 -0
  155. package/docs/api-report.md +550 -25
  156. package/package.json +13 -12
@@ -2,8 +2,10 @@
2
2
 
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { default as Bowser_2 } from 'bowser';
5
+ import { Controller } from '@microsoft/fast-element';
5
6
  import { DefaultUser } from '@genesislcap/foundation-user';
6
7
  import type { DTOMapper } from '@genesislcap/foundation-utils';
8
+ import type { FASTElement } from '@microsoft/fast-element';
7
9
  import { InterfaceSymbol } from '@microsoft/fast-foundation';
8
10
  import { JSONSchema7 } from 'json-schema';
9
11
  import { JSONSerializer } from '@genesislcap/foundation-utils';
@@ -13,8 +15,10 @@ import type { LogLevel } from '@genesislcap/foundation-utils';
13
15
  import { Observable } from 'rxjs';
14
16
  import { Observer } from '@genesislcap/foundation-utils';
15
17
  import { Observer as Observer_2 } from 'rxjs';
18
+ import { SetUserProperties } from '@genesislcap/foundation-user/dist/esm';
16
19
  import { Subscription as SocketSubscription } from 'rxjs';
17
20
  import { Subject } from 'rxjs';
21
+ import { TypedBroadcastChannel } from '@genesislcap/foundation-broadcast-channel';
18
22
  import { User as User_2 } from '@genesislcap/foundation-user';
19
23
  import { UUID } from '@genesislcap/foundation-utils';
20
24
 
@@ -116,6 +120,8 @@ export declare class AuthMock implements Auth {
116
120
  login(credentials: AuthInfo): Promise<LoginResult>;
117
121
  logout(): Promise<LogoutResult>;
118
122
  reAuthFromSession(): Promise<boolean>;
123
+ setTestUser(properties?: Partial<SetUserProperties>): void;
124
+ resetTestUser(): void;
119
125
  }
120
126
 
121
127
  /**
@@ -223,10 +229,10 @@ export declare interface Connect {
223
229
  /**
224
230
  * Connects to a server at the specified host.
225
231
  * @public
226
- * @param host - The host to connect to.
232
+ * @param host - The host to connect to. Defaults to {@link @genesislcap/foundation-utils#GENESIS_SOCKET_URL | GENESIS_SOCKET_URL}.
227
233
  * @returns A promise that resolves with a boolean indicating whether the connection was successful.
228
234
  */
229
- connect(host: string): Promise<boolean>;
235
+ connect(host?: string): Promise<boolean>;
230
236
  /**
231
237
  * Disconnects from the server.
232
238
  * @public
@@ -328,7 +334,7 @@ export declare interface Connect {
328
334
  * @param params - An object containing optional parameters to include in the request.
329
335
  * @returns A promise that resolves to a Message containing the server's response with available resources.
330
336
  */
331
- getAvailableResources(params?: RequestParams): Promise<Message>;
337
+ getAvailableResources(params?: RequestParams): Promise<ResourcesMessage>;
332
338
  /**
333
339
  * Sends a request to the server to retrieve data or perform an action.
334
340
  * @public
@@ -337,6 +343,10 @@ export declare interface Connect {
337
343
  * @returns A promise that resolves to a Message containing the server's response.
338
344
  */
339
345
  commitEvent(eventName: string, params?: CommitParams): Promise<Message>;
346
+ /**
347
+ * @returns The host provided.
348
+ */
349
+ host: string;
340
350
  }
341
351
 
342
352
  /**
@@ -471,6 +481,7 @@ export declare class ConnectMock implements Connect {
471
481
  isConnected: boolean;
472
482
  isWorking: boolean;
473
483
  socket: SocketMock;
484
+ get host(): string;
474
485
  get isConnectedSubject(): BehaviorSubject<boolean>;
475
486
  get isConnected$(): Observable<boolean>;
476
487
  send<T>(message: Message<any>, needsHandling?: boolean): Promise<any>;
@@ -486,7 +497,7 @@ export declare class ConnectMock implements Connect {
486
497
  disconnect(): void;
487
498
  getMetadata(resourceName: string): Promise<Metadata>;
488
499
  request(resourceName: string, params?: RequestParams): Promise<Message>;
489
- getAvailableResources(params?: RequestParams): Promise<Message>;
500
+ getAvailableResources(params?: RequestParams): Promise<ResourcesMessage>;
490
501
  snapshot(resourceName: string, params?: any): Promise<Message>;
491
502
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
492
503
  streamState(resourceName: string, onMessage: Function, onError: Function, params?: any, initialState?: any[]): Observable<any[]>;
@@ -815,17 +826,16 @@ export declare function dataServerResultFilter(result: RawDataServerResult, rowI
815
826
  * @remarks
816
827
  * The public interface available on the injected store fragment.
817
828
  */
818
- export declare interface Datasource {
829
+ export declare interface Datasource extends DatasourceMetadata {
819
830
  /**
820
- * Indicates whether the datasource has been initialized.
821
831
  * @public
822
832
  */
823
- initialized: boolean;
833
+ status: Partial<DatasourceStatus>;
824
834
  /**
825
- * Metadata about the fields of the datasource.
835
+ * Indicates whether the datasource has been initialized.
826
836
  * @public
827
837
  */
828
- fieldMetadata: FieldMetadata[];
838
+ initialized: boolean;
829
839
  /**
830
840
  * Indicates whether the datasource is read-only.
831
841
  * TODO: Should have is prefix
@@ -851,10 +861,10 @@ export declare interface Datasource {
851
861
  * Initializes the datasource with the given options and fetches metadata if specified.
852
862
  * @public
853
863
  * @param options - The options to initialize the datasource with.
854
- * @param fetchMeta - Whether to fetch metadata for the datasource.
864
+ * @param fetchMeta - Optional flag to fetch metadata for the datasource. Defaults to true.
855
865
  * @returns A promise that resolves with a boolean indicating whether the initialization was successful.
856
866
  */
857
- init(options: DatasourceOptions, fetchMeta: boolean): Promise<boolean>;
867
+ init(options: DatasourceOptions, fetchMeta?: boolean): Promise<boolean>;
858
868
  /**
859
869
  * Deinitializes the datasource.
860
870
  * @remarks This should be called to clean up any resources when the datasource is no longer needed.
@@ -960,22 +970,29 @@ export declare interface Datasource {
960
970
  export declare const Datasource: InterfaceSymbol<Datasource>;
961
971
 
962
972
  /**
963
- * The configuration object for a Datasource
973
+ * DatasourceConfig DI interface.
974
+ *
964
975
  * @public
965
976
  */
966
977
  export declare interface DatasourceConfig {
978
+ /**
979
+ * The element to emit events from.
980
+ *
981
+ * @remarks
982
+ * If omitted the document is used.
983
+ */
984
+ eventEmitter?: HTMLElement;
967
985
  options: DatasourceOptions;
968
986
  criteriaToFields(filters: string): Record<string, string>;
969
987
  dataServerResultFilter(result: RawDataServerResult, rowId?: string): FilteredDataServerResult;
970
988
  }
971
989
 
972
990
  /**
973
- * The DI token for the DatasourceConfig interface.
991
+ * DatasourceConfig DI key.
974
992
  *
993
+ * @internal
975
994
  * @privateRemarks
976
995
  * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
977
- *
978
- * @internal
979
996
  */
980
997
  export declare const DatasourceConfig: InterfaceSymbol<DatasourceConfig>;
981
998
 
@@ -991,16 +1008,411 @@ export declare class DatasourceDefaults {
991
1008
  static readonly REQUEST_SERVER_ROW_ID = "RECORD_ID";
992
1009
  }
993
1010
 
1011
+ /**
1012
+ * Datasource event handler mixin for target classes that use or are interested in datasource status changes.
1013
+ *
1014
+ * @remarks
1015
+ * Classes that use the mixin are not required to own the datasource itself, there may be several interested parties.
1016
+ *
1017
+ * @example
1018
+ * ```ts
1019
+ * import { DatasourceEventHandler, DatasourceStatus } from '@genesislcap/foundation-comms';
1020
+ * ...
1021
+ * class MyComponent extends DatasourceEventHandler(FASTElement) {
1022
+ * resourceName: string = 'some-resource';
1023
+ * ...
1024
+ * datasourceStatusChanged(prev: DatasourceStatus, next: DatasourceStatus) {
1025
+ * // Respond to changes in the target datasource.
1026
+ * }
1027
+ * }
1028
+ * ```
1029
+ *
1030
+ * @privateRemarks
1031
+ * Unfortunately our datasource ui components do not share a common baseclass. Given datasource ui components contain a
1032
+ * Datasource and currently await their `init`, usage is more for example at this point, ie. how could we allow interested
1033
+ * parties to monitor and respond to changes, given they will exist at different levels of DOM hierarchy etc. Datasource
1034
+ * itself is also transient DI injectable, so each interested party would not have access to the same instance, nor would
1035
+ * we necessarily want to expose that via the event to prevent them operating on it to cause unwanted side effects.
1036
+ *
1037
+ * @param Target - The class to mix the event handler with.
1038
+ *
1039
+ * @public
1040
+ */
1041
+ export declare const DatasourceEventHandler: (Target: new () => HTMLElement & FASTElement) => {
1042
+ new (): {
1043
+ datasourceStatus: DatasourceStatus;
1044
+ /**
1045
+ * Classes should provide.
1046
+ */
1047
+ resourceName: string;
1048
+ /**
1049
+ * The component-level handler for datasource status changes.
1050
+ *
1051
+ * @remarks
1052
+ * If implementing custom logic in the target class, please check the `event.detail.name` matches your resourceName.
1053
+ */
1054
+ onDatasourceStatusChanged: (event: DatasourceStatusChangedEvent) => void;
1055
+ /**
1056
+ * @remarks
1057
+ * Override this method to respond to changes in the target datasource.
1058
+ */
1059
+ datasourceStatusChanged(prev: DatasourceStatus, next: DatasourceStatus): void;
1060
+ connectedCallback(): void;
1061
+ disconnectedCallback(): void;
1062
+ accessKey: string;
1063
+ readonly accessKeyLabel: string;
1064
+ autocapitalize: string;
1065
+ dir: string;
1066
+ draggable: boolean;
1067
+ hidden: boolean;
1068
+ inert: boolean;
1069
+ innerText: string;
1070
+ lang: string;
1071
+ readonly offsetHeight: number;
1072
+ readonly offsetLeft: number;
1073
+ readonly offsetParent: Element;
1074
+ readonly offsetTop: number;
1075
+ readonly offsetWidth: number;
1076
+ outerText: string;
1077
+ spellcheck: boolean;
1078
+ title: string;
1079
+ translate: boolean;
1080
+ attachInternals(): ElementInternals;
1081
+ click(): void;
1082
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
1083
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1084
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions): void;
1085
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
1086
+ readonly attributes: NamedNodeMap;
1087
+ readonly classList: DOMTokenList;
1088
+ className: string;
1089
+ readonly clientHeight: number;
1090
+ readonly clientLeft: number;
1091
+ readonly clientTop: number;
1092
+ readonly clientWidth: number;
1093
+ id: string;
1094
+ readonly localName: string;
1095
+ readonly namespaceURI: string;
1096
+ onfullscreenchange: (this: Element, ev: Event) => any;
1097
+ onfullscreenerror: (this: Element, ev: Event) => any;
1098
+ outerHTML: string;
1099
+ readonly ownerDocument: Document;
1100
+ readonly part: DOMTokenList;
1101
+ readonly prefix: string;
1102
+ readonly scrollHeight: number;
1103
+ scrollLeft: number;
1104
+ scrollTop: number;
1105
+ readonly scrollWidth: number;
1106
+ readonly shadowRoot: ShadowRoot;
1107
+ slot: string;
1108
+ readonly tagName: string;
1109
+ attachShadow(init: ShadowRootInit): ShadowRoot;
1110
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2];
1111
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3];
1112
+ closest<E extends Element = Element>(selectors: string): E;
1113
+ getAttribute(qualifiedName: string): string;
1114
+ getAttributeNS(namespace: string, localName: string): string;
1115
+ getAttributeNames(): string[];
1116
+ getAttributeNode(qualifiedName: string): Attr;
1117
+ getAttributeNodeNS(namespace: string, localName: string): Attr;
1118
+ getBoundingClientRect(): DOMRect;
1119
+ getClientRects(): DOMRectList;
1120
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
1121
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
1122
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
1123
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
1124
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
1125
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
1126
+ getElementsByTagNameNS(namespace: string, localName: string): HTMLCollectionOf<Element>;
1127
+ hasAttribute(qualifiedName: string): boolean;
1128
+ hasAttributeNS(namespace: string, localName: string): boolean;
1129
+ hasAttributes(): boolean;
1130
+ hasPointerCapture(pointerId: number): boolean;
1131
+ insertAdjacentElement(where: InsertPosition, element: Element): Element;
1132
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
1133
+ insertAdjacentText(where: InsertPosition, data: string): void;
1134
+ matches(selectors: string): boolean;
1135
+ releasePointerCapture(pointerId: number): void;
1136
+ removeAttribute(qualifiedName: string): void;
1137
+ removeAttributeNS(namespace: string, localName: string): void;
1138
+ removeAttributeNode(attr: Attr): Attr;
1139
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
1140
+ requestPointerLock(): void;
1141
+ scroll(options?: ScrollToOptions): void;
1142
+ scroll(x: number, y: number): void;
1143
+ scrollBy(options?: ScrollToOptions): void;
1144
+ scrollBy(x: number, y: number): void;
1145
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
1146
+ scrollTo(options?: ScrollToOptions): void;
1147
+ scrollTo(x: number, y: number): void;
1148
+ setAttribute(qualifiedName: string, value: string): void;
1149
+ setAttributeNS(namespace: string, qualifiedName: string, value: string): void;
1150
+ setAttributeNode(attr: Attr): Attr;
1151
+ setAttributeNodeNS(attr: Attr): Attr;
1152
+ setPointerCapture(pointerId: number): void;
1153
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
1154
+ webkitMatchesSelector(selectors: string): boolean;
1155
+ readonly baseURI: string;
1156
+ readonly childNodes: NodeListOf<ChildNode>;
1157
+ readonly firstChild: ChildNode;
1158
+ readonly isConnected: boolean;
1159
+ readonly lastChild: ChildNode;
1160
+ readonly nextSibling: ChildNode;
1161
+ readonly nodeName: string;
1162
+ readonly nodeType: number;
1163
+ nodeValue: string;
1164
+ readonly parentElement: HTMLElement;
1165
+ readonly parentNode: ParentNode;
1166
+ readonly previousSibling: ChildNode;
1167
+ textContent: string;
1168
+ appendChild<T extends Node>(node: T): T;
1169
+ cloneNode(deep?: boolean): Node;
1170
+ compareDocumentPosition(other: Node): number;
1171
+ contains(other: Node): boolean;
1172
+ getRootNode(options?: GetRootNodeOptions): Node;
1173
+ hasChildNodes(): boolean;
1174
+ insertBefore<T_1 extends Node>(node: T_1, child: Node): T_1;
1175
+ isDefaultNamespace(namespace: string): boolean;
1176
+ isEqualNode(otherNode: Node): boolean;
1177
+ isSameNode(otherNode: Node): boolean;
1178
+ lookupNamespaceURI(prefix: string): string;
1179
+ lookupPrefix(namespace: string): string;
1180
+ normalize(): void;
1181
+ removeChild<T_2 extends Node>(child: T_2): T_2;
1182
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
1183
+ readonly ATTRIBUTE_NODE: number;
1184
+ readonly CDATA_SECTION_NODE: number;
1185
+ readonly COMMENT_NODE: number;
1186
+ readonly DOCUMENT_FRAGMENT_NODE: number;
1187
+ readonly DOCUMENT_NODE: number;
1188
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
1189
+ readonly DOCUMENT_POSITION_CONTAINS: number;
1190
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
1191
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
1192
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
1193
+ readonly DOCUMENT_POSITION_PRECEDING: number;
1194
+ readonly DOCUMENT_TYPE_NODE: number;
1195
+ readonly ELEMENT_NODE: number;
1196
+ readonly ENTITY_NODE: number;
1197
+ readonly ENTITY_REFERENCE_NODE: number;
1198
+ readonly NOTATION_NODE: number;
1199
+ readonly PROCESSING_INSTRUCTION_NODE: number;
1200
+ readonly TEXT_NODE: number;
1201
+ dispatchEvent(event: Event): boolean;
1202
+ ariaAtomic: string;
1203
+ ariaAutoComplete: string;
1204
+ ariaBusy: string;
1205
+ ariaChecked: string;
1206
+ ariaColCount: string;
1207
+ ariaColIndex: string;
1208
+ ariaColIndexText: string;
1209
+ ariaColSpan: string;
1210
+ ariaCurrent: string;
1211
+ ariaDisabled: string;
1212
+ ariaExpanded: string;
1213
+ ariaHasPopup: string;
1214
+ ariaHidden: string;
1215
+ ariaInvalid: string;
1216
+ ariaKeyShortcuts: string;
1217
+ ariaLabel: string;
1218
+ ariaLevel: string;
1219
+ ariaLive: string;
1220
+ ariaModal: string;
1221
+ ariaMultiLine: string;
1222
+ ariaMultiSelectable: string;
1223
+ ariaOrientation: string;
1224
+ ariaPlaceholder: string;
1225
+ ariaPosInSet: string;
1226
+ ariaPressed: string;
1227
+ ariaReadOnly: string;
1228
+ ariaRequired: string;
1229
+ ariaRoleDescription: string;
1230
+ ariaRowCount: string;
1231
+ ariaRowIndex: string;
1232
+ ariaRowIndexText: string;
1233
+ ariaRowSpan: string;
1234
+ ariaSelected: string;
1235
+ ariaSetSize: string;
1236
+ ariaSort: string;
1237
+ ariaValueMax: string;
1238
+ ariaValueMin: string;
1239
+ ariaValueNow: string;
1240
+ ariaValueText: string;
1241
+ role: string;
1242
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions): Animation;
1243
+ getAnimations(options?: GetAnimationsOptions): Animation[];
1244
+ after(...nodes: (string | Node)[]): void;
1245
+ before(...nodes: (string | Node)[]): void;
1246
+ remove(): void;
1247
+ replaceWith(...nodes: (string | Node)[]): void;
1248
+ innerHTML: string;
1249
+ readonly nextElementSibling: Element;
1250
+ readonly previousElementSibling: Element;
1251
+ readonly childElementCount: number;
1252
+ readonly children: HTMLCollection;
1253
+ readonly firstElementChild: Element;
1254
+ readonly lastElementChild: Element;
1255
+ append(...nodes: (string | Node)[]): void;
1256
+ prepend(...nodes: (string | Node)[]): void;
1257
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6];
1258
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7];
1259
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1;
1260
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
1261
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
1262
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
1263
+ replaceChildren(...nodes: (string | Node)[]): void;
1264
+ readonly assignedSlot: HTMLSlotElement;
1265
+ oncopy: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
1266
+ oncut: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
1267
+ onpaste: (this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any;
1268
+ readonly style: CSSStyleDeclaration;
1269
+ contentEditable: string;
1270
+ enterKeyHint: string;
1271
+ inputMode: string;
1272
+ readonly isContentEditable: boolean;
1273
+ onabort: (this: GlobalEventHandlers, ev: UIEvent) => any;
1274
+ onanimationcancel: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
1275
+ onanimationend: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
1276
+ onanimationiteration: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
1277
+ onanimationstart: (this: GlobalEventHandlers, ev: AnimationEvent) => any;
1278
+ onauxclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1279
+ onbeforeinput: (this: GlobalEventHandlers, ev: InputEvent) => any;
1280
+ onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any;
1281
+ oncancel: (this: GlobalEventHandlers, ev: Event) => any;
1282
+ oncanplay: (this: GlobalEventHandlers, ev: Event) => any;
1283
+ oncanplaythrough: (this: GlobalEventHandlers, ev: Event) => any;
1284
+ onchange: (this: GlobalEventHandlers, ev: Event) => any;
1285
+ onclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1286
+ onclose: (this: GlobalEventHandlers, ev: Event) => any;
1287
+ oncontextmenu: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1288
+ oncuechange: (this: GlobalEventHandlers, ev: Event) => any;
1289
+ ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1290
+ ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any;
1291
+ ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any;
1292
+ ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any;
1293
+ ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any;
1294
+ ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any;
1295
+ ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any;
1296
+ ondrop: (this: GlobalEventHandlers, ev: DragEvent) => any;
1297
+ ondurationchange: (this: GlobalEventHandlers, ev: Event) => any;
1298
+ onemptied: (this: GlobalEventHandlers, ev: Event) => any;
1299
+ onended: (this: GlobalEventHandlers, ev: Event) => any;
1300
+ onerror: OnErrorEventHandlerNonNull;
1301
+ onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any;
1302
+ onformdata: (this: GlobalEventHandlers, ev: FormDataEvent) => any;
1303
+ ongotpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1304
+ oninput: (this: GlobalEventHandlers, ev: Event) => any;
1305
+ oninvalid: (this: GlobalEventHandlers, ev: Event) => any;
1306
+ onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
1307
+ onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
1308
+ onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any;
1309
+ onload: (this: GlobalEventHandlers, ev: Event) => any;
1310
+ onloadeddata: (this: GlobalEventHandlers, ev: Event) => any;
1311
+ onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any;
1312
+ onloadstart: (this: GlobalEventHandlers, ev: Event) => any;
1313
+ onlostpointercapture: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1314
+ onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1315
+ onmouseenter: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1316
+ onmouseleave: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1317
+ onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1318
+ onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1319
+ onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1320
+ onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any;
1321
+ onpause: (this: GlobalEventHandlers, ev: Event) => any;
1322
+ onplay: (this: GlobalEventHandlers, ev: Event) => any;
1323
+ onplaying: (this: GlobalEventHandlers, ev: Event) => any;
1324
+ onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1325
+ onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1326
+ onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1327
+ onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1328
+ onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1329
+ onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1330
+ onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1331
+ onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any;
1332
+ onprogress: (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any;
1333
+ onratechange: (this: GlobalEventHandlers, ev: Event) => any;
1334
+ onreset: (this: GlobalEventHandlers, ev: Event) => any;
1335
+ onresize: (this: GlobalEventHandlers, ev: UIEvent) => any;
1336
+ onscroll: (this: GlobalEventHandlers, ev: Event) => any;
1337
+ onsecuritypolicyviolation: (this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any;
1338
+ onseeked: (this: GlobalEventHandlers, ev: Event) => any;
1339
+ onseeking: (this: GlobalEventHandlers, ev: Event) => any;
1340
+ onselect: (this: GlobalEventHandlers, ev: Event) => any;
1341
+ onselectionchange: (this: GlobalEventHandlers, ev: Event) => any;
1342
+ onselectstart: (this: GlobalEventHandlers, ev: Event) => any;
1343
+ onslotchange: (this: GlobalEventHandlers, ev: Event) => any;
1344
+ onstalled: (this: GlobalEventHandlers, ev: Event) => any;
1345
+ onsubmit: (this: GlobalEventHandlers, ev: SubmitEvent) => any;
1346
+ onsuspend: (this: GlobalEventHandlers, ev: Event) => any;
1347
+ ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any;
1348
+ ontoggle: (this: GlobalEventHandlers, ev: Event) => any;
1349
+ ontouchcancel?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
1350
+ ontouchend?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
1351
+ ontouchmove?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
1352
+ ontouchstart?: (this: GlobalEventHandlers, ev: TouchEvent) => any;
1353
+ ontransitioncancel: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
1354
+ ontransitionend: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
1355
+ ontransitionrun: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
1356
+ ontransitionstart: (this: GlobalEventHandlers, ev: TransitionEvent) => any;
1357
+ onvolumechange: (this: GlobalEventHandlers, ev: Event) => any;
1358
+ onwaiting: (this: GlobalEventHandlers, ev: Event) => any;
1359
+ onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any;
1360
+ onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any;
1361
+ onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any;
1362
+ onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any;
1363
+ onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any;
1364
+ autofocus: boolean;
1365
+ readonly dataset: DOMStringMap;
1366
+ nonce?: string;
1367
+ tabIndex: number;
1368
+ blur(): void;
1369
+ focus(options?: FocusOptions): void;
1370
+ readonly $fastController: Controller;
1371
+ $emit(type: string, detail?: any, options?: Omit<CustomEventInit<any>, "detail">): boolean | void;
1372
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
1373
+ };
1374
+ };
1375
+
1376
+ /**
1377
+ * DatasourceMetadata interface.
1378
+ * @public
1379
+ */
1380
+ export declare interface DatasourceMetadata {
1381
+ fetchMetadataRequired: boolean;
1382
+ readonly availableIndexes: IndexDetail[];
1383
+ readonly originalFieldDef: MetadataDetail[];
1384
+ readonly fieldMetadata: FieldMetadata[];
1385
+ readonly requestFields: MetadataDetail[];
1386
+ }
1387
+
994
1388
  /**
995
1389
  * @internal
996
1390
  */
997
1391
  export declare class DatasourceMock implements Datasource {
998
- initialized: boolean;
1392
+ status: DatasourceStatus;
1393
+ fetchMetadataRequired: boolean;
1394
+ protected fetchingMetadata: boolean;
1395
+ originalFieldDef: MetadataDetail[];
999
1396
  fieldMetadata: FieldMetadata[];
1397
+ requestFields: MetadataDetail[];
1398
+ availableIndexes: IndexDetail[];
1399
+ initialized: boolean;
1000
1400
  readOnly: boolean;
1001
1401
  resourceType: ResourceType;
1002
1402
  stream: SocketObservable<FilteredDataServerResult | RequestServerResult>;
1003
1403
  init(options: DatasourceOptions, fetchMeta: boolean): Promise<boolean>;
1404
+ /**
1405
+ * Convenience method to avoid you having to prime connect etc.
1406
+ * @param meta - The metadata to set.
1407
+ */
1408
+ setMetadata(meta: Metadata): void;
1409
+ unsetMedata(): void;
1410
+ /**
1411
+ * Convenience method to avoid you having to prime connect etc.
1412
+ * @param message - The Message to stream.
1413
+ */
1414
+ setStream(message: Message): void;
1415
+ unsetStream(): void;
1004
1416
  deinit(): void;
1005
1417
  destroy(): void;
1006
1418
  validResourceName(resourceName: string): boolean;
@@ -1074,6 +1486,30 @@ export declare interface DatasourceOptions {
1074
1486
  reverse?: boolean;
1075
1487
  }
1076
1488
 
1489
+ /**
1490
+ * DatasourceStatus.
1491
+ * @public
1492
+ */
1493
+ export declare type DatasourceStatus = {
1494
+ name: string;
1495
+ type: `${ResourceType}`;
1496
+ isInitialized: boolean;
1497
+ metadataRequired: boolean;
1498
+ hasMetadata: boolean;
1499
+ };
1500
+
1501
+ /**
1502
+ * DatasourceStatusChanged.
1503
+ * @public
1504
+ */
1505
+ export declare const DatasourceStatusChanged = "datasource-status-changed";
1506
+
1507
+ /**
1508
+ * DatasourceStatusChangedEvent.
1509
+ * @public
1510
+ */
1511
+ export declare type DatasourceStatusChangedEvent = CustomEvent<DatasourceStatus>;
1512
+
1077
1513
  /**
1078
1514
  * Data Update definition with details of what data to add, drop, and/or modify.
1079
1515
  * @public
@@ -1166,6 +1602,7 @@ export declare class DefaultConnect implements Connect {
1166
1602
  get isConnected(): boolean;
1167
1603
  get isConnectedSubject(): BehaviorSubject<boolean>;
1168
1604
  get isConnected$(): Observable<boolean>;
1605
+ get host(): string;
1169
1606
  constructor(socket: Socket, messageBuilder: MessageBuilder, metaCache: MetaCache, events: ConnectEventsEmitter, config: ConnectConfig);
1170
1607
  httpMode(): boolean;
1171
1608
  /**
@@ -1173,7 +1610,7 @@ export declare class DefaultConnect implements Connect {
1173
1610
  */
1174
1611
  setValidSession(valid: boolean): void;
1175
1612
  send<T>(message: Message<any>, needsHandling?: boolean): Promise<any>;
1176
- connect(host: string): Promise<boolean>;
1613
+ connect(host?: string): Promise<boolean>;
1177
1614
  disconnect(): void;
1178
1615
  snapshot(resourceName: string, params?: any): Promise<Message>;
1179
1616
  stream(resourceName: string, onMessage: Function, onError: Function, params?: any): SocketObservable<Message>;
@@ -1185,7 +1622,7 @@ export declare class DefaultConnect implements Connect {
1185
1622
  getMetadata(resourceName: string, useCache?: boolean): Promise<Metadata>;
1186
1623
  getJSONSchema(resourceName: string, useCache?: boolean): Promise<SchemaResponse>;
1187
1624
  request(resourceName: string, params?: RequestParams): Promise<Message>;
1188
- getAvailableResources(params?: any): Promise<Message>;
1625
+ getAvailableResources(params?: any): Promise<ResourcesMessage>;
1189
1626
  commitEvent(eventName: string, params?: CommitParams): Promise<Message>;
1190
1627
  }
1191
1628
 
@@ -1282,33 +1719,56 @@ export declare const defaultCredentialRequestOptions: GetCredentialOptions;
1282
1719
  export declare class DefaultDatasource implements Datasource {
1283
1720
  protected connect: Connect;
1284
1721
  protected auth: Auth;
1722
+ protected resources: GenesisResources;
1285
1723
  protected config: DatasourceConfig;
1286
- initialized: boolean;
1724
+ /**
1725
+ * {@inheritDoc Datasource.status}
1726
+ */
1727
+ status: DatasourceStatus;
1728
+ /** {@inheritDoc DatasourceMetadata.fetchMetadataRequired} */
1729
+ fetchMetadataRequired: boolean;
1730
+ /** {@inheritDoc DatasourceMetadata.originalFieldDef} */
1731
+ originalFieldDef: MetadataDetail[];
1732
+ /** {@inheritDoc DatasourceMetadata.fieldMetadata} */
1733
+ fieldMetadata: FieldMetadata[];
1734
+ /** {@inheritDoc DatasourceMetadata.requestFields} */
1735
+ requestFields: MetadataDetail[];
1736
+ /** {@inheritDoc DatasourceMetadata.availableIndexes} */
1737
+ availableIndexes: IndexDetail[];
1738
+ /** {@inheritDoc Datasource.initialized} */
1739
+ get initialized(): boolean;
1287
1740
  readOnly: boolean;
1288
1741
  protected options: DatasourceOptions;
1289
1742
  resourceType: ResourceType;
1290
- protected _stream: SocketObservable<FilteredDataServerResult | RequestServerResult>;
1291
- protected originalFieldDef: MetadataDetail[];
1292
- protected requestFields: MetadataDetail[];
1293
- fieldMetadata: FieldMetadata[];
1294
- protected availableIndexes: IndexDetail[];
1295
- constructor(connect: Connect, auth: Auth, config?: DatasourceConfig);
1743
+ stream: SocketObservable<FilteredDataServerResult | RequestServerResult>;
1744
+ constructor(connect: Connect, auth: Auth, resources: GenesisResources, config: DatasourceConfig);
1745
+ /**
1746
+ * @deprecated - Please use {@link (GenesisResources:interface).isValidResource} instead.
1747
+ */
1296
1748
  validResourceName(resourceName: string): boolean;
1297
1749
  init(options: DatasourceOptions, fetchMeta?: boolean): Promise<boolean>;
1298
1750
  deinit(): void;
1299
1751
  /** {@inheritDoc Datasource.destroy} */
1300
1752
  destroy(): void;
1301
- get stream(): SocketObservable<FilteredDataServerResult | RequestServerResult>;
1302
1753
  get params(): any;
1303
1754
  snapshot(): Promise<Message>;
1304
1755
  snapshotFiltered(rowId?: string): Promise<any[]>;
1305
1756
  private createStream;
1306
1757
  private createDataserverStream;
1307
1758
  private createReqRepStream;
1759
+ protected fetchAndApplyMetadata(resourceName: string): Promise<void>;
1760
+ /**
1761
+ * @internal
1762
+ */
1763
+ protected reportStatus(detail?: Partial<DatasourceStatus>): void;
1764
+ /**
1765
+ * @internal
1766
+ */
1767
+ protected normaliseStatus(status: Partial<DatasourceStatus>): DatasourceStatus;
1308
1768
  }
1309
1769
 
1310
1770
  /**
1311
- * The default configuration for the Datasource service.
1771
+ * Default DatasourceConfig DI implementation.
1312
1772
  * @public
1313
1773
  */
1314
1774
  export declare const defaultDatasourceConfig: DatasourceConfig;
@@ -1327,7 +1787,9 @@ export declare class DefaultEntityDatasource<TDTO, TEntity> extends DefaultDatas
1327
1787
  protected entityMap: Map<string, TEntity>;
1328
1788
  protected rowId: string;
1329
1789
  /** {@inheritDoc EntityDatasource.initialized} */
1330
- initialized: boolean;
1790
+ protected _initialized: boolean;
1791
+ get initialized(): boolean;
1792
+ set initialized(value: boolean);
1331
1793
  /** {@inheritDoc EntityDatasource.initialize} */
1332
1794
  initialize: (init: EntityDatasourceInit<TDTO, TEntity>) => Promise<boolean>;
1333
1795
  /** {@inheritDoc EntityDatasource.cache} */
@@ -1362,6 +1824,32 @@ export declare class DefaultFoundationAnalytics implements FoundationAnalytics {
1362
1824
  trackEvent(eventName: FoundationAnalyticsEventType.routeChanged, payload: FoundationAnalyticsEvent.RouteChanged): void;
1363
1825
  }
1364
1826
 
1827
+ /**
1828
+ * Default GenesisResources implementation.
1829
+ * @public
1830
+ */
1831
+ export declare class DefaultGenesisResources implements GenesisResources {
1832
+ protected connect: Connect;
1833
+ protected config: GenesisResourcesConfig;
1834
+ protected resources: ResourceItem[];
1835
+ protected resourcesPromise: Promise<ResourcesMessage>;
1836
+ constructor(connect: Connect, config: GenesisResourcesConfig);
1837
+ /** {@inheritDoc GenesisResources.isValidResource} */
1838
+ isValidResource(resourceName: string): Promise<boolean>;
1839
+ /** {@inheritDoc GenesisResources.getResourceTypeFor} */
1840
+ getResourceTypeFor(resourceName: string): Promise<ResourceType>;
1841
+ /** {@inheritDoc GenesisResources.destroy} */
1842
+ destroy(): void;
1843
+ protected getResources(): Promise<void>;
1844
+ protected postLoadedMessage(): void;
1845
+ }
1846
+
1847
+ /**
1848
+ * Default GenesisResourcesConfig implementation.
1849
+ * @public
1850
+ */
1851
+ export declare const defaultGenesisResourcesConfig: GenesisResourcesConfig;
1852
+
1365
1853
  /**
1366
1854
  * The default implementation of the Http interface.
1367
1855
  * @public
@@ -1421,7 +1909,7 @@ export declare class DefaultHttpConnect implements Connect {
1421
1909
  getMetadata(resourceName: string, useCache?: boolean): Promise<Metadata>;
1422
1910
  getJSONSchema(resourceName: string): Promise<SchemaResponse>;
1423
1911
  request(resourceName: string, params?: RequestParams): Promise<Message>;
1424
- getAvailableResources(params?: any): Promise<Message>;
1912
+ getAvailableResources(params?: any): Promise<ResourcesMessage>;
1425
1913
  commitEvent(eventName: string, params?: CommitParams): Promise<Message>;
1426
1914
  private maybeTurbo;
1427
1915
  private updateIntervals;
@@ -1749,6 +2237,7 @@ export declare class DefaultSocket implements Socket {
1749
2237
  * Temp putting the user in place to bridge the hasValidSession logic.
1750
2238
  */
1751
2239
  protected user: User_2;
2240
+ protected config: ConnectConfig;
1752
2241
  private readonly defaultInterval;
1753
2242
  private readonly secondsMultiplier;
1754
2243
  private websocket;
@@ -1764,6 +2253,7 @@ export declare class DefaultSocket implements Socket {
1764
2253
  /** {@inheritDoc SerializedSocketStatus.hasValidSession} */
1765
2254
  get hasValidSession(): boolean;
1766
2255
  set hasValidSession(value: boolean);
2256
+ get host(): string;
1767
2257
  private heartbeatIsEnabled;
1768
2258
  private heartbeatInterval;
1769
2259
  private heartbeatTicker;
@@ -1775,10 +2265,10 @@ export declare class DefaultSocket implements Socket {
1775
2265
  /**
1776
2266
  * Temp putting the user in place to bridge the hasValidSession logic.
1777
2267
  */
1778
- user: User_2);
2268
+ user: User_2, config: ConnectConfig);
1779
2269
  private get heartbeatLoggingIsEnabled();
1780
2270
  private get messageLoggingIsEnabled();
1781
- connect(host: string, connectOptions?: SocketConnectOptions, reconnectOptions?: SocketReconnectOptions): Promise<boolean>;
2271
+ connect(host?: string, connectOptions?: SocketConnectOptions, reconnectOptions?: SocketReconnectOptions): Promise<boolean>;
1782
2272
  private prepareHeartbeat;
1783
2273
  private reconnect;
1784
2274
  reset(): void;
@@ -1886,12 +2376,7 @@ export declare class DefaultSocketStatus implements SocketStatus {
1886
2376
  *
1887
2377
  * @alpha
1888
2378
  */
1889
- export declare interface EntityDatasource<TDTO, TEntity> {
1890
- /**
1891
- * @remarks
1892
- * Datasource initialized.
1893
- */
1894
- readonly initialized: boolean;
2379
+ export declare interface EntityDatasource<TDTO, TEntity> extends Datasource {
1895
2380
  /**
1896
2381
  * @remarks
1897
2382
  * Initialize datasource.
@@ -1955,6 +2440,8 @@ export declare enum EventMessageType {
1955
2440
  META_REQUEST = "META_REQUEST",
1956
2441
  JSON_SCHEMA_REQUEST = "JSON_SCHEMA_REQUEST",
1957
2442
  RESOURCES_REQUEST = "RESOURCES_REQUEST",
2443
+ RESOURCES_REQUEST_ACK = "RESOURCES_REQUEST_ACK",
2444
+ RESOURCES_REQUEST_NACK = "RESOURCES_REQUEST_NACK",
1958
2445
  EVENT_CHANGE_USER_PASSWORD = "EVENT_CHANGE_USER_PASSWORD",
1959
2446
  EVENT_SELF_SERVICE_PASSWORD_RESET = "EVENT_SELF_SERVICE_PASSWORD_RESET",
1960
2447
  EVENT_PASSWORD_RESET_ACTION = "EVENT_PASSWORD_RESET_ACTION"
@@ -2092,6 +2579,118 @@ export declare enum FoundationAnalyticsEventType {
2092
2579
  */
2093
2580
  export declare type GenesisConnectEvents = 'stream' | 'commit';
2094
2581
 
2582
+ /**
2583
+ * GenesisResources DI interface.
2584
+ * @remarks
2585
+ * A lazy shared Genesis Resources lookup system. N number of callers can request information in succession, but only
2586
+ * the first will invoke the server request, and each caller will receive their results when that returns.
2587
+ * @public
2588
+ */
2589
+ export declare interface GenesisResources {
2590
+ /**
2591
+ * Checks if the resource exists
2592
+ * @param resourceName - The name of the resource to check.
2593
+ */
2594
+ isValidResource: (resourceName: string) => Promise<boolean>;
2595
+ /**
2596
+ * Gets the type of resource
2597
+ * @param resourceName - The name of the resource to get the type for.
2598
+ */
2599
+ getResourceTypeFor: (resourceName: string) => Promise<ResourceType>;
2600
+ /**
2601
+ * Destroy and garbage collect
2602
+ */
2603
+ destroy: () => void;
2604
+ }
2605
+
2606
+ /**
2607
+ * GenesisResources DI key.
2608
+ * @internal
2609
+ * @privateRemarks
2610
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
2611
+ */
2612
+ export declare const GenesisResources: InterfaceSymbol<GenesisResources>;
2613
+
2614
+ /**
2615
+ * GenesisResourcesChannel DI interface.
2616
+ * @example
2617
+ * ```ts
2618
+ * import { GenesisResourcesChannel } from '@genesislcap/foundation-comms';
2619
+ * ...
2620
+ * @GenesisResourcesChannel protected channel: GenesisResourcesChannel;
2621
+ * ...
2622
+ * this.channel.onmessage = (e) => {
2623
+ * if (this.channel.isMessageType('resources-loaded', e)) {
2624
+ * logger.debug('resources-loaded', e.data.detail);
2625
+ * return;
2626
+ * }
2627
+ * }
2628
+ * ...
2629
+ * this.channel.close();
2630
+ * ```
2631
+ * @public
2632
+ */
2633
+ export declare interface GenesisResourcesChannel extends TypedBroadcastChannel<GenesisResourcesEvents> {
2634
+ }
2635
+
2636
+ /**
2637
+ * GenesisResourcesChannel DI key.
2638
+ * @internal
2639
+ * @privateRemarks
2640
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
2641
+ */
2642
+ export declare const GenesisResourcesChannel: InterfaceSymbol<TypedBroadcastChannel<GenesisResourcesEvents>>;
2643
+
2644
+ /**
2645
+ * @public
2646
+ */
2647
+ export declare const GenesisResourcesChannelId = "genesis-resources";
2648
+
2649
+ /**
2650
+ * GenesisResourcesConfig DI interface.
2651
+ * @public
2652
+ */
2653
+ export declare interface GenesisResourcesConfig {
2654
+ /**
2655
+ * Treat unavailable/empty genesis resource sets as fatal errors.
2656
+ */
2657
+ throwWhenUnavailable?: boolean;
2658
+ /**
2659
+ * Treat unknown resources as fatal errors.
2660
+ */
2661
+ throwWhenUnknown?: boolean;
2662
+ }
2663
+
2664
+ /**
2665
+ * GenesisResourcesConfig DI key.
2666
+ * @internal
2667
+ * @privateRemarks
2668
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
2669
+ */
2670
+ export declare const GenesisResourcesConfig: InterfaceSymbol<GenesisResourcesConfig>;
2671
+
2672
+ /**
2673
+ * @public
2674
+ */
2675
+ export declare type GenesisResourcesEvents = {
2676
+ 'resources-loaded': ResourceItem[];
2677
+ 'resources-unloaded': void;
2678
+ };
2679
+
2680
+ /**
2681
+ * @public
2682
+ */
2683
+ export declare class GenesisResourcesMock implements GenesisResources {
2684
+ resources: ResourceItem[];
2685
+ nextIsValidResourceResponse: boolean;
2686
+ nextResourceTypeForResponse: ResourceType;
2687
+ /** {@inheritDoc GenesisResources.isValidResource} */
2688
+ isValidResource(resourceName: string): Promise<boolean>;
2689
+ /** {@inheritDoc GenesisResources.getResourceTypeFor} */
2690
+ getResourceTypeFor(resourceName: string): Promise<ResourceType>;
2691
+ destroy(): void;
2692
+ }
2693
+
2095
2694
  /**
2096
2695
  * Get Connect from the DI container.
2097
2696
  *
@@ -2150,6 +2749,47 @@ export declare type GetCredentialOptions = CredentialRequestOptions & {};
2150
2749
  */
2151
2750
  export declare function getDatasource(): Datasource;
2152
2751
 
2752
+ /**
2753
+ * Gets GenesisResources from the DI container.
2754
+ *
2755
+ * @remarks
2756
+ * A utility method for host applications that are not using decorators or the DI container.
2757
+ *
2758
+ * @example
2759
+ * ```ts
2760
+ * import { getGenesisResources } from '@genesislcap/foundation-comms';
2761
+ * ...
2762
+ * const genesisResources = getGenesisResources();
2763
+ * ```
2764
+ * @public
2765
+ */
2766
+ export declare function getGenesisResources(): GenesisResources;
2767
+
2768
+ /**
2769
+ * Gets GenesisResourcesChannel from the DI container.
2770
+ *
2771
+ * @remarks
2772
+ * A utility method for host applications that are not using decorators or the DI container.
2773
+ *
2774
+ * @example
2775
+ * ```ts
2776
+ * import { getGenesisResourcesChannel } from '@genesislcap/foundation-comms';
2777
+ * ...
2778
+ * const channel = getGenesisResourcesChannel();
2779
+ * ...
2780
+ * channel.onmessage = (e) => {
2781
+ * if (channel.isMessageType('resources-loaded', e)) {
2782
+ * logger.debug('resources-loaded', e.data.detail);
2783
+ * return;
2784
+ * }
2785
+ * }
2786
+ * ...
2787
+ * channel.close();
2788
+ * ```
2789
+ * @public
2790
+ */
2791
+ export declare function getGenesisResourcesChannel(): GenesisResourcesChannel;
2792
+
2153
2793
  /**
2154
2794
  * Gets KVStorage from the DI container.
2155
2795
  *
@@ -3274,6 +3914,23 @@ export declare type ResourceHealth = MonitoredResourceChecksResult & {
3274
3914
  lastError?: any;
3275
3915
  };
3276
3916
 
3917
+ /**
3918
+ * @public
3919
+ */
3920
+ export declare type ResourceItem = {
3921
+ RESOURCE_NAME: string;
3922
+ RESOURCE_TYPE: string;
3923
+ };
3924
+
3925
+ /**
3926
+ * @public
3927
+ */
3928
+ export declare type ResourcesMessage = {
3929
+ MESSAGE_TYPE: EventMessageType.RESOURCES_REQUEST_ACK | EventMessageType.RESOURCES_REQUEST_NACK | MessageType.MSG_NACK;
3930
+ SOURCE_REF: string;
3931
+ RESOURCES: ResourceItem[];
3932
+ };
3933
+
3277
3934
  /**
3278
3935
  * Types of Genesis resources.
3279
3936
  * @public
@@ -3534,6 +4191,7 @@ export declare interface Socket extends Omit<SocketStatus, 'serialize' | 'onClos
3534
4191
  */
3535
4192
  sendForStreamWithoutTeardown<T>(message: Message<T | any>, onMessage: Function, onError: Function): Observable<Message>;
3536
4193
  socketMessages(): SocketSubject<Message>;
4194
+ host: string;
3537
4195
  }
3538
4196
 
3539
4197
  /**
@@ -3653,6 +4311,7 @@ export declare class SocketMock implements Socket {
3653
4311
  isConnected: boolean;
3654
4312
  isConnectedSubject: BehaviorSubject<boolean>;
3655
4313
  isReconnecting: boolean;
4314
+ host: string;
3656
4315
  nextMessage: Message;
3657
4316
  socketMessagesSubject: SocketSubject<Message<any>>;
3658
4317
  connect(host: string, options?: SocketConnectOptions, reconnectOptions?: SocketReconnectOptions): Promise<boolean>;