Manta Developers
GitHub
Menu

@manta-eu/react/worker

Reference for @manta-eu/react/worker as it is on main.

Classes

SignInUnreachableError

Extends

  • Error

Constructors

Constructor

new SignInUnreachableError(cause): SignInUnreachableError

Parameters
cause

unknown

Returns

SignInUnreachableError

Overrides

Error.constructor

Properties

cause?

optional cause?: unknown

Inherited from

Error.cause

message

message: string

Inherited from

Error.message

name

name: string

Inherited from

Error.name

stack?

optional stack?: string

Inherited from

Error.stack

stackTraceLimit

static stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

Error.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace

Type Aliases

ApprovalEmailMessage

ApprovalEmailMessage = { content: ApprovalRequestEmailContent; subject: string; template: "approvalRequest"; } | { content: ManualStepEmailContent; subject: string; template: "manualStep"; } | { content: RequestAssignmentEmailContent; subject: string; template: "requestAssignment"; }


ApprovalEmailRequest

ApprovalEmailRequest = object

Properties

author

author: string

description

description: string | null

href

href: string

title

title: string


ApprovalEnv

ApprovalEnv = AppWorkerEnv & object

Type Declaration

APP_ORIGIN?

optional APP_ORIGIN?: string

KEYCLOAK_URL?

optional KEYCLOAK_URL?: string

MANTA_APP_CLIENT_ID?

optional MANTA_APP_CLIENT_ID?: string

MANTA_APP_CLIENT_SECRET?

optional MANTA_APP_CLIENT_SECRET?: string

SPARQL_UPDATE_PSK?

optional SPARQL_UPDATE_PSK?: string

VITE_KEYCLOAK_REALM?

optional VITE_KEYCLOAK_REALM?: string


ApprovalRequestEmailArgs

ApprovalRequestEmailArgs = object

Properties

approver

approver: string

brandName

brandName: string

homeHref

homeHref: string

origin

origin: string

requests

requests: ApprovalEmailRequest[]

settingsHref

settingsHref: string


ApprovalRequestEmailContent

ApprovalRequestEmailContent = object

Properties

approvalRequests

approvalRequests: object[]

approvalAuthor

approvalAuthor: string

approvalDescription?

optional approvalDescription?: string

approvalTitle

approvalTitle: string

position

position: number

reviewUrl

reviewUrl: string

approverName

approverName: string

brandName

brandName: string

homeUrl

homeUrl: string

moreRequestCount?

optional moreRequestCount?: number

settingsUrl

settingsUrl: string


AppWorkerEnv

AppWorkerEnv = BrandGuidelinesEnv & CustomAppEnv & object

Type Declaration

AGENTS?

optional AGENTS?: object

AGENTS.fetch

fetch: typeof fetch

ASSETS?

optional ASSETS?: object

ASSETS.fetch

fetch: typeof fetch

MANTA_AGENTS_URL?

optional MANTA_AGENTS_URL?: string

MANTA_SESSION_SECRET?

optional MANTA_SESSION_SECRET?: string


AppWorkerOptions

AppWorkerOptions = object

Properties

brandGuidelines?

optional brandGuidelines?: BrandGuidelinesRoutesOptions

cookiePrefix?

optional cookiePrefix?: string

graphqlOperations?

optional graphqlOperations?: GraphQLAllowlist

proxyRoutes?

optional proxyRoutes?: readonly ProxyRoute[]

requestAssignmentEmails?

optional requestAssignmentEmails?: object

appName

appName: string

from

from: string

signIn?

optional signIn?: object

customApp

customApp: CustomAppSignIn


BrandGuidelinesEnv

BrandGuidelinesEnv = object

Properties

GOOGLE_FONTS_API_KEY?

optional GOOGLE_FONTS_API_KEY?: string


BrandGuidelinesRoutesOptions

BrandGuidelinesRoutesOptions = object

Properties

storageHosts?

optional storageHosts?: readonly string[]


CustomAppEnv

CustomAppEnv = object

Properties

KEYCLOAK_URL?

optional KEYCLOAK_URL?: string

MANTA_APP_CLIENT_ID?

optional MANTA_APP_CLIENT_ID?: string

MANTA_APP_CLIENT_SECRET?

optional MANTA_APP_CLIENT_SECRET?: string

VITE_KEYCLOAK_REALM?

optional VITE_KEYCLOAK_REALM?: string


CustomAppSignIn

CustomAppSignIn = object

Properties

datastoreId?

optional datastoreId?: string

The one datastore the app opens; /, /datastores and /g/... lead straight to it.

idpHint?

optional idpHint?: string

offlineAccess?

optional offlineAccess?: boolean

signOutOfManta?

optional signOutOfManta?: boolean


GraphQLAllowlist

GraphQLAllowlist = Record<string, readonly string[]>


ManualStepEmailArgs

ManualStepEmailArgs = object

Properties

appName

appName: string

brandName

brandName: string

origin

origin: string

reviewHref

reviewHref: string

settingsHref

settingsHref: string

step

step: string

title

title: string


ManualStepEmailContent

ManualStepEmailContent = object

Properties

appName

appName: string

approvalTitle

approvalTitle: string

brandName

brandName: string

manualStepText

manualStepText: string

reviewUrl

reviewUrl: string

settingsUrl

settingsUrl: string


OutgoingEmail

OutgoingEmail = object

Properties

message

message: ApprovalEmailMessage

to

to: string


ProxyRoute

ProxyRoute = object

Properties

graphql?

optional graphql?: true

methods

methods: readonly string[]

path

path: string

readOnly?

optional readOnly?: true

websocket?

optional websocket?: true


RequestAssignmentEmailArgs

RequestAssignmentEmailArgs = object

Properties

appName

appName: string

origin

origin: string

requestsHref

requestsHref: string

title

title: string

why

why: string | null


RequestAssignmentEmailContent

RequestAssignmentEmailContent = Omit<SchemaInterface<typeof MantaRequestAssignmentEmailTemplateSchema>, "$id" | "description" | "templateSource"> & Partial<Pick<SchemaInterface<typeof MantaRequestAssignmentEmailTemplateSchema>, "description">>


SendApprovalEmailsInput

SendApprovalEmailsInput = object

Properties

datastoreId

datastoreId: string

emails

emails: readonly OutgoingEmail[]

from

from: string

reportError?

optional reportError?: (error) => void

Parameters
error

unknown

Returns

void


ServiceEnv

ServiceEnv = Pick<ApprovalEnv, "MANTA_AGENTS_URL" | "AGENTS" | "KEYCLOAK_URL" | "VITE_KEYCLOAK_REALM" | "MANTA_APP_CLIENT_ID" | "MANTA_APP_CLIENT_SECRET">


ServiceFetchOptions

ServiceFetchOptions = object

Properties

datastoreId?

optional datastoreId?: string


StartedEmail

StartedEmail = object

Properties

iri

iri: string

template

template: ApprovalEmailMessage["template"]

to

to: string


StartedEmails

StartedEmails = object

Properties

emails

emails: StartedEmail[]

plan

plan: string

Functions

approvalRequestEmail()

approvalRequestEmail(args): ApprovalEmailMessage

Parameters

args

ApprovalRequestEmailArgs

Returns

ApprovalEmailMessage


createAppWorker()

createAppWorker<E>(options?): Hono<{ Bindings: E; }, BlankSchema, "/"> & object

Type Parameters

E

E extends AppWorkerEnv

Parameters

options?

AppWorkerOptions = {}

Returns

Hono<{ Bindings: E; }, BlankSchema, "/"> & object


manualStepEmail()

manualStepEmail(args): ApprovalEmailMessage

Parameters

args

ManualStepEmailArgs

Returns

ApprovalEmailMessage


requestAssignmentEmail()

requestAssignmentEmail(args): ApprovalEmailMessage

Parameters

args

RequestAssignmentEmailArgs

Returns

ApprovalEmailMessage


sendApprovalEmails()

sendApprovalEmails(env, input): Promise<StartedEmails | undefined>

Parameters

env

ApprovalEnv

input

SendApprovalEmailsInput

Returns

Promise<StartedEmails | undefined>


serviceFetch()

serviceFetch(env, options?): {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Parameters

env

ServiceEnv

options?

ServiceFetchOptions = {}

Returns

(input, init?): Promise<Response>

MDN Reference

Parameters
input

URL | RequestInfo

init?

RequestInit

Returns

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

Parameters
input

string | URL | Request

init?

RequestInit

Returns

Promise<Response>