-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1157 from XYOracleNetwork/feature/image-thumbnail…
…-diviner-query-types Image thumbnail diviner query types
- Loading branch information
Showing
7 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/plugins/packages/payload/packages/image-thumbnail/src/Diviner/Config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/plugins/packages/payload/packages/image-thumbnail/src/Diviner/Query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PayloadDivinerPredicate } from '@xyo-network/diviner-payload-model' | ||
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model' | ||
|
||
import { ImageThumbnailDivinerSchema } from './Schema' | ||
|
||
export type ImageThumbnailDivinerQuerySchema = `${ImageThumbnailDivinerSchema}.query` | ||
export const ImageThumbnailDivinerQuerySchema: ImageThumbnailDivinerQuerySchema = `${ImageThumbnailDivinerSchema}.query` | ||
|
||
export type ImageThumbnailDivinerQuery = Pick<PayloadDivinerPredicate, 'limit' | 'offset' | 'order'> & | ||
Payload<{ status?: boolean; url: string }, ImageThumbnailDivinerQuerySchema> | ||
|
||
export const isImageThumbnailDivinerQuery = isPayloadOfSchemaType<ImageThumbnailDivinerQuery>(ImageThumbnailDivinerQuerySchema) |
4 changes: 4 additions & 0 deletions
4
packages/plugins/packages/payload/packages/image-thumbnail/src/Diviner/Schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ImageThumbnailSchema } from '../Schema' | ||
|
||
export const ImageThumbnailDivinerSchema = `${ImageThumbnailSchema}.diviner` as const | ||
export type ImageThumbnailDivinerSchema = typeof ImageThumbnailDivinerSchema |
2 changes: 2 additions & 0 deletions
2
packages/plugins/packages/payload/packages/image-thumbnail/src/Diviner/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './Config' | ||
export * from './Params' | ||
export * from './Query' | ||
export * from './Schema' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/protocol/packages/payload/packages/model/src/isPayloadOfSchemaType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Payload } from './Payload' | ||
|
||
export const isPayloadOfSchemaType = <T extends Payload>(schema: string) => { | ||
return (x: Payload): x is T => x.schema === schema | ||
return (x?: Payload | null): x is T => x?.schema === schema | ||
} |