Skip to content

Commit

Permalink
feat: support external resource links [DANTE-1298] (#2118)
Browse files Browse the repository at this point in the history
  • Loading branch information
Silhoue committed Jan 10, 2024
1 parent ee78332 commit 5399a47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions lib/entities/content-type-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,18 @@ interface Item {
validations?: ContentTypeFieldValidation[]
}

interface ContentTypeAllowedResources {
type: string
type ContentTypeAllowedResources = ContentfulEntryResource | ExternalResource

export interface ContentfulEntryResource {
type: 'Contentful:Entry'
source: string
contentTypes: string[]
}

export interface ExternalResource {
type: string
}

export interface ContentFields<T = KeyValueMap> extends Item {
id: string
name: string
Expand Down
4 changes: 2 additions & 2 deletions lib/entities/field-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export type FieldType =
| { type: 'Location' }
| { type: 'Link'; linkType: 'Asset' }
| { type: 'Link'; linkType: 'Entry' }
| { type: 'ResourceLink'; linkType: 'Contentful:Entry' }
| { type: 'ResourceLink'; linkType: string }
| { type: 'Array'; items: { type: 'Symbol' } }
| { type: 'Array'; items: { type: 'Link'; linkType: 'Entry' } }
| { type: 'Array'; items: { type: 'Resourcelink'; linkType: 'Contentful:Entry' } }
| { type: 'Array'; items: { type: 'Resourcelink'; linkType: string } }
| { type: 'Array'; items: { type: 'Link'; linkType: 'Asset' } }

0 comments on commit 5399a47

Please sign in to comment.