add alpaca news wire across ingest api and web
This commit is contained in:
parent
62aae70878
commit
906fe411c9
31 changed files with 1407 additions and 50 deletions
|
|
@ -262,3 +262,26 @@ export const InferredDarkEventSchema = EventMetaSchema.merge(
|
|||
);
|
||||
|
||||
export type InferredDarkEvent = z.infer<typeof InferredDarkEventSchema>;
|
||||
|
||||
export const NewsSymbolResolutionSchema = z.enum(["provider", "derived", "mixed", "none"]);
|
||||
|
||||
export type NewsSymbolResolution = z.infer<typeof NewsSymbolResolutionSchema>;
|
||||
|
||||
export const NewsStorySchema = EventMetaSchema.merge(
|
||||
z.object({
|
||||
story_id: z.number().int().nonnegative(),
|
||||
provider: z.string().min(1),
|
||||
source: z.string().min(1),
|
||||
headline: z.string().min(1),
|
||||
summary: z.string(),
|
||||
content_html: z.string(),
|
||||
url: z.string().url().or(z.literal("")),
|
||||
published_ts: z.number().int().nonnegative(),
|
||||
updated_ts: z.number().int().nonnegative(),
|
||||
provider_symbols: z.array(z.string().min(1)),
|
||||
resolved_symbols: z.array(z.string().min(1)),
|
||||
symbol_resolution: NewsSymbolResolutionSchema
|
||||
})
|
||||
);
|
||||
|
||||
export type NewsStory = z.infer<typeof NewsStorySchema>;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import {
|
|||
EquityQuoteSchema,
|
||||
FlowPacketSchema,
|
||||
InferredDarkEventSchema,
|
||||
NewsStorySchema,
|
||||
OptionNBBOSchema,
|
||||
OptionPrintSchema,
|
||||
SmartMoneyEventSchema
|
||||
|
|
@ -34,7 +35,8 @@ export const LiveGenericChannelSchema = z.enum([
|
|||
"smart-money",
|
||||
"classifier-hits",
|
||||
"alerts",
|
||||
"inferred-dark"
|
||||
"inferred-dark",
|
||||
"news"
|
||||
]);
|
||||
|
||||
export const LiveChannelSchema = z.enum([
|
||||
|
|
@ -48,6 +50,7 @@ export const LiveChannelSchema = z.enum([
|
|||
"classifier-hits",
|
||||
"alerts",
|
||||
"inferred-dark",
|
||||
"news",
|
||||
"equity-candles",
|
||||
"equity-overlay"
|
||||
]);
|
||||
|
|
@ -91,7 +94,7 @@ export const LiveSubscriptionSchema = z.discriminatedUnion("channel", [
|
|||
snapshot_limit: z.number().int().positive().optional()
|
||||
}),
|
||||
z.object({
|
||||
channel: z.enum(["nbbo", "equity-quotes", "equity-joins", "classifier-hits", "alerts", "inferred-dark"]),
|
||||
channel: z.enum(["nbbo", "equity-quotes", "equity-joins", "classifier-hits", "alerts", "inferred-dark", "news"]),
|
||||
snapshot_limit: z.number().int().positive().optional()
|
||||
}),
|
||||
z.object({
|
||||
|
|
@ -123,6 +126,7 @@ const livePayloadSchemas = {
|
|||
"classifier-hits": ClassifierHitEventSchema,
|
||||
alerts: AlertEventSchema,
|
||||
"inferred-dark": InferredDarkEventSchema,
|
||||
news: NewsStorySchema,
|
||||
"equity-candles": EquityCandleSchema,
|
||||
"equity-overlay": EquityPrintSchema
|
||||
} as const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue