Skip to content

Commit 7290e3a

Browse files
committed
comments
1 parent 93fcdef commit 7290e3a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/configuration-wire-types.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ type ResponseString<T extends UfcResponseType> = string & {
174174
readonly __type: T;
175175
};
176176

177+
/**
178+
* A wrapper around a server response that includes the response, etag, and fetchedAt timestamp.
179+
*/
180+
interface IConfigResponse<T extends UfcResponseType> {
181+
readonly response: ResponseString<T>; // JSON-encoded server response
182+
readonly etag?: string; // Entity Tag - denotes a snapshot or version of the config.
183+
readonly fetchedAt?: string; // ISO timestamp for when this config was fetched
184+
}
185+
177186
export function inflateResponse<T extends UfcResponseType>(response: ResponseString<T>): T {
178187
return JSON.parse(response) as T;
179188
}
@@ -182,12 +191,6 @@ export function deflateResponse<T extends UfcResponseType>(value: T): ResponseSt
182191
return JSON.stringify(value) as ResponseString<T>;
183192
}
184193

185-
interface IConfigResponse<T extends UfcResponseType> {
186-
readonly response: ResponseString<T>; // JSON-encoded server response
187-
readonly etag?: string; // Entity Tag - denotes a snapshot or version of the config.
188-
readonly fetchedAt?: string; // ISO timestamp for when this config was fetched
189-
}
190-
191194
export class ConfigurationWireV1 implements IConfigurationWire {
192195
public readonly version = 1;
193196

0 commit comments

Comments
 (0)