Skip to content

@graphty/graphty-element / index / SourceDescriptor

Interface: SourceDescriptor ​

Defined in: graph-io/dist/src/sources/types.d.ts:325

What a form needs to ask for a source's parameters, as data. Only plainName and params are required. Experimental.

Properties ​

auth? ​

readonly optional auth?: readonly CredentialKind[]

Defined in: graph-io/dist/src/sources/types.d.ts:335

The credential kinds it takes.

Default Value ​

ts
[]

authRequired? ​

readonly optional authRequired?: "optional" | "none" | "required"

Defined in: graph-io/dist/src/sources/types.d.ts:337

Whether a credential is needed.

Default Value ​

ts
"none"

defaultEndpoint? ​

readonly optional defaultEndpoint?: string | null

Defined in: graph-io/dist/src/sources/types.d.ts:339

The endpoint used when the caller names none.

Default Value ​

ts
null

features? ​

readonly optional features?: readonly SourceFeature[]

Defined in: graph-io/dist/src/sources/types.d.ts:369

The optional features it has; default: from the methods present.


kind? ​

readonly optional kind?: SourceKind

Defined in: graph-io/dist/src/sources/types.d.ts:333

What kind of service it is.

Default Value ​

ts
"other"

migrateParams? ​

readonly optional migrateParams?: (params, fromVersion) => Record<string, unknown>

Defined in: graph-io/dist/src/sources/types.d.ts:376

Upgrade params recorded by an older version.

Parameters ​

params ​

Record<string, unknown>

the old params

fromVersion ​

number

the version they were recorded with

Returns ​

Record<string, unknown>

the params for the current version


needs? ​

readonly optional needs?: object

Defined in: graph-io/dist/src/sources/types.d.ts:351

What it needs from a browser. Absent means "not declared": nothing is checked first. secureContext: true is checked before any request.

headers? ​

readonly optional headers?: readonly string[]

Request headers the service must allow from a page.

secureContext? ​

readonly optional secureContext?: boolean

Whether it needs a secure context (Web Crypto).

websocket? ​

readonly optional websocket?: boolean

Whether it needs a WebSocket.


params ​

readonly params: readonly SourceParamDescriptor[]

Defined in: graph-io/dist/src/sources/types.d.ts:329

The parameters.


plainName ​

readonly plainName: string

Defined in: graph-io/dist/src/sources/types.d.ts:327

The source's default name; catalog data an application may replace by id.


rateLimit? ​

readonly optional rateLimit?: object

Defined in: graph-io/dist/src/sources/types.d.ts:360

Paces ctx.fetch: at most requests per perMs, and concurrent at once.

concurrent? ​

readonly optional concurrent?: number

At most this many requests at once.

perMs ​

readonly perMs: number

The period, in milliseconds.

requests ​

readonly requests: number

At most this many requests per period.


runtimes? ​

readonly optional runtimes?: Readonly<Partial<Record<SourceRuntime, { reason?: SourceRuntimeReason; supported: boolean; }>>>

Defined in: graph-io/dist/src/sources/types.d.ts:341

Where it runs; a runtime marked unsupported is refused with E_SOURCE_RUNTIME before any request.


samples? ​

readonly optional samples?: readonly SourceSample[]

Defined in: graph-io/dist/src/sources/types.d.ts:378

Public examples to offer.


version? ​

readonly optional version?: number

Defined in: graph-io/dist/src/sources/types.d.ts:331

Bump when params or cursors change shape.

Default Value ​

ts
1