import{r as l,p as c,q as h,w as t,z as s,t as o,R as e}from"./vendor.8ed37afc.js";const d={class:"markdown-body"},_={class:"two-up"},p={class:"left"},u=e("Revisions are individual changes to items made. Directus keeps track of changes made, so you\u2019re able to revert to a previous state at will. "),v=e("Learn more about Revisions"),m=e("."),f=s("div",{class:"right"},[s("p",null,[s("div",{class:"table-of-contents"},[s("ul",null,[s("li",null,[s("a",{href:"#the-revision-object"},"The Revision Object")]),s("li",null,[s("a",{href:"#list-revisions"},"List revisions")]),s("li",null,[s("a",{href:"#retrieve-a-revision"},"Retrieve a revision")])])])])],-1),g=s("hr",null,null,-1),y=s("h2",{id:"the-revision-object"},[e("The Revision Object "),s("a",{class:"header-anchor",href:"#the-revision-object"},"#")],-1),j={class:"two-up"},b={class:"left"},q={class:"definitions"},x=s("p",null,[s("code",null,"id"),e(),s("strong",null,"integer"),s("br"),e(" Primary key of the revision.")],-1),w=s("code",null,"activity",-1),R=e(),k=s("strong",null,"many-to-one",-1),E=s("br",null,null,-1),T=e(" Related activity record. Many-to-one to "),P=e("activity"),S=e("."),L=s("p",null,[s("code",null,"collection"),e(),s("strong",null,"string"),s("br"),e(" Collection in which this revision happened.")],-1),C=s("p",null,[s("code",null,"item"),e(),s("strong",null,"string"),s("br"),e(" Primary key of the item that was changed.")],-1),D=s("p",null,[s("code",null,"data"),e(),s("strong",null,"object"),s("br"),e(" Snapshot of the top-level item data.")],-1),Q=s("p",null,[s("code",null,"delta"),e(),s("strong",null,"object"),s("br"),e(" Snapshot of the changes made in this revision.")],-1),A=s("p",null,[s("code",null,"parent"),e(),s("strong",null,"many-to-one"),s("br"),e(" Parent revision that triggered this revision. Many-to-one to revisions (recursive).")],-1),G=s("div",{class:"right"},[s("pre",null,[s("code",{class:"language-json"},[e(`{
	`),s("span",{class:"hljs-attr"},'"id"'),e(": "),s("span",{class:"hljs-number"},"368"),e(`,
	`),s("span",{class:"hljs-attr"},'"activity"'),e(": "),s("span",{class:"hljs-number"},"438"),e(`,
	`),s("span",{class:"hljs-attr"},'"collection"'),e(": "),s("span",{class:"hljs-string"},'"articles"'),e(`,
	`),s("span",{class:"hljs-attr"},'"item"'),e(": "),s("span",{class:"hljs-string"},'"1"'),e(`,
	`),s("span",{class:"hljs-attr"},'"data"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"title"'),e(": "),s("span",{class:"hljs-string"},'"Hello World"'),e(`
	},
	`),s("span",{class:"hljs-attr"},'"delta"'),e(`: {
		`),s("span",{class:"hljs-attr"},'"title"'),e(": "),s("span",{class:"hljs-string"},'"Hello from the Docs!"'),e(`
	},
	`),s("span",{class:"hljs-attr"},'"parent"'),e(": "),s("span",{class:"hljs-literal"},"null"),e(`
}
`)])])],-1),H=s("hr",null,null,-1),I=s("h2",{id:"list-revisions"},[e("List revisions "),s("a",{class:"header-anchor",href:"#list-revisions"},"#")],-1),O=s("p",null,"List all revisions that exist in Directus.",-1),B={class:"two-up"},N={class:"left"},V=s("div",{class:"tip hint"},[s("div",{class:"hint-title"},"Permissions"),s("p",null,"The data returned in this endpoint will be filtered based on the user\u2019s permissions. For example, revisions that apply to a collection that the current user doesn\u2019t have access to are stripped out.")],-1),W=s("h3",{id:"query-parameters"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters"},"#")],-1),M=e("Supports all "),z=e("global query parameters"),F=e("."),J=s("h3",{id:"returns"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns"},"#")],-1),K=e("An array of up to "),U=e("limit"),X=e(),Y=s("a",{href:"#the-revision-object"},"revision objects",-1),Z=e(". If no items are available, data will be an empty array."),$={class:"right"},ss=s("h3",{id:"rest-api"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api"},"#")],-1),es=s("pre",null,[s("code",null,`GET /revisions
SEARCH /revisions
`)],-1),ts=e("Learn more about SEARCH ->"),ns=s("h3",{id:"graphql"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql"},"#")],-1),os=s("pre",null,[s("code",null,`POST /graphql/system
`)],-1),as=s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Query"),e(` {
	revisions: [directus_revisions]
}
`)])],-1),ls=s("h5",{id:"examples"},[e("Examples "),s("a",{class:"header-anchor",href:"#examples"},"#")],-1),rs=s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"query"),e(` {
	revisions {
		id
		data
		delta
	}
}
`)])],-1),is=s("hr",null,null,-1),cs=s("h2",{id:"retrieve-a-revision"},[e("Retrieve a revision "),s("a",{class:"header-anchor",href:"#retrieve-a-revision"},"#")],-1),hs=s("p",null,"List an existing revision by primary key.",-1),ds={class:"two-up"},_s={class:"left"},ps=s("h3",{id:"query-parameters-2"},[e("Query Parameters "),s("a",{class:"header-anchor",href:"#query-parameters-2"},"#")],-1),us=e("Supports all "),vs=e("global query parameters"),ms=e("."),fs=s("h3",{id:"returns-2"},[e("Returns "),s("a",{class:"header-anchor",href:"#returns-2"},"#")],-1),gs=s("p",null,[e("Returns the requested "),s("a",{href:"#the-revision-object"},"revision object"),e(".")],-1),ys=s("div",{class:"right"},[s("h3",{id:"rest-api-2"},[e("REST API "),s("a",{class:"header-anchor",href:"#rest-api-2"},"#")]),s("pre",null,[s("code",null,`GET /revisions/:id
`)]),s("h5",{id:"example"},[e("Example "),s("a",{class:"header-anchor",href:"#example"},"#")]),s("pre",null,[s("code",null,`GET /revisions/322
`)]),s("h3",{id:"graphql-2"},[e("GraphQL "),s("a",{class:"header-anchor",href:"#graphql-2"},"#")]),s("pre",null,[s("code",null,`POST /graphql/system
`)]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"type"),s("span",{class:"hljs-type"}," Query"),e(` {
	revisions_by_id(id:`),s("span",{class:"hljs-literal"}," ID"),e(`!): directus_revisions
}
`)])]),s("h5",{id:"example-2"},[e("Example "),s("a",{class:"header-anchor",href:"#example-2"},"#")]),s("pre",null,[s("code",{class:"language-graphql"},[s("span",{class:"hljs-keyword"},"query"),e(` {
	revisions_by_id(id: `),s("span",{class:"hljs-number"},"322"),e(`) {
		id
		data
		delta
	}
}
`)])])],-1),ws={setup(js,{expose:r}){const a={title:"Revisions",modularExtension:!1,pageClass:"page-reference"};return r({frontmatter:a}),(bs,qs)=>{const n=l("router-link"),i=l("DocsWrapper");return c(),h(i,{frontmatter:a},{default:t(()=>[s("div",d,[s("div",_,[s("div",p,[s("blockquote",null,[s("p",null,[u,o(n,{to:"/docs/getting-started/glossary/#revisions"},{default:t(()=>[v]),_:1}),m])])]),f]),g,y,s("div",j,[s("div",b,[s("div",q,[x,s("p",null,[w,R,k,E,T,o(n,{to:"/docs/reference/system/activity/"},{default:t(()=>[P]),_:1}),S]),L,C,D,Q,A])]),G]),H,I,O,s("div",B,[s("div",N,[V,W,s("p",null,[M,o(n,{to:"/docs/reference/query"},{default:t(()=>[z]),_:1}),F]),J,s("p",null,[K,o(n,{to:"/docs/reference/query/#limit"},{default:t(()=>[U]),_:1}),X,Y,Z])]),s("div",$,[ss,es,s("p",null,[o(n,{to:"/docs/reference/introduction/#search-http-method"},{default:t(()=>[ts]),_:1})]),ns,os,as,ls,rs])]),is,cs,hs,s("div",ds,[s("div",_s,[ps,s("p",null,[us,o(n,{to:"/docs/reference/query"},{default:t(()=>[vs]),_:1}),ms]),fs,gs]),ys])])]),_:1})}}};export{ws as default};
