Interface: ITraceRepository
Defined in: internal/trace/types.ts:129
Persistence seam.
Methods
anonymizeByUser()
anonymizeByUser(
args):Promise<number>
Defined in: internal/trace/types.ts:212
anonymizeByUser -- keeps a user's entries as an audit skeleton
About
GDPR pseudonymisation: the numbers stay, the words go.
userId becomes the pseudonym, request and result are removed; usage, cost, model, kind, chunk ids, issues and dates
stay. Returns how many.
Who needs it
Trace.anonymizeByUser, for the gateway's anonymizeUserData (D54).
Parameters
args
pseudonym
string
tenantId
string
userId
string
Returns
Promise<number>
delete()
delete(
args):Promise<number>
Defined in: internal/trace/types.ts:193
delete -- hard-deletes the entries of threads
About
"all": every entry of the tenant, the ones without a thread included.
Narrowed to one user when userId is given. Returns how many went.
Who needs it
Trace.delete, for the gateway's delete and deleteUserData (D54, D119).
Parameters
args
tenantId
string
threadIds
userId?
string
Returns
Promise<number>
load()
load(
args):Promise<ITraceEntry|null>
Defined in: internal/trace/types.ts:157
load -- one entry by id
About
Null when the tenant has no entry with this id.
The entry as stored, whole.
Who needs it
Trace.annotate, before it merges the gateway's facts into the entry.
Parameters
args
tenantId
string
traceId
string
Returns
Promise<ITraceEntry | null>
query()
query(
args):Promise<ITraceEntry[]>
Defined in: internal/trace/types.ts:174
query -- the entries of a tenant, filtered and paged
About
What matches
ITraceFilters, fromskip, at mostlimit.
User, thread, kind and the inclusive from / to dates narrow the set; the order is the adapter's.
Who needs it
Trace.query, for the host's audit pages.
Parameters
args
filters
limit
number
skip
number
tenantId
string
Returns
Promise<ITraceEntry[]>
save()
save(
args):Promise<void>
Defined in: internal/trace/types.ts:143
save -- inserts or replaces one entry
About
Upsert by
entry.idwithin the tenant.
The entry whole. A repository that must not keep the raw request or result drops them here.
Who needs it
Trace.record, for every model call; Trace.annotate, to write the entry back.
Parameters
args
entry
Returns
Promise<void>