fix: migrate gifs to klipy service (#1220)

This commit is contained in:
Hampus
2026-06-30 01:19:57 +02:00
committed by GitHub
parent 99eedf6d1e
commit 4a741d8396
79 changed files with 3032 additions and 1653 deletions
@@ -526,7 +526,6 @@ const InstancePolicyResponse = z.object({
}),
});
const GifProviderSchema = z.enum(['tenor', 'klipy']);
const CaptchaProviderSchema = z.enum(['hcaptcha', 'turnstile', 'none']);
const EmailProviderSchema = z.enum(['smtp', 'none']);
@@ -559,9 +558,6 @@ const InstanceMediaResponse = z.object({
const InstanceIntegrationsResponse = z.object({
gif: z.object({
provider: GifProviderSchema.nullable(),
effective_provider: GifProviderSchema,
tenor_api_key_set: z.boolean(),
klipy_api_key_set: z.boolean(),
effective_available: z.boolean(),
}),
@@ -648,8 +644,6 @@ export const InstanceConfigUpdateRequest = z.object({
.object({
gif: z
.object({
provider: GifProviderSchema.nullish(),
tenor_api_key: z.string().trim().max(4096).nullish(),
klipy_api_key: z.string().trim().max(4096).nullish(),
})
.nullish(),
@@ -9,7 +9,7 @@ export const GIF_PROVIDER_DISPLAY_NAME_HEADER = 'X-Fluxer-GIF-Provider-Display-N
export const GIF_PROVIDER_ATTRIBUTION_HEADER = 'X-Fluxer-GIF-Provider-Attribution-Required';
const LocaleType = LocaleSchema.default('en-US').transform((v) => v.replace('-', '_'));
const GifProviderName = createStringType(1, 32).describe(
'Identifier of the active GIF provider (e.g. "klipy", "tenor"). Vendor names are opaque to clients.',
'Identifier of the active GIF provider. KLIPY is currently the only supported provider.',
);
export const GifSearchQuery = z.object({
@@ -69,10 +69,10 @@ export type GifResponse = z.infer<typeof GifResponse>;
export const GifCategoryTagResponse = z.object({
name: z.string().describe('Category search term (locale-translated label suitable for display).'),
src: z.string().describe('URL to the category preview image (legacy / fallback).'),
proxy_src: z.string().describe('Proxied URL to the category preview image (legacy / fallback).'),
src: z.string().describe('Category preview image URL from the top GIF for this category search term.'),
proxy_src: z.string().describe('Proxied category preview image URL from the top GIF for this category search term.'),
gif: GifResponse.nullable().describe(
'Full enriched GIF for the category (first search result for `name`). Null until the background cache is populated for this locale; fall back to `src` / `proxy_src` in that case.',
'Enriched category preview GIF from the top search result for this category. Null only when no preview GIF was available.',
),
});
@@ -91,7 +91,7 @@ export const WellKnownFluxerResponse = z.object({
.describe('Feature flags for this instance'),
gif: z
.object({
provider: z.string().describe('Stable machine name of the active GIF provider (e.g. "klipy", "tenor")'),
provider: z.string().describe('Stable machine name of the active GIF provider.'),
display_name: z.string().describe('Human-readable provider name shown in the UI'),
attribution_required: z
.boolean()
@@ -30,7 +30,7 @@ export const CreateFavoriteMemeFromUrlBodySchema = FavoriteMemeBase.extend({
.describe('Provider-issued slug or slug-id token for the GIF, when sourced from a provider'),
gif_provider: createStringType(1, 32)
.nullish()
.describe('Stable name of the GIF provider that issued gif_slug (e.g. "klipy", "tenor")'),
.describe('Stable name of the GIF provider that issued gif_slug. New provider GIFs are sourced from KLIPY.'),
media: z
.record(z.string(), GifMediaFormat)
.nullish()
@@ -77,7 +77,9 @@ export const FavoriteMemeResponse = z.object({
gif_provider: z
.string()
.nullish()
.describe('Stable name of the GIF provider that issued gif_slug (e.g. "klipy", "tenor"), if any'),
.describe(
'Stable name of the GIF provider that issued gif_slug, if any. Legacy records may contain older provider names.',
),
media: z
.record(z.string(), GifMediaFormat)
.nullish()