mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-31 03:07:23 +00:00
fix(protocol): refactor oauth-authorize to accept an ImageLike when authorizing
This commit moves the image.ts file from the frontend into the protocol package, allowing the argument type to be updated.
This commit is contained in:
parent
fa3fbe3044
commit
c7937e040a
9 changed files with 9 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
import { z } from 'zod/v4';
|
||||
import { ImageLikeSchema } from './image';
|
||||
|
||||
export const OpenPayloadSchema = z.object({
|
||||
target: z.string(),
|
||||
|
@ -93,7 +94,7 @@ export const ClipboardClearMessageSchema = z.object({
|
|||
export const OauthAuthorizePayloadSchema = z.object({
|
||||
url: z.string(),
|
||||
providerName: z.string(),
|
||||
providerIcon: z.string().optional(),
|
||||
providerIcon: ImageLikeSchema.optional(),
|
||||
description: z.string().optional()
|
||||
});
|
||||
export const OauthAuthorizeMessageSchema = z.object({
|
||||
|
|
15
packages/protocol/src/image.ts
Normal file
15
packages/protocol/src/image.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { z } from 'zod/v4';
|
||||
|
||||
export const ImageMaskSchema = z.enum(['circle', 'roundedRectangle']);
|
||||
|
||||
export const RaycastIconSchema = z.templateLiteral([z.string(), '-16']);
|
||||
|
||||
export const ImageLikeSchema = z.union([
|
||||
RaycastIconSchema,
|
||||
z.string(),
|
||||
z.object({
|
||||
source: z.union([z.string(), z.object({ light: z.string(), dark: z.string() })]),
|
||||
mask: ImageMaskSchema.optional()
|
||||
})
|
||||
]);
|
||||
export type ImageLike = z.infer<typeof ImageLikeSchema>;
|
|
@ -7,3 +7,4 @@ export * from './main';
|
|||
export * from './plugin';
|
||||
export * from './preferences';
|
||||
export * from './toast';
|
||||
export * from './image';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue