Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions plugins/Figma/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": { "name": "teamProjects" },
"required": true,
"error": "Could not connect to Figma. Check that your Personal Access Token is valid and has the required scopes, and that the Team ID is correct.",
"success": "Connected to Figma successfully."
}
]
}
23 changes: 23 additions & 0 deletions plugins/Figma/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"name": "Figma Project",
"sourceType": "Figma Project",
"icon": "folder",
"singular": "Project",
"plural": "Projects"
},
{
"name": "Figma Component",
"sourceType": "Figma Component",
"icon": "puzzle-piece",
"singular": "Component",
"plural": "Components"
},
{
"name": "Figma Style",
"sourceType": "Figma Style",
"icon": "palette",
"singular": "Style",
"plural": "Styles"
}
]
54 changes: 54 additions & 0 deletions plugins/Figma/v1/dataStreams/fileComments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "fileComments",
"displayName": "File Comments",
"description": "Comments on a specific Figma file",
"tags": ["Files", "Comments"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "files/{{fileKey}}/comments",
"pathToData": "comments",
"expandInnerObjects": true
},
"matches": "none",
"ui": [
{
"name": "project",
"type": "autocomplete",
"label": "Project",
"placeholder": "Select a Figma project",
"validation": { "required": true, "message": "You must select a project" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "projectsPicker", "dataSourceConfig": {} }
},
{
"name": "fileKey",
"type": "autocomplete",
"label": "File",
"placeholder": "Select a file",
"validation": { "required": true, "message": "You must select a file" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "filesInProject", "dataSourceConfig": { "endpointPath": { "fieldName": "project", "required": true } } }
}
],
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "visible": false },
{ "name": "message", "displayName": "Message", "shape": "string", "role": "label" },
{ "name": "user.handle", "displayName": "Author", "shape": "string" },
{ "name": "user.id", "visible": false },
{ "name": "user.img_url", "visible": false },
{ "name": "created_at", "displayName": "Created", "shape": "date", "role": "timestamp" },
{ "name": "resolved_at", "displayName": "Resolved", "shape": "date" },
{ "name": "parent_id", "displayName": "Parent ID", "shape": "string", "visible": false },
{
"name": "isReply",
"displayName": "Is Reply",
"computed": true,
"valueExpression": "{{ $['parent_id'] ? true : false }}",
"shape": "boolean"
}
],
"timeframes": false
}
58 changes: 58 additions & 0 deletions plugins/Figma/v1/dataStreams/fileSummary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "fileSummary",
"displayName": "File Summary",
"description": "Current metadata for a specific Figma file",
"tags": ["Files"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "files/{{fileKey}}/meta",
"pathToData": "file",
"expandInnerObjects": true
},
"matches": "none",
"ui": [
{
"name": "project",
"type": "autocomplete",
"label": "Project",
"placeholder": "Select a Figma project",
"validation": { "required": true, "message": "You must select a project" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "projectsPicker", "dataSourceConfig": {} }
},
{
"name": "fileKey",
"type": "autocomplete",
"label": "File",
"placeholder": "Select a file",
"validation": { "required": true, "message": "You must select a file" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "filesInProject", "dataSourceConfig": { "endpointPath": { "fieldName": "project", "required": true } } }
}
],
"metadata": [
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "name": "folder_name", "displayName": "Folder", "shape": "string" },
{ "name": "last_touched_at", "displayName": "Last Touched", "shape": "date", "role": "timestamp" },
{ "name": "creator.handle", "displayName": "Created By", "shape": "string" },
{ "name": "creator.id", "visible": false },
{ "name": "creator.img_url", "visible": false },
{ "name": "last_touched_by.handle", "displayName": "Last Touched By", "shape": "string" },
{ "name": "last_touched_by.id", "visible": false },
{ "name": "last_touched_by.img_url", "visible": false },
{ "name": "thumbnail_url", "displayName": "Thumbnail", "shape": "url" },
{ "name": "editorType", "displayName": "Editor Type", "shape": "string" },
{ "name": "version", "displayName": "Version", "shape": "string" },
{ "name": "link_access", "displayName": "Link Access", "shape": "string" },
{ "name": "role", "displayName": "Your Role", "shape": "string" },
{
"name": "url",
"displayName": "Open in Figma",
"shape": ["url", { "label": "Open in Figma" }]
}
],
"timeframes": false
}
58 changes: 58 additions & 0 deletions plugins/Figma/v1/dataStreams/fileVersions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "fileVersions",
"displayName": "File Versions",
"description": "Version history for a specific Figma file",
"tags": ["Files", "Version History"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "files/{{fileKey}}/versions",
"pathToData": "versions",
"expandInnerObjects": true,
"paging": {
"mode": "nextUrl",
"in": { "realm": "payload", "path": "pagination.next_page" }
}
},
"matches": "none",
"ui": [
{
"name": "project",
"type": "autocomplete",
"label": "Project",
"placeholder": "Select a Figma project",
"validation": { "required": true, "message": "You must select a project" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "projectsPicker", "dataSourceConfig": {} }
},
{
"name": "fileKey",
"type": "autocomplete",
"label": "File",
"placeholder": "Select a file",
"validation": { "required": true, "message": "You must select a file" },
"allowCustomValues": false,
"isMulti": false,
"data": { "source": "dataStream", "dataStreamName": "filesInProject", "dataSourceConfig": { "endpointPath": { "fieldName": "project", "required": true } } }
}
],
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "visible": false },
{ "name": "created_at", "displayName": "Created", "shape": "date", "role": "timestamp" },
{ "name": "label", "displayName": "Label", "shape": "string" },
{ "name": "description", "displayName": "Description", "shape": "string" },
{
"name": "versionName",
"displayName": "Version",
"computed": true,
"valueExpression": "{{ (typeof $['label'] === 'string' && $['label']) || (typeof $['description'] === 'string' && $['description']) || $['created_at'] }}",
"shape": "string",
"role": "label"
},
{ "name": "user.handle", "displayName": "Created By", "shape": "string" },
{ "name": "user.id", "visible": false },
{ "name": "user.img_url", "visible": false }
],
"timeframes": false
}
34 changes: 34 additions & 0 deletions plugins/Figma/v1/dataStreams/filesInProject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "filesInProject",
"displayName": "Files in Project",
"description": "Retrieve a list of files within a specified Figma project for use as an autocomplete source",
"tags": ["Files"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"pathToData": "files"
},
"matches": "none",
"visibility": {
"type": "hidden"
},
"metadata": [
{ "name": "key", "displayName": "Key", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "visible": false },
{
"name": "label",
"displayName": "Label",
"computed": true,
"valueExpression": "{{ $['name'] }}",
"role": "label"
},
{
"name": "value",
"displayName": "Value",
"computed": true,
"valueExpression": "{{ $['key'] }}",
"role": "value"
}
],
"timeframes": false
}
27 changes: 27 additions & 0 deletions plugins/Figma/v1/dataStreams/projectFiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "projectFiles",
"displayName": "Project Files",
"description": "Files within a Figma project",
"tags": ["Files"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "projects/{{object.rawId}}/files",
"pathToData": "files"
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Figma Project"] } },
"metadata": [
{ "name": "key", "displayName": "Key", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "name": "thumbnail_url", "displayName": "Thumbnail", "shape": "url" },
{ "name": "last_modified", "displayName": "Last Modified", "shape": "date" },
{
"name": "fileUrl",
"displayName": "Open in Figma",
"computed": true,
"valueExpression": "{{ 'https://www.figma.com/file/' + $['key'] + '/' }}",
"shape": ["url", { "label": "Open in Figma" }]
}
],
"timeframes": false
}
35 changes: 35 additions & 0 deletions plugins/Figma/v1/dataStreams/projectsPicker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "projectsPicker",
"displayName": "Projects Picker",
"description": "Retrieve a list of projects within the configured Figma team for use as an autocomplete source",
"tags": ["Projects"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "teams/{{dataSource.teamId}}/projects",
"pathToData": "projects"
},
"matches": "none",
"visibility": {
"type": "hidden"
},
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "visible": false },
{
"name": "label",
"displayName": "Label",
"computed": true,
"valueExpression": "{{ $['name'] }}",
"role": "label"
},
{
"name": "value",
"displayName": "Value",
"computed": true,
"valueExpression": "{{ 'projects/' + $['id'] + '/files' }}",
"role": "value"
}
],
"timeframes": false
}
38 changes: 38 additions & 0 deletions plugins/Figma/v1/dataStreams/teamComponents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "teamComponents",
"displayName": "Team Components",
"description": "Published components in the team's library",
"tags": ["Components", "Design System"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "teams/{{dataSource.teamId}}/components",
"pathToData": "meta.components",
"expandInnerObjects": true,
"paging": {
"mode": "token",
"pageSize": { "realm": "queryArg", "path": "page_size", "value": "100" },
"in": { "realm": "payload", "path": "meta.cursor.after" },
"out": { "realm": "queryArg", "path": "after" }
}
},
"matches": "none",
"metadata": [
{ "name": "key", "displayName": "Key", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "name": "description", "displayName": "Description", "shape": "string" },
{ "name": "file_key", "displayName": "File Key", "shape": "string", "visible": false },
{ "name": "created_at", "displayName": "Created", "shape": "date" },
{ "name": "updated_at", "displayName": "Updated", "shape": "date" },
{ "name": "user.handle", "displayName": "Created By", "shape": "string" },
{
"name": "fileUrl",
"displayName": "Open in Figma",
"computed": true,
"valueExpression": "{{ 'https://www.figma.com/file/' + $['file_key'] + '/' }}",
"shape": ["url", { "label": "Open in Figma" }]
},
{ "sourceId": "key", "sourceType": "Figma Component", "name": "name" }
],
"timeframes": false
}
19 changes: 19 additions & 0 deletions plugins/Figma/v1/dataStreams/teamProjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "teamProjects",
"displayName": "Team Projects",
"description": "Projects within the configured Figma team",
"tags": ["Projects"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "teams/{{dataSource.teamId}}/projects",
"pathToData": "projects"
},
"matches": "none",
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "sourceId": "id", "sourceType": "Figma Project", "name": "name" }
],
"timeframes": false
}
Loading
Loading