-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: strong type objects and types (#26)
- Loading branch information
Showing
15 changed files
with
3,175 additions
and
7 deletions.
There are no files selected for viewing
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
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,155 @@ | ||
// :copyright: Copyright (c) 2023 ftrack | ||
|
||
// Generated on 2023-01-31T23:00:00.000Z using schema | ||
// from an instance running version 4.13.8 using server on https://ftrack.example.com | ||
// Not intended to modify manually | ||
|
||
export interface TypedContext< | ||
K extends TypedContextSubtype = TypedContextSubtype | ||
> { | ||
__entity_type__?: K; | ||
__permissions?: Record<string, any>; | ||
} | ||
export interface BasicLink { | ||
id: string; | ||
type: string; | ||
name: string; | ||
} | ||
export interface EntityTypeMap { | ||
TypedContext: TypedContext; | ||
} | ||
export type EntityType = keyof EntityTypeMap; | ||
export type EntityData<TEntityType extends EntityType = EntityType> = | ||
EntityTypeMap[TEntityType]; | ||
export interface TypedContextSubtypeMap { | ||
TypedContext: TypedContext; | ||
} | ||
export type TypedContextSubtype = keyof TypedContextSubtypeMap; | ||
export function getAttributeConfigurations() { | ||
return [] as const; | ||
} | ||
|
||
export type CustomAttributeConfiguration = ReturnType< | ||
typeof getAttributeConfigurations | ||
>[number]; | ||
export type CustomAttributeConfigurationName = | ||
CustomAttributeConfiguration["name"]; | ||
export type CustomAttributeConfigurationLabel = | ||
CustomAttributeConfiguration["label"]; | ||
|
||
export function getTypes() { | ||
return [] as const; | ||
} | ||
|
||
export type Type = ReturnType<typeof getTypes>[number]; | ||
export type TypeName = Type["name"]; | ||
|
||
export function getObjectTypes() { | ||
return [ | ||
{ | ||
name: "Folder", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: false, | ||
is_schedulable: false, | ||
is_prioritizable: true, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Asset Build", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: true, | ||
is_statusable: true, | ||
is_schedulable: false, | ||
is_prioritizable: true, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Episode", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: true, | ||
is_schedulable: false, | ||
is_prioritizable: true, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Scene", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: true, | ||
is_schedulable: false, | ||
is_prioritizable: false, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Sequence", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: false, | ||
is_schedulable: false, | ||
is_prioritizable: true, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Shot", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: true, | ||
is_schedulable: false, | ||
is_prioritizable: true, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Milestone", | ||
is_time_reportable: false, | ||
is_taskable: false, | ||
is_typeable: true, | ||
is_statusable: true, | ||
is_schedulable: true, | ||
is_prioritizable: true, | ||
is_leaf: true, | ||
}, | ||
{ | ||
name: "Task", | ||
is_time_reportable: true, | ||
is_taskable: false, | ||
is_typeable: true, | ||
is_statusable: true, | ||
is_schedulable: true, | ||
is_prioritizable: true, | ||
is_leaf: true, | ||
}, | ||
{ | ||
name: "Image", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: false, | ||
is_schedulable: false, | ||
is_prioritizable: false, | ||
is_leaf: false, | ||
}, | ||
{ | ||
name: "Information", | ||
is_time_reportable: false, | ||
is_taskable: true, | ||
is_typeable: false, | ||
is_statusable: false, | ||
is_schedulable: false, | ||
is_prioritizable: false, | ||
is_leaf: false, | ||
}, | ||
] as const; | ||
} | ||
|
||
export type ObjectType = ReturnType<typeof getObjectTypes>[number]; | ||
export type ObjectTypeName = ObjectType["name"]; | ||
|
||
// Errors: |
Oops, something went wrong.