• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / realm-provider / 18787135118

24 Oct 2025 05:20PM UTC coverage: 16.438% (-22.7%) from 39.12%
18787135118

Pull #75

github

kevinszuchet
chore: Remove output-directory from docs workflow
Pull Request #75: docs: Add API spec

13 of 50 branches covered (26.0%)

Branch coverage included in aggregate %.

35 of 242 relevant lines covered (14.46%)

0.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/src/types.ts
1
import type {
2
  IConfigComponent,
3
  ILoggerComponent,
4
  IHttpServerComponent,
5
  IBaseComponent,
6
  IMetricsComponent,
7
  IFetchComponent
8
} from '@well-known-components/interfaces'
9
import { metricDeclarations } from './metrics'
10
import { CatalystsProvider } from './adapters/realm-provider'
11
import { MainRealmProviderComponent } from './adapters/main-realm-provider'
12
import { IContentComponent } from './adapters/content'
13

14
export type GlobalContext = {
15
  components: BaseComponents
16
}
17

18
// components used in every environment
19
export type BaseComponents = {
20
  config: IConfigComponent
21
  logs: ILoggerComponent
22
  server: IHttpServerComponent<GlobalContext>
23
  fetch: IFetchComponent
24
  metrics: IMetricsComponent<keyof typeof metricDeclarations>
25
  catalystsProvider: CatalystsProvider
26
  mainRealmProvider: MainRealmProviderComponent
27
  content: IContentComponent
28
}
29

30
// components used in runtime
31
export type AppComponents = BaseComponents & {
32
  statusChecks: IBaseComponent
33
}
34

35
// components used in tests
36
export type TestComponents = BaseComponents & {
37
  // A fetch component that only hits the test server
38
  localFetch: IFetchComponent
39
}
40

41
// this type simplifies the typings of http handlers
42
export type HandlerContextWithPath<
43
  ComponentNames extends keyof AppComponents,
44
  Path extends string = any
45
> = IHttpServerComponent.PathAwareContext<
46
  IHttpServerComponent.DefaultContext<{
47
    components: Pick<AppComponents, ComponentNames>
48
  }>,
49
  Path
50
>
51

52
export type Context<Path extends string = any> = IHttpServerComponent.PathAwareContext<GlobalContext, Path>
53

54
export class InvalidRequestError extends Error {
1✔
55
  constructor(message: string) {
56
    super(message)
×
57
    Error.captureStackTrace(this, this.constructor)
×
58
  }
59
}
60

61
export class NotFoundError extends Error {
1✔
62
  constructor(message: string) {
63
    super(message)
×
64
    Error.captureStackTrace(this, this.constructor)
×
65
  }
66
}
67

68
export class ServiceUnavailableError extends Error {
1✔
69
  constructor(message: string) {
70
    super(message)
×
71
    Error.captureStackTrace(this, this.constructor)
×
72
  }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc