-
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: add support for custom attribute types (#25)
- Loading branch information
Showing
12 changed files
with
376 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// :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 [ | ||
{ | ||
name: "fend", | ||
label: "Frame end", | ||
entityType: "task", | ||
objectType: "Shot", | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "handles", | ||
label: "Frame handles", | ||
entityType: "task", | ||
objectType: "Shot", | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "duration", | ||
label: "Frame duration", | ||
entityType: "task", | ||
objectType: "Shot", | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "fstart", | ||
label: "Frame start", | ||
entityType: "task", | ||
objectType: "Shot", | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "fps", | ||
label: "fps", | ||
entityType: "show", | ||
objectType: undefined, | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "fps", | ||
label: "fps", | ||
entityType: "task", | ||
objectType: "Sequence", | ||
isHierarchical: false, | ||
}, | ||
{ | ||
name: "fps", | ||
label: "fps", | ||
entityType: "task", | ||
objectType: "Shot", | ||
isHierarchical: false, | ||
}, | ||
] as const; | ||
} | ||
|
||
export type CustomAttributeConfiguration = ReturnType< | ||
typeof getAttributeConfigurations | ||
>[number]; | ||
export type CustomAttributeConfigurationName = | ||
CustomAttributeConfiguration["name"]; | ||
export type CustomAttributeConfigurationLabel = | ||
CustomAttributeConfiguration["label"]; | ||
|
||
// Errors: |
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
110 changes: 110 additions & 0 deletions
110
source/__snapshots__/responses/query_custom_attribute_configurations.json
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,110 @@ | ||
[ | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "432bc746-4087-11e2-8250-0019bb4983d8", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "bad911de-3bd6-47b9-8b46-3476e237cb36", | ||
"name": "Shot" | ||
}, | ||
"key": "fend", | ||
"entity_type": "task", | ||
"label": "Frame end", | ||
"project_id": null, | ||
"default": 1, | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "432bdfa6-4087-11e2-8250-0019bb4983d8", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "bad911de-3bd6-47b9-8b46-3476e237cb36", | ||
"name": "Shot" | ||
}, | ||
"key": "handles", | ||
"entity_type": "task", | ||
"label": "Frame handles", | ||
"project_id": null, | ||
"default": 0, | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "928887a8-645f-4909-a7d0-d1661cacd178", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "bad911de-3bd6-47b9-8b46-3476e237cb36", | ||
"name": "Shot" | ||
}, | ||
"key": "duration", | ||
"entity_type": "task", | ||
"label": "Frame duration", | ||
"project_id": null, | ||
"default": "{self.fend - self.fstart + 1}", | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "acd86546-4082-11e2-95b1-0019bb4983d8", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "bad911de-3bd6-47b9-8b46-3476e237cb36", | ||
"name": "Shot" | ||
}, | ||
"key": "fstart", | ||
"entity_type": "task", | ||
"label": "Frame start", | ||
"project_id": null, | ||
"default": 1, | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "d25219d6-acb5-11e1-8668-f23c91df1211", | ||
"object_type": null, | ||
"key": "fps", | ||
"entity_type": "show", | ||
"label": "fps", | ||
"project_id": null, | ||
"default": 24, | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "d25532e2-acb5-11e1-8668-f23c91df1211", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "e5139355-61da-4c8f-9db4-3abc870166bc", | ||
"name": "Sequence" | ||
}, | ||
"key": "fps", | ||
"entity_type": "task", | ||
"label": "fps", | ||
"project_id": null, | ||
"default": 25, | ||
"is_hierarchical": false, | ||
"values": [] | ||
}, | ||
{ | ||
"__entity_type__": "CustomAttributeConfiguration", | ||
"id": "d25907a0-acb5-11e1-8668-f23c91df1211", | ||
"object_type": { | ||
"__entity_type__": "ObjectType", | ||
"id": "bad911de-3bd6-47b9-8b46-3476e237cb36", | ||
"name": "Shot" | ||
}, | ||
"key": "fps", | ||
"entity_type": "task", | ||
"label": "fps", | ||
"project_id": null, | ||
"default": 25, | ||
"is_hierarchical": false, | ||
"values": [] | ||
} | ||
] |
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
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
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
Oops, something went wrong.