index#
Classes#
ServerError#
Defined in: index.ts:155
A call the server did not answer: unreachable when the request failed
(no status), status when the answer’s HTTP status is not 2xx or its body
is not what the route answers. refusal holds the server’s reasons where
the route gives them.
Extends#
Error
Constructors#
Constructor#
new ServerError(
code,status,message,cause?,refusal?):ServerError
Defined in: index.ts:160
Parameters#
code#
status#
number | null
message#
string
cause?#
unknown
refusal?#
Refusal | null = null
Returns#
Overrides#
Error.constructor
Properties#
code#
readonlycode:ServerErrorCode
Defined in: index.ts:156
refusal#
readonlyrefusal:Refusal|null
Defined in: index.ts:158
status#
readonlystatus:number|null
Defined in: index.ts:157
Interfaces#
ConnectOptions#
Defined in: index.ts:66
Where a server is and how to authenticate to it.
Properties#
token#
readonlytoken:string|null
Defined in: index.ts:70
The run’s token, sent as Authorization: Bearer <token>; null sends no header.
url#
readonlyurl:string
Defined in: index.ts:68
The base URL of the server’s API, ending in /: api/ for the page tilie serves.
ExpandedMeasureMap#
Defined in: index.ts:122
One entry of a manifest’s measure_maps, expanded.
Properties#
id#
readonlyid:string
Defined in: index.ts:123
rows#
readonlyrows: readonlyMeasureRow[]
Defined in: index.ts:124
Health#
Defined in: index.ts:74
The body of GET <url>health.
Properties#
files?#
readonlyoptionalfiles?:boolean
Defined in: index.ts:88
Whether the server offers the file routes (folders and files);
absent from the answer of a server that does not name it, which is read
as true.
name#
readonlyname:string
Defined in: index.ts:75
timetoalign#
readonlytimetoalign:string
Defined in: index.ts:77
version#
readonlyversion:string
Defined in: index.ts:76
MeasureRow#
Defined in: index.ts:100
One measure of an expanded measure map: every member of a decompressed
row of the Measure Map standard, as timetoalign expands it. The four
quarter-note values are Fraction pairs, null where the map gives none;
next lists the successors’ counts.
Properties#
actual_length#
readonlyactual_length:FractionPair|null
Defined in: index.ts:108
count#
readonlycount:number
Defined in: index.ts:102
end_repeat#
readonlyend_repeat:boolean
Defined in: index.ts:110
ID#
readonlyID:string
Defined in: index.ts:101
name#
readonlyname:string
Defined in: index.ts:105
next#
readonlynext: readonlynumber[]
Defined in: index.ts:111
nominal_length#
readonlynominal_length:FractionPair|null
Defined in: index.ts:107
number#
readonlynumber:number
Defined in: index.ts:104
offset_within_measure#
readonlyoffset_within_measure:FractionPair
Defined in: index.ts:118
qstamp#
readonlyqstamp:FractionPair|null
Defined in: index.ts:103
start_repeat#
readonlystart_repeat:boolean
Defined in: index.ts:109
time_signature#
readonlytime_signature:string|null
Defined in: index.ts:106
volta#
readonlyvolta:number| readonlynumber[] |null
Defined in: index.ts:117
The pass the measure’s volta bracket is played in, counted from 1, or
the distinct passes of a bracket standing for several, as the measure
map writes it (1 and [1] are kept apart); null under no bracket.
Refusal#
Defined in: index.ts:143
Why the server refused a request, as a route that explains itself answers
({"detail": {path, message, problems?}}): the path of what it refuses,
its message, and for a refused table every problem found in it.
Properties#
message#
readonlymessage:string
Defined in: index.ts:145
path#
readonlypath: readonly (string|number)[]
Defined in: index.ts:144
problems#
readonlyproblems: readonlyTableProblem[]
Defined in: index.ts:146
Server#
Defined in: index.ts:176
One server, as connect returns it: its routes, the user’s files among them (FileServer).
Extends#
Methods#
believeMatchClaim()#
believeMatchClaim(
manifest,table,belief):Promise<Blob>
Defined in: index.ts:237
The table with belief recorded: the new match_claims.parquet, a
Blob of the Parquet media type, as the server wrote it after checking
it against the manifest and against table by the succession rule.
Nothing is stored on the server. Rejects with a ServerError, whose
refusal says what the server refused.
Parameters#
manifest#
string
table#
Blob
belief#
Returns#
Promise<Blob>
flows()#
flows(
manifest,timeline,options?):Promise<Flows>
Defined in: index.ts:197
The flows of the timeline timeline (its bare ID) of a manifest, as
timetoalign plays its flow control: one request for the manifest’s
text, sent unchanged. Resolves to the timeline’s atomic sections and,
for the convention asked for or for all three, the runs played, the
sections they cover and the findings, each with its cause where
timetoalign names one, the elements read as options.reading says. A
timeline without flow control is one section and one run. Rejects with a
ServerError, whose refusal says what the server refused (a
timeline the manifest lacks at ["timeline"], a manifest timetoalign
refuses at the place in it).
Parameters#
manifest#
string
timeline#
string
options?#
Returns#
Promise<Flows>
health()#
health():
Promise<Health>
Defined in: index.ts:178
The server’s health; rejects with a ServerError when it does not answer.
Returns#
Promise<Health>
listFolder()#
listFolder(
path):Promise<FolderListing>
Defined in: files.ts:42
The folder path lists: its folders, then its workspace, manifest and
table files, hidden names and links leading out of the root left out.
Rejects with a ServerError whose refusal is the server’s (no such folder, path outside the root, hidden files are not served,
permission denied).
Parameters#
path#
string
Returns#
Promise<FolderListing>
Inherited from#
matchClaimEvents()#
matchClaimEvents(
manifest,table,claims):Promise<readonlyClaimEvents[]>
Defined in: index.ts:246
The events on both sides of the MatchClaims claims of a package’s
table, in that order: one request for them, the manifest’s text and the
MatchClaim table’s file, the table checked by the server against the
manifest as matchClaims has it checked. Rejects with a ServerError,
whose refusal says what the server refused (a MatchClaim the table
lacks at ["claims", <index>], the table’s problems).
Parameters#
manifest#
string
table#
Blob
claims#
readonly string[]
Returns#
Promise<readonly ClaimEvents[]>
matchClaimProvenance()#
matchClaimProvenance(
manifest,table,claims):Promise<readonlyClaimProvenance[]>
Defined in: index.ts:225
The provenance of the MatchClaims claims of a package’s table, in
that order: one request for them, the manifest’s text and the table’s
file, the table checked by the server as matchClaims has it checked.
Rejects with a ServerError, whose refusal says what the server
refused (a MatchClaim the table lacks at ["claims", <index>]).
Parameters#
manifest#
string
table#
Blob
claims#
readonly string[]
Returns#
Promise<readonly ClaimProvenance[]>
matchClaims()#
matchClaims(
manifest,table):Promise<MatchClaimTable>
Defined in: index.ts:217
A package’s MatchClaim table, checked by the server against its
manifest: one request for the manifest’s text and the table’s file,
sent unchanged. Resolves to the anchor index’s columns and every row’s
beliefs, each array a view into the answer; rejects with a
ServerError, whose refusal lists the check’s problems where the
server refuses the table.
Parameters#
manifest#
string
table#
Blob
Returns#
Promise<MatchClaimTable>
measureMaps()#
measureMaps(
manifest):Promise<readonlyExpandedMeasureMap[]>
Defined in: index.ts:184
The expanded rows of every measure map of a manifest, in the manifest’s
order: one request for the manifest’s JSON text, sent unchanged. Rejects
with a ServerError when the server does not answer them.
Parameters#
manifest#
string
Returns#
Promise<readonly ExpandedMeasureMap[]>
readFile()#
readFile(
path):Promise<Blob>
Defined in: files.ts:47
The bytes of the workspace, manifest or table file path. Rejects as
listFolder does, for no such file, and for a file of another kind.
Parameters#
path#
string
Returns#
Promise<Blob>
Inherited from#
withFlowMaps()#
withFlowMaps(
manifest,timeline,options?):Promise<string>
Defined in: index.ts:208
The manifest with the flows of the timeline timeline written: its
atomic sections as Regions and its computed FlowMaps, as timetoalign
writes them. Resolves to a manifest file’s text in JSON, as the server
answers it; nothing is stored on the server. Rejects with a
ServerError, whose refusal says what the server refused (at
["timeline"] also where timetoalign does not write the flows: of a
child timeline, or where an atomic section written before is none any
more and options names no actor to reject it).
Parameters#
manifest#
string
timeline#
string
options?#
Returns#
Promise<string>
writeFile()#
writeFile(
path,content):Promise<WrittenFile>
Defined in: files.ts:53
Write content into the workspace file path, replacing it whole: a
string as its UTF-8 bytes, a Blob unchanged. Rejects as listFolder
does, and for a file that is no workspace file.
Parameters#
path#
string
content#
string | Blob
Returns#
Promise<WrittenFile>
Inherited from#
TableProblem#
Defined in: index.ts:131
One problem a table check found: its code, its row (null for the table), its column’s path.
Properties#
code#
readonlycode:string
Defined in: index.ts:132
column#
readonlycolumn: readonlystring[]
Defined in: index.ts:134
message#
readonlymessage:string
Defined in: index.ts:135
row#
readonlyrow:number|null
Defined in: index.ts:133
Type Aliases#
FractionPair#
FractionPair = readonly [
number,number]
Defined in: index.ts:92
An exact quarter-note value: [numerator, denominator], both safe integers.
ServerErrorCode#
ServerErrorCode =
"unreachable"|"status"
Defined in: index.ts:128
Why a call failed: the server was unreachable, or its answer’s status or body was not the route’s.
Variables#
name#
constname:"@timetoalign/tilie-client"
Defined in: index.ts:63
The package’s name.
Functions#
connect()#
connect(
__namedParameters):Server
Defined in: index.ts:397
The server at url: one typed call per route, each sending the token,
when there is one.
Nothing is requested before a call is made; a call the server does not
answer as its route does rejects with a ServerError.
Parameters#
__namedParameters#
Returns#
References#
AtomicSection#
Re-exports AtomicSection
BeliefWord#
Re-exports BeliefWord
ClaimBelief#
Re-exports ClaimBelief
ClaimEvents#
Re-exports ClaimEvents
ClaimProvenance#
Re-exports ClaimProvenance
ClaimProvenanceEntry#
Re-exports ClaimProvenanceEntry
FileServer#
Re-exports FileServer
Flow#
Re-exports Flow
FlowConvention#
Re-exports FlowConvention
FlowFinding#
Re-exports FlowFinding
FlowFindingCause#
Re-exports FlowFindingCause
FlowFindingKind#
Re-exports FlowFindingKind
FlowNumberType#
Re-exports FlowNumberType
FlowOptions#
Re-exports FlowOptions
FlowRun#
Re-exports FlowRun
Flows#
Re-exports Flows
FlowValue#
Re-exports FlowValue
FolderEntry#
Re-exports FolderEntry
FolderListing#
Re-exports FolderListing
MatchClaimTable#
Re-exports MatchClaimTable
PARQUET_MEDIA_TYPE#
Re-exports PARQUET_MEDIA_TYPE
StatedBelief#
Re-exports StatedBelief
WrittenFile#
Re-exports WrittenFile
WrittenFlowOptions#
Re-exports WrittenFlowOptions