Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
62f026e
Add a Sanity.io plugin
andrewmumblebee Jun 17, 2026
5d1b417
index sanity datasets using dependent imports
andrewmumblebee Jun 18, 2026
f171092
Use scoped dataset datastreams
andrewmumblebee Jun 18, 2026
73234fe
Add dataset stats dataStream
andrewmumblebee Jun 18, 2026
a2c35e7
Update Sanity data stream tags
andrewmumblebee Jun 24, 2026
cc6b60b
Sanity plugin cleanup
andrewmumblebee Jul 1, 2026
ee7c40a
Reduce dataStreams down to useful ones
andrewmumblebee Jul 15, 2026
84b9f9a
Show recently updated documents in the GROQ tile
andrewmumblebee Jul 15, 2026
5344250
Show dataset limit usage on the Dataset dashboard
andrewmumblebee Jul 15, 2026
a3c49a9
Add an Overview dashboard summarising the org
andrewmumblebee Jul 15, 2026
8b341ad
Explain the missing token when content tiles fail
andrewmumblebee Jul 15, 2026
775897c
Index only projects with a configured token
andrewmumblebee Jul 15, 2026
f3e34cd
Show every project's token status on the Overview
andrewmumblebee Jul 15, 2026
5980e03
Keep description to one sentence
andrewmumblebee Jul 15, 2026
9c165a0
update readme
andrewmumblebee Jul 15, 2026
5b262e7
Escape project names in token error messages
andrewmumblebee Jul 15, 2026
4e3f674
Derive dataset uid and displayName in the script
andrewmumblebee Jul 15, 2026
1d60cc4
Parse project createdAt as a date
andrewmumblebee Jul 15, 2026
1c79d86
Describe the document type counts query
andrewmumblebee Jul 15, 2026
31d1a2d
Match dashboard timeframes to their tiles
andrewmumblebee Jul 15, 2026
b25f397
Give overview project tiles distinct titles
andrewmumblebee Jul 15, 2026
c1b60f1
Give each dashboard tile a unique GUID
andrewmumblebee Jul 15, 2026
42a15a8
Document correct admin token creation steps
andrewmumblebee Jul 15, 2026
0342043
Index members per project membership
andrewmumblebee Jul 15, 2026
f2fe474
Scope member roles to the imported project
andrewmumblebee Jul 15, 2026
056f59e
Load error handling scripts from script files
andrewmumblebee Jul 15, 2026
4745823
Remove error handling from Sanity
andrewmumblebee Aug 17, 2026
36d980b
Remove users from Sanity index
andrewmumblebee Aug 17, 2026
c697725
Update readme to match skill template for Sanity
andrewmumblebee Aug 17, 2026
5083023
Add sanity screenshots
andrewmumblebee Aug 17, 2026
65c7956
Update Sanity metadata to remove members object type
andrewmumblebee Aug 17, 2026
824e40d
update projects screenshot
andrewmumblebee Aug 17, 2026
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
13 changes: 13 additions & 0 deletions plugins/Sanity/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": {
"name": "listProjects"
},
"required": true,
"success": "Connected to the Sanity management API.",
"error": "Could not list projects. Check your Admin API token is valid and has access to your projects."
}
]
}
16 changes: 16 additions & 0 deletions plugins/Sanity/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "Project",
"sourceType": "Project",
"icon": "layer-group",
"singular": "Project",
"plural": "Projects"
},
{
"name": "Dataset",
"sourceType": "Dataset",
"icon": "layer-group",
"singular": "Dataset",
"plural": "Datasets"
}
]
45 changes: 45 additions & 0 deletions plugins/Sanity/v1/dataStreams/allProjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "allProjects",
"displayName": "All Projects",
"description": "Every project the admin token can see, flagging which have a content API token configured",
"tags": ["Project"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"paging": {
"mode": "none"
},
"expandInnerObjects": false,
"endpointPath": "projects",
"getArgs": [],
"headers": [],
"postRequestScript": "allProjects.js"
},
"metadata": [
{
"name": "displayName",
"shape": "string",
"displayName": "Name",
"role": "label"
},
{
"name": "tokenStatus",
"displayName": "Token Status",
"shape": [
"state",
{
"map": {
"success": ["configured"],
"error": ["missing"]
}
}
]
},
{
"name": "id",
"shape": "string",
"displayName": "Project ID"
}
],
"timeframes": false
}
65 changes: 65 additions & 0 deletions plugins/Sanity/v1/dataStreams/customQuery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "customQuery",
"displayName": "Custom GROQ Query",
"description": "Run an arbitrary GROQ query against a dataset",
"tags": ["Documents"],
"baseDataSourceName": "httpRequestScopedSingle",
"matches": {
"sourceType": {
"type": "equals",
"value": "Dataset"
}
},
"providesPluginDiagnostics": true,
"config": {
"baseUrl": "https://{{object.projectId}}.api.sanity.io/{{dataSource.apiVersion}}/",
"httpMethod": "get",
"paging": {
"mode": "none"
},
"expandInnerObjects": true,
"endpointPath": "data/query/{{object.datasetId}}",
"pathToData": "result",
"getArgs": [
{
"key": "query",
"value": "{{query}}"
},
{
"key": "perspective",
"value": "{{perspective}}"
}
],
"headers": [
{
"key": "Authorization",
"value": "Bearer {{ ((dataSource.projects || []).find(p => p.key === object.projectId) || {}).value }}"
}
]
},
"ui": [
{
"type": "code",
"name": "query",
"language": "groq",
"label": "GROQ query",
"defaultValue": "*[ !(_id in path(\"_.**\")) ] | order(_updatedAt desc) [0...20] {_id, _type, _updatedAt}",
"validation": { "required": true },
"help": "See [GROQ query cheat sheet](https://www.sanity.io/docs/content-lake/query-cheat-sheet) for patterns"
},
{
"type": "switch",
"name": "perspective",
"label": "Perspective",
"defaultValue": "published",
"options": [
{ "value": "published", "label": "Published" },
{ "value": "drafts", "label": "Drafts" },
{ "value": "raw", "label": "Raw" }
]
}
],
"metadata": [{ "pattern": ".*" }],
"timeframes": false,
"manualConfigApply": true
}
93 changes: 93 additions & 0 deletions plugins/Sanity/v1/dataStreams/datasetStats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"name": "datasetStats",
"displayName": "Dataset Stats",
"description": "Get stats on how close to usage limits this dataset is",
"tags": ["Analytics"],
"baseDataSourceName": "httpRequestScopedSingle",
"matches": {
"sourceType": {
"type": "equals",
"value": "Dataset"
}
},
"config": {
"baseUrl": "https://{{object.projectId}}.api.sanity.io/v1/",
"httpMethod": "get",
"paging": {
"mode": "none"
},
"endpointPath": "data/stats/{{object.datasetId}}",
"getArgs": [],
"headers": [
{
"key": "Authorization",
"value": "Bearer {{ ((dataSource.projects || []).find(p => p.key === object.projectId) || {}).value }}"
}
],
"expandInnerObjects": true,
"postRequestScript": "datasetStats.js"
},
"metadata": [
{
"name": "dataset",
"displayName": "Dataset",
"shape": "string",
"role": "label"
},
{
"name": "documentsPctOfLimit",
"displayName": "Documents (% of limit)",
"shape": "percent",
"role": "value"
},
{
"name": "fieldsPctOfLimit",
"displayName": "Fields (% of limit)",
"shape": "percent"
},
{
"name": "jsonSizePctOfLimit",
"displayName": "JSON Size (% of limit)",
"shape": "percent"
},
{
"name": "releasesPctOfLimit",
"displayName": "Releases (% of limit)",
"shape": "percent"
},
{
"name": "documents.count.value",
"displayName": "Documents",
"shape": "number"
},
{
"name": "documents.count.limit",
"displayName": "Document Limit",
"shape": "number"
},
{
"name": "fields.count.value",
"displayName": "Fields",
"shape": "number"
},
{
"name": "fields.count.limit",
"displayName": "Field Limit",
"shape": "number"
},
{
"name": "documents.jsonSizeSum.value",
"displayName": "JSON Size",
"shape": "bytes"
},
{
"name": "documents.jsonSizeSum.limit",
"displayName": "JSON Size Limit",
"shape": "bytes"
},
{
"pattern": ".*"
}
],
"timeframes": false
}
80 changes: 80 additions & 0 deletions plugins/Sanity/v1/dataStreams/datasets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "datasets",
"displayName": "Datasets",
"description": "Lists the datasets in a project, with their access-control mode",
"tags": ["Datasets"],
"baseDataSourceName": "httpRequestScopedSingle",
"matches": {
"sourceType": {
"type": "equals",
"value": "Project"
}
},
"config": {
"httpMethod": "get",
"errorHandling": {
"type": "script",
"script": "errorHandling/datasets.js"
},
Comment thread
andrewmumblebee marked this conversation as resolved.
"paging": {
"mode": "none"
},
"expandInnerObjects": true,
"endpointPath": "projects/{{object.rawId}}/datasets",
"getArgs": [],
"postRequestScript": "datasets.js",
"headers": [
{
"key": "Authorization",
"value": "Bearer {{ ((dataSource.projects || []).find(p => p.key === object.rawId) || {}).value }}"
}
]
},
"metadata": [
{
"name": "projectId",
"displayName": "Project ID",
"shape": "string",
"visible": false
},
{
"name": "datasetId",
"shape": "string",
"displayName": "Dataset",
"role": "label"
},
{
"name": "aclMode",
"shape": "string",
"displayName": "Access mode"
},
{
"name": "createdAt",
"shape": "date",
"displayName": "Created At"
},
{
"name": "createdByUserId",
"shape": "string",
"displayName": "Created By User Id"
},
{
"name": "projectName",
"displayName": "Project Name",
"shape": "string"
},
{
"name": "uid",
"displayName": "uid",
"shape": "string",
"visible": false
},
{
"name": "displayName",
"displayName": "Display Name",
"shape": "string",
"visible": false
Comment thread
andrewmumblebee marked this conversation as resolved.
}
],
"timeframes": false
}
52 changes: 52 additions & 0 deletions plugins/Sanity/v1/dataStreams/listProjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "listProjects",
"displayName": "Projects",
"description": "Lists the projects that have a content API token configured",
"tags": ["Project"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"paging": {
"mode": "none"
},
"expandInnerObjects": false,
"endpointPath": "projects",
"getArgs": [],
"headers": [],
"postRequestScript": "listProjects.js"
},
"metadata": [
{
"name": "id",
"shape": "string",
"displayName": "Project ID"
},
{
"name": "displayName",
"shape": "string",
"displayName": "Name"
},
{
"name": "organizationId",
"shape": "string",
"displayName": "Organization ID"
},
{
"name": "studioHost",
"shape": "string",
"displayName": "Studio host"
},
{
"name": "createdAt",
"shape": "date",
"displayName": "Created"
Comment thread
andrewmumblebee marked this conversation as resolved.
},
{
"pattern": ".*"
}
],
"timeframes": false,
"visibility": {
"type": "hidden"
}
}
Loading
Loading