MCPcopy Create free account
hub / github.com/anomalyco/opencode / make

Function make

packages/http-recorder/src/redactor.ts:104–127  ·  view source on GitHub ↗
(options: RedactOptions = {})

Source from the content-addressed store, hash-verified

102}
103
104export const make = (options: RedactOptions = {}): Redactor => {
105 const fields = new Set([...DEFAULT_REDACT_JSON_FIELDS, ...(options.jsonFields ?? [])].map(normalizeField))
106 return compose(
107 requestHeaders({
108 allow: [...DEFAULT_REQUEST_HEADERS, ...(options.allowRequestHeaders ?? []), ...(options.headers ?? [])],
109 redact: options.headers,
110 }),
111 responseHeaders({
112 allow: [...DEFAULT_RESPONSE_HEADERS, ...(options.allowResponseHeaders ?? []), ...(options.headers ?? [])],
113 redact: options.headers,
114 }),
115 url({ query: options.queryParameters, transform: options.url }),
116 {
117 request: (snapshot) => ({
118 ...snapshot,
119 body: redactBody(snapshot.body, fields, options.body),
120 }),
121 response: (snapshot) => ({
122 ...snapshot,
123 body: redactBody(snapshot.body, fields, options.body),
124 }),
125 },
126 )
127}
128
129export const defaults = (overrides: DefaultRedactorOverrides = {}): Redactor =>
130 compose(

Callers 4

httpFunction · 0.70
recordingLayerFunction · 0.70
makeWebSocketExecutorFunction · 0.70
recordingLayerFunction · 0.70

Calls 5

requestHeadersFunction · 0.85
responseHeadersFunction · 0.85
composeFunction · 0.70
urlFunction · 0.70
redactBodyFunction · 0.70

Tested by

no test coverage detected