AutoDiscovery
Defined in: src/autodiscovery.ts:65
Utilities for automatically discovery resources, such as hubs for users to log in to.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AutoDiscovery():
AutoDiscovery
Returns
Section titled “Returns”AutoDiscovery
Properties
Section titled “Properties”ALL_ERRORS
Section titled “ALL_ERRORS”
readonlystaticALL_ERRORS:AutoDiscoveryError[]
Defined in: src/autodiscovery.ts:91
ERROR_GENERIC_FAILURE
Section titled “ERROR_GENERIC_FAILURE”
readonlystaticERROR_GENERIC_FAILURE:GenericFailure=AutoDiscoveryError.GenericFailure
Defined in: src/autodiscovery.ts:73
ERROR_INVALID
Section titled “ERROR_INVALID”
readonlystaticERROR_INVALID:Invalid=AutoDiscoveryError.Invalid
Defined in: src/autodiscovery.ts:71
ERROR_INVALID_HUB
Section titled “ERROR_INVALID_HUB”
readonlystaticERROR_INVALID_HUB:InvalidHub=AutoDiscoveryError.InvalidHub
Defined in: src/autodiscovery.ts:77
ERROR_INVALID_HUB_BASE_URL
Section titled “ERROR_INVALID_HUB_BASE_URL”
readonlystaticERROR_INVALID_HUB_BASE_URL:InvalidHubBaseUrl=AutoDiscoveryError.InvalidHubBaseUrl
Defined in: src/autodiscovery.ts:75
ERROR_INVALID_IDENTITY_SERVER
Section titled “ERROR_INVALID_IDENTITY_SERVER”
readonlystaticERROR_INVALID_IDENTITY_SERVER:InvalidIdentityServer=AutoDiscoveryError.InvalidIdentityServer
Defined in: src/autodiscovery.ts:81
ERROR_INVALID_IS
Section titled “ERROR_INVALID_IS”
readonlystaticERROR_INVALID_IS:InvalidIs=AutoDiscoveryError.InvalidIs
Defined in: src/autodiscovery.ts:83
ERROR_INVALID_IS_BASE_URL
Section titled “ERROR_INVALID_IS_BASE_URL”
readonlystaticERROR_INVALID_IS_BASE_URL:InvalidIsBaseUrl=AutoDiscoveryError.InvalidIsBaseUrl
Defined in: src/autodiscovery.ts:79
ERROR_INVALID_JSON
Section titled “ERROR_INVALID_JSON”
readonlystaticERROR_INVALID_JSON:InvalidJson=AutoDiscoveryError.InvalidJson
Defined in: src/autodiscovery.ts:87
ERROR_MISSING_WELLKNOWN
Section titled “ERROR_MISSING_WELLKNOWN”
readonlystaticERROR_MISSING_WELLKNOWN:MissingWellknown=AutoDiscoveryError.MissingWellknown
Defined in: src/autodiscovery.ts:85
ERROR_UNSUPPORTED_HUB_SPEC_VERSION
Section titled “ERROR_UNSUPPORTED_HUB_SPEC_VERSION”
readonlystaticERROR_UNSUPPORTED_HUB_SPEC_VERSION:UnsupportedHubSpecVersion=AutoDiscoveryError.UnsupportedHubSpecVersion
Defined in: src/autodiscovery.ts:89
FAIL_ERROR
Section titled “FAIL_ERROR”
readonlystaticFAIL_ERROR:FAIL_ERROR=AutoDiscoveryAction.FAIL_ERROR
Defined in: src/autodiscovery.ts:97
The auto discovery failed. The client is expected to communicate the error to the user and refuse logging in.
FAIL_PROMPT
Section titled “FAIL_PROMPT”
readonlystaticFAIL_PROMPT:FAIL_PROMPT=AutoDiscoveryAction.FAIL_PROMPT
Defined in: src/autodiscovery.ts:106
The auto discovery failed, however the client may still recover from the problem. The client is recommended to that the same action it would for PROMPT while also warning the user about what went wrong. The client may also treat this the same as a FAIL_ERROR state.
PROMPT
Section titled “PROMPT”
readonlystaticPROMPT:PROMPT=AutoDiscoveryAction.PROMPT
Defined in: src/autodiscovery.ts:113
The auto discovery didn’t fail but did not find anything of interest. The client is expected to prompt the user for more information, or fail if it prefers.
SUCCESS
Section titled “SUCCESS”
readonlystaticSUCCESS:SUCCESS=AutoDiscoveryAction.SUCCESS
Defined in: src/autodiscovery.ts:118
The auto discovery was successful.
Methods
Section titled “Methods”findClientConfig()
Section titled “findClientConfig()”
staticfindClientConfig(domain):Promise<ClientConfig>
Defined in: src/autodiscovery.ts:304
Attempts to automatically discover client configuration information prior to logging in. Such information includes the hub URL and identity server URL the client would want. Additional details may also be discovered, and will be transparently included in the response object unaltered.
Parameters
Section titled “Parameters”domain
Section titled “domain”string
The hub domain to perform discovery on. For example, “matrix.org”.
Returns
Section titled “Returns”Promise<ClientConfig>
Promise which resolves to the discovered configuration, which may include error states. Rejects on unexpected failure, not when discovery fails.
fromDiscoveryConfig()
Section titled “fromDiscoveryConfig()”
staticfromDiscoveryConfig(wellknown?):Promise<ClientConfig>
Defined in: src/autodiscovery.ts:132
Validates and verifies client configuration information for purposes of logging in. Such information includes the hub URL and identity server URL the client would want. Additional details may also be included, and will be transparently brought into the response object unaltered.
Parameters
Section titled “Parameters”wellknown?
Section titled “wellknown?”The configuration object itself, as returned by the .well-known auto-discovery endpoint.
Returns
Section titled “Returns”Promise<ClientConfig>
Promise which resolves to the verified configuration, which may include error states. Rejects on unexpected failure, not when verification fails.
getRawClientConfig()
Section titled “getRawClientConfig()”
staticgetRawClientConfig(domain?):Promise<IClientWellKnown>
Defined in: src/autodiscovery.ts:371
Gets the raw discovery client configuration for the given domain name. Should only be used if there’s no validation to be done on the resulting object, otherwise use findClientConfig().
Parameters
Section titled “Parameters”domain?
Section titled “domain?”string
The domain to get the client config for.
Returns
Section titled “Returns”Promise<IClientWellKnown>
Promise which resolves to the domain’s client config. Can be an empty object.
setFetchFn()
Section titled “setFetchFn()”
staticsetFetchFn(fetchFn):void
Defined in: src/autodiscovery.ts:425
Parameters
Section titled “Parameters”fetchFn
Section titled “fetchFn”{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
Returns
Section titled “Returns”void