@directus/app 9.4.1 → 9.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/af-ZA.8e0f0a18.js +1 -0
- package/dist/assets/{bg-BG.85fd772c.js → bg-BG.323e646f.js} +1 -1
- package/dist/assets/{config-options.e53341a9.js → config-options.eb4166d8.js} +14 -14
- package/dist/assets/index.1f5fd684.js +26 -0
- package/dist/assets/{index.29d6735e.entry.js → index.22c0e154.entry.js} +45 -45
- package/dist/assets/index.2c36cae9.css +1 -0
- package/dist/assets/index.ca954ed3.css +1 -0
- package/dist/assets/{input-rich-text-html.94180d78.js → input-rich-text-html.a709a214.js} +1 -1
- package/dist/assets/installation.97b1184f.js +1 -0
- package/dist/assets/it-IT.b3999351.js +1 -0
- package/dist/assets/pl-PL.853296be.js +1 -0
- package/dist/assets/users.7cef5043.js +252 -0
- package/dist/index.html +2 -2
- package/package.json +6 -6
- package/dist/assets/af-ZA.26b091a9.js +0 -1
- package/dist/assets/index.2f08ad47.js +0 -26
- package/dist/assets/index.56cdd291.css +0 -1
- package/dist/assets/index.c01059b2.css +0 -1
- package/dist/assets/installation.751b61a8.js +0 -1
- package/dist/assets/it-IT.87ffbbaf.js +0 -1
- package/dist/assets/pl-PL.8828f091.js +0 -1
- package/dist/assets/users.56012dcd.js +0 -237
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import{r,p as h,q as i,w as a,B as e,t as l,P as s}from"./vendor.275c9c53.js";const d={class:"markdown-body"},u={class:"two-up"},p={class:"left"},_=s("Directus Users are the individual accounts that let you authenticate into the API and App. Each user belongs to a Role which defines its granular Permissions. "),g=s("Learn more about Users"),m=s("."),f=e("div",{class:"right"},[e("p",null,[e("div",{class:"table-of-contents"},[e("ul",null,[e("li",null,[e("a",{href:"#the-user-object"},"The User Object")]),e("li",null,[e("a",{href:"#list-users"},"List Users")]),e("li",null,[e("a",{href:"#retrieve-a-user"},"Retrieve a User")]),e("li",null,[e("a",{href:"#retrieve-the-current-user"},"Retrieve the Current User")]),e("li",null,[e("a",{href:"#update-the-current-user"},"Update the Current User")]),e("li",null,[e("a",{href:"#create-a-user"},"Create a User")]),e("li",null,[e("a",{href:"#create-multiple-users"},"Create Multiple Users")]),e("li",null,[e("a",{href:"#update-a-user"},"Update a User")]),e("li",null,[e("a",{href:"#update-multiple-users"},"Update Multiple Users")]),e("li",null,[e("a",{href:"#delete-a-user"},"Delete a User")]),e("li",null,[e("a",{href:"#delete-multiple-users"},"Delete Multiple Users")]),e("li",null,[e("a",{href:"#invite-a-new-user"},"Invite a new User")]),e("li",null,[e("a",{href:"#accept-user-invite"},"Accept User Invite")]),e("li",null,[e("a",{href:"#generate-two-factor-authentication-secret"},"Generate Two-Factor Authentication Secret")]),e("li",null,[e("a",{href:"#enable-two-factor-authentication"},"Enable Two-Factor Authentication")]),e("li",null,[e("a",{href:"#disable-two-factor-authentication"},"Disable Two-Factor Authentication")])])])])],-1),j=e("hr",null,null,-1),y=e("h2",{id:"the-user-object"},[s("The User Object "),e("a",{class:"header-anchor",href:"#the-user-object"},"#")],-1),q={class:"two-up"},b={class:"left"},v={class:"definitions"},w=e("p",null,[e("code",null,"id"),s(),e("strong",null,"uuid"),e("br"),s(" Primary key of the user.")],-1),x=e("p",null,[e("code",null,"first_name"),s(),e("strong",null,"string"),e("br"),s(" First name of the user.")],-1),T=e("p",null,[e("code",null,"last_name"),s(),e("strong",null,"string"),e("br"),s(" Last name of the user.")],-1),E=e("p",null,[e("code",null,"email"),s(),e("strong",null,"string"),e("br"),s(" Email address of the user.")],-1),R=e("p",null,[e("code",null,"password"),s(),e("strong",null,"hash"),e("br"),s(" Password of the user.")],-1),S=e("p",null,[e("code",null,"location"),s(),e("strong",null,"string"),e("br"),s(" Location of the user.")],-1),P=e("p",null,[e("code",null,"title"),s(),e("strong",null,"string"),e("br"),s(" Title of the user.")],-1),k=e("p",null,[e("code",null,"description"),s(),e("strong",null,"string"),e("br"),s(" Description of the user.")],-1),A=e("p",null,[e("code",null,"tags"),s(),e("strong",null,"csv"),e("br"),s(" Tags for the user.")],-1),U=e("code",null,"avatar",-1),O=s(),L=e("strong",null,"many-to-one",-1),C=e("br",null,null,-1),I=s(" Avatar file. Many-to-one to "),Q=s("files"),D=s("."),G=e("p",null,[e("code",null,"language"),s(),e("strong",null,"string"),e("br"),s(" Language the Admin App is rendered in. See "),e("a",{href:"https://locales.directus.io",target:"_blank",rel:"noopener noreferrer"},"our Crowdin page"),s(" for all available languages and translations.")],-1),B=e("p",null,[e("code",null,"theme"),s(),e("strong",null,"string"),e("br"),s(" One of "),e("code",null,"auto"),s(", "),e("code",null,"light"),s(", "),e("code",null,"dark"),s(".")],-1),M=e("p",null,[e("code",null,"tfa_secret"),s(),e("strong",null,"string"),e("br"),s(" When TFA is enabled, this holds the secret key for it.")],-1),F=e("p",null,[e("code",null,"email_notifications"),s(),e("strong",null,"boolean"),e("br"),s(" When this is enabled, the user will receive emails for notifications.")],-1),H=e("div",{class:"right"},[e("pre",null,[e("code",{class:"language-json"},[s(`{
|
|
2
|
+
`),e("span",{class:"hljs-attr"},'"id"'),s(": "),e("span",{class:"hljs-string"},'"0bc7b36a-9ba9-4ce0-83f0-0a526f354e07"'),s(`,
|
|
3
|
+
`),e("span",{class:"hljs-attr"},'"first_name"'),s(": "),e("span",{class:"hljs-string"},'"Admin"'),s(`,
|
|
4
|
+
`),e("span",{class:"hljs-attr"},'"last_name"'),s(": "),e("span",{class:"hljs-string"},'"User"'),s(`,
|
|
5
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"admin@example.com"'),s(`,
|
|
6
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"**********"'),s(`,
|
|
7
|
+
`),e("span",{class:"hljs-attr"},'"location"'),s(": "),e("span",{class:"hljs-string"},'"New York City"'),s(`,
|
|
8
|
+
`),e("span",{class:"hljs-attr"},'"title"'),s(": "),e("span",{class:"hljs-string"},'"CTO"'),s(`,
|
|
9
|
+
`),e("span",{class:"hljs-attr"},'"description"'),s(": "),e("span",{class:"hljs-literal"},"null"),s(`,
|
|
10
|
+
`),e("span",{class:"hljs-attr"},'"tags"'),s(": "),e("span",{class:"hljs-literal"},"null"),s(`,
|
|
11
|
+
`),e("span",{class:"hljs-attr"},'"avatar"'),s(": "),e("span",{class:"hljs-literal"},"null"),s(`,
|
|
12
|
+
`),e("span",{class:"hljs-attr"},'"language"'),s(": "),e("span",{class:"hljs-string"},'"en-US"'),s(`,
|
|
13
|
+
`),e("span",{class:"hljs-attr"},'"theme"'),s(": "),e("span",{class:"hljs-string"},'"auto"'),s(`,
|
|
14
|
+
`),e("span",{class:"hljs-attr"},'"tfa_secret"'),s(": "),e("span",{class:"hljs-literal"},"null"),s(`,
|
|
15
|
+
`),e("span",{class:"hljs-attr"},'"status"'),s(": "),e("span",{class:"hljs-string"},'"active"'),s(`,
|
|
16
|
+
`),e("span",{class:"hljs-attr"},'"role"'),s(": "),e("span",{class:"hljs-string"},'"653925a9-970e-487a-bfc0-ab6c96affcdc"'),s(`,
|
|
17
|
+
`),e("span",{class:"hljs-attr"},'"token"'),s(": "),e("span",{class:"hljs-literal"},"null"),s(`,
|
|
18
|
+
`),e("span",{class:"hljs-attr"},'"last_access"'),s(": "),e("span",{class:"hljs-string"},'"2021-02-05T10:18:13-05:00"'),s(`,
|
|
19
|
+
`),e("span",{class:"hljs-attr"},'"last_page"'),s(": "),e("span",{class:"hljs-string"},'"/settings/roles/653925a9-970e-487a-bfc0-ab6c96affcdc"'),s(`
|
|
20
|
+
}
|
|
21
|
+
`)])])],-1),N=e("hr",null,null,-1),W=e("h2",{id:"list-users"},[s("List Users "),e("a",{class:"header-anchor",href:"#list-users"},"#")],-1),V=e("p",null,"List all users that exist in Directus.",-1),Y={class:"two-up"},z={class:"left"},J=e("h3",{id:"query-parameters"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters"},"#")],-1),K=s("Supports all "),X=s("global query parameters"),Z=s("."),$=e("h3",{id:"returns"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns"},"#")],-1),ee=s("An array of up to "),se=s("limit"),ae=s(),te=e("a",{href:"#the-user-object"},"user objects",-1),le=s(". If no items are available, data will be an empty array."),ne={class:"right"},re=e("h3",{id:"rest-api"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api"},"#")],-1),ce=e("pre",null,[e("code",null,`GET /users
|
|
22
|
+
SEARCH /users
|
|
23
|
+
`)],-1),oe=s("Learn more about SEARCH ->"),he=e("h3",{id:"graphql"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql"},"#")],-1),ie=e("pre",null,[e("code",null,`POST /graphql/system
|
|
24
|
+
`)],-1),de=e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Query"),s(` {
|
|
25
|
+
users: [directus_users]
|
|
26
|
+
}
|
|
27
|
+
`)])],-1),ue=e("h5",{id:"example"},[s("Example "),e("a",{class:"header-anchor",href:"#example"},"#")],-1),pe=e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"query"),s(` {
|
|
28
|
+
users {
|
|
29
|
+
first_name
|
|
30
|
+
last_name
|
|
31
|
+
email
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`)])],-1),_e=e("hr",null,null,-1),ge=e("h2",{id:"retrieve-a-user"},[s("Retrieve a User "),e("a",{class:"header-anchor",href:"#retrieve-a-user"},"#")],-1),me=e("p",null,"List an existing user by primary key.",-1),fe={class:"two-up"},je={class:"left"},ye=e("h3",{id:"query-parameters-2"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-2"},"#")],-1),qe=s("Supports all "),be=s("global query parameters"),ve=s("."),we=e("h3",{id:"returns-2"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-2"},"#")],-1),xe=e("p",null,[s("Returns the requested "),e("a",{href:"#the-user-object"},"user object"),s(".")],-1),Te=e("div",{class:"right"},[e("h3",{id:"rest-api-2"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-2"},"#")]),e("pre",null,[e("code",null,`GET /users/:id
|
|
35
|
+
`)]),e("h5",{id:"example-2"},[s("Example "),e("a",{class:"header-anchor",href:"#example-2"},"#")]),e("pre",null,[e("code",null,`GET /users/72a1ce24-4748-47de-a05f-ce9af3033727
|
|
36
|
+
`)]),e("h3",{id:"graphql-2"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-2"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
37
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Query"),s(` {
|
|
38
|
+
users_by_id(id:`),e("span",{class:"hljs-literal"}," ID"),s(`!): directus_users
|
|
39
|
+
}
|
|
40
|
+
`)])]),e("h5",{id:"example-3"},[s("Example "),e("a",{class:"header-anchor",href:"#example-3"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"query"),s(` {
|
|
41
|
+
users_by_id(id: `),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(`) {
|
|
42
|
+
first_name
|
|
43
|
+
last_name
|
|
44
|
+
email
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`)])])],-1),Ee=e("hr",null,null,-1),Re=e("h2",{id:"retrieve-the-current-user"},[s("Retrieve the Current User "),e("a",{class:"header-anchor",href:"#retrieve-the-current-user"},"#")],-1),Se=e("p",null,"Retrieve the currently authenticated user.",-1),Pe={class:"two-up"},ke={class:"left"},Ae=e("h3",{id:"query-parameters-3"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-3"},"#")],-1),Ue=s("Supports all "),Oe=s("global query parameters"),Le=s("."),Ce=e("h3",{id:"returns-3"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-3"},"#")],-1),Ie=e("p",null,[s("Returns the "),e("a",{href:"#the-user-object"},"user object"),s(" for the currently authenticated user.")],-1),Qe=e("div",{class:"right"},[e("h3",{id:"rest-api-3"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-3"},"#")]),e("pre",null,[e("code",null,`GET /users/me
|
|
48
|
+
`)]),e("h3",{id:"graphql-3"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-3"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
49
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Query"),s(` {
|
|
50
|
+
users_me: directus_users
|
|
51
|
+
}
|
|
52
|
+
`)])]),e("h5",{id:"example-4"},[s("Example "),e("a",{class:"header-anchor",href:"#example-4"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"query"),s(` {
|
|
53
|
+
users_me {
|
|
54
|
+
email
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`)])])],-1),De=e("hr",null,null,-1),Ge=e("h2",{id:"update-the-current-user"},[s("Update the Current User "),e("a",{class:"header-anchor",href:"#update-the-current-user"},"#")],-1),Be=e("p",null,"Update the authenticated user.",-1),Me={class:"two-up"},Fe={class:"left"},He=e("h3",{id:"query-parameters-4"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-4"},"#")],-1),Ne=s("Supports all "),We=s("global query parameters"),Ve=s("."),Ye=e("h3",{id:"returns-4"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-4"},"#")],-1),ze=e("p",null,[s("Returns the updated "),e("a",{href:"#the-user-object"},"user object"),s(" for the authenticated user.")],-1),Je=e("div",{class:"right"},[e("h3",{id:"rest-api-4"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-4"},"#")]),e("pre",null,[e("code",null,`PATCH /users/me
|
|
58
|
+
`)]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// PATCH /users/me"),s(`
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"new.email@example.com"'),s(`
|
|
62
|
+
}
|
|
63
|
+
`)])]),e("h3",{id:"graphql-4"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-4"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
64
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
65
|
+
update_users_me(data: update_directus_users_input!): directus_users
|
|
66
|
+
}
|
|
67
|
+
`)])]),e("h5",{id:"example-5"},[s("Example "),e("a",{class:"header-anchor",href:"#example-5"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
68
|
+
update_users_me(data: { email: `),e("span",{class:"hljs-string"},'"new.email@example.com"'),s(` }) {
|
|
69
|
+
email
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`)])])],-1),Ke=e("hr",null,null,-1),Xe=e("h2",{id:"create-a-user"},[s("Create a User "),e("a",{class:"header-anchor",href:"#create-a-user"},"#")],-1),Ze=e("p",null,"Create a new user",-1),$e={class:"two-up"},es={class:"left"},ss=e("h3",{id:"query-parameters-5"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-5"},"#")],-1),as=s("Supports all "),ts=s("global query parameters"),ls=s("."),ns=e("h3",{id:"request-body"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body"},"#")],-1),rs=e("p",null,[s("A partial "),e("a",{href:"#the-user-object"},"user object"),s(".")],-1),cs=e("p",null,[e("code",null,"email"),s(" and "),e("code",null,"password"),s(" are required.")],-1),os=e("h3",{id:"returns-5"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-5"},"#")],-1),hs=e("p",null,[s("Returns the "),e("a",{href:"#the-user-object"},"user object"),s(" for the created user.")],-1),is=e("div",{class:"right"},[e("h3",{id:"rest-api-5"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-5"},"#")]),e("pre",null,[e("code",null,`POST /users
|
|
73
|
+
`)]),e("h5",{id:"example-6"},[s("Example "),e("a",{class:"header-anchor",href:"#example-6"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users"),s(`
|
|
74
|
+
|
|
75
|
+
{
|
|
76
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"another@example.com"'),s(`,
|
|
77
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`,
|
|
78
|
+
`),e("span",{class:"hljs-attr"},'"role"'),s(": "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`
|
|
79
|
+
}
|
|
80
|
+
`)])]),e("h3",{id:"graphql-5"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-5"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
81
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
82
|
+
create_users_item(data: create_directus_users_input!): directus_users
|
|
83
|
+
}
|
|
84
|
+
`)])]),e("h5",{id:"example-7"},[s("Example "),e("a",{class:"header-anchor",href:"#example-7"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
85
|
+
create_users_item(
|
|
86
|
+
data: { email: `),e("span",{class:"hljs-string"},'"another@example.com"'),s(", password: "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(", role: "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(` }
|
|
87
|
+
) {
|
|
88
|
+
email
|
|
89
|
+
role
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`)])])],-1),ds=e("hr",null,null,-1),us=e("h2",{id:"create-multiple-users"},[s("Create Multiple Users "),e("a",{class:"header-anchor",href:"#create-multiple-users"},"#")],-1),ps=e("p",null,"Create multiple new users",-1),_s={class:"two-up"},gs={class:"left"},ms=e("h3",{id:"query-parameters-6"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-6"},"#")],-1),fs=s("Supports all "),js=s("global query parameters"),ys=s("."),qs=e("h3",{id:"request-body-2"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-2"},"#")],-1),bs=e("p",null,[s("An array of partial "),e("a",{href:"#the-user-object"},"user objects"),s(".")],-1),vs=e("p",null,[e("code",null,"email"),s(" and "),e("code",null,"password"),s(" are required.")],-1),ws=e("h3",{id:"returns-6"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-6"},"#")],-1),xs=e("p",null,[s("Returns the "),e("a",{href:"#the-user-object"},"user objects"),s(" for the created users.")],-1),Ts=e("div",{class:"right"},[e("h3",{id:"rest-api-6"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-6"},"#")]),e("pre",null,[e("code",null,`POST /users
|
|
93
|
+
`)]),e("h5",{id:"example-8"},[s("Example "),e("a",{class:"header-anchor",href:"#example-8"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users"),s(`
|
|
94
|
+
|
|
95
|
+
[
|
|
96
|
+
{
|
|
97
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"admin@example.com"'),s(`,
|
|
98
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"p455w0rd"'),s(`,
|
|
99
|
+
`),e("span",{class:"hljs-attr"},'"role"'),s(": "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"another@example.com"'),s(`,
|
|
103
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`,
|
|
104
|
+
`),e("span",{class:"hljs-attr"},'"role"'),s(": "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
`)])]),e("h3",{id:"graphql-6"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-6"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
108
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
109
|
+
create_users_items(data: [create_directus_users_input!]!): [directus_users]
|
|
110
|
+
}
|
|
111
|
+
`)])]),e("h5",{id:"example-9"},[s("Example "),e("a",{class:"header-anchor",href:"#example-9"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
112
|
+
create_users_items(
|
|
113
|
+
data: [
|
|
114
|
+
{ email: `),e("span",{class:"hljs-string"},'"admin@example.com"'),s(", password: "),e("span",{class:"hljs-string"},'"p455w0rd"'),s(", role: "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(` }
|
|
115
|
+
{ email: `),e("span",{class:"hljs-string"},'"another@example.com"'),s(", password: "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(", role: "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(` }
|
|
116
|
+
]
|
|
117
|
+
) {
|
|
118
|
+
email
|
|
119
|
+
role
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`)])])],-1),Es=e("hr",null,null,-1),Rs=e("h2",{id:"update-a-user"},[s("Update a User "),e("a",{class:"header-anchor",href:"#update-a-user"},"#")],-1),Ss=e("p",null,"Update an existing user.",-1),Ps={class:"two-up"},ks={class:"left"},As=e("h3",{id:"query-parameters-7"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-7"},"#")],-1),Us=s("Supports all "),Os=s("global query parameters"),Ls=s("."),Cs=e("h3",{id:"request-body-3"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-3"},"#")],-1),Is=e("p",null,[s("A partial "),e("a",{href:"#the-user-object"},"user object"),s(".")],-1),Qs=e("h3",{id:"returns-7"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-7"},"#")],-1),Ds=e("p",null,[s("Returns the "),e("a",{href:"#the-user-object"},"user object"),s(" for the updated user.")],-1),Gs=e("div",{class:"right"},[e("h3",{id:"rest-api-7"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-7"},"#")]),e("pre",null,[e("code",null,`PATCH /users/:id
|
|
123
|
+
`)]),e("h5",{id:"example-10"},[s("Example "),e("a",{class:"header-anchor",href:"#example-10"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// PATCH /users/72a1ce24-4748-47de-a05f-ce9af3033727"),s(`
|
|
124
|
+
|
|
125
|
+
{
|
|
126
|
+
`),e("span",{class:"hljs-attr"},'"title"'),s(": "),e("span",{class:"hljs-string"},'"CTO"'),s(`
|
|
127
|
+
}
|
|
128
|
+
`)])]),e("h3",{id:"graphql-7"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-7"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
129
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
130
|
+
update_users_item(id:`),e("span",{class:"hljs-literal"}," ID"),s(`!, data: update_directus_users_input!): directus_users
|
|
131
|
+
}
|
|
132
|
+
`)])]),e("h5",{id:"example-11"},[s("Example "),e("a",{class:"header-anchor",href:"#example-11"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
133
|
+
update_users_item(id: `),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(", data: { title: "),e("span",{class:"hljs-string"},'"CTO"'),s(` }) {
|
|
134
|
+
first_name
|
|
135
|
+
last_name
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
`)])])],-1),Bs=e("hr",null,null,-1),Ms=e("h2",{id:"update-multiple-users"},[s("Update Multiple Users "),e("a",{class:"header-anchor",href:"#update-multiple-users"},"#")],-1),Fs=e("p",null,"Update multiple existing users.",-1),Hs={class:"two-up"},Ns={class:"left"},Ws=e("h3",{id:"query-parameters-8"},[s("Query Parameters "),e("a",{class:"header-anchor",href:"#query-parameters-8"},"#")],-1),Vs=s("Supports all "),Ys=s("global query parameters"),zs=s("."),Js=e("h3",{id:"request-body-4"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-4"},"#")],-1),Ks=e("div",{class:"definitions"},[e("p",null,[e("code",null,"keys"),s(),e("strong",null,"Required"),e("br"),s(" Array of primary keys of the users you\u2019d like to update.")]),e("p",null,[e("code",null,"data"),s(),e("strong",null,"Required"),e("br"),s(" Any of "),e("a",{href:"#the-user-object"},"the user object"),s("\u2019s properties.")])],-1),Xs=e("h3",{id:"returns-8"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-8"},"#")],-1),Zs=e("p",null,[s("Returns the "),e("a",{href:"#the-user-object"},"user objects"),s(" for the updated users.")],-1),$s=e("div",{class:"right"},[e("h3",{id:"rest-api-8"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-8"},"#")]),e("pre",null,[e("code",null,`PATCH /users
|
|
139
|
+
`)]),e("h5",{id:"example-12"},[s("Example "),e("a",{class:"header-anchor",href:"#example-12"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// PATCH /users"),s(`
|
|
140
|
+
|
|
141
|
+
{
|
|
142
|
+
`),e("span",{class:"hljs-attr"},'"keys"'),s(": ["),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(", "),e("span",{class:"hljs-string"},'"9c3d75a8-7a5f-41a4-be0a-1488fd974511"'),s(`],
|
|
143
|
+
`),e("span",{class:"hljs-attr"},'"data"'),s(`: {
|
|
144
|
+
`),e("span",{class:"hljs-attr"},'"title"'),s(": "),e("span",{class:"hljs-string"},'"CTO"'),s(`
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`)])]),e("h3",{id:"graphql-8"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-8"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
148
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
149
|
+
update_users_items(ids: `),e("span",{class:"hljs-literal"},"[ID"),s(`!]!, data: update_directus_users_input!): [directus_users]
|
|
150
|
+
}
|
|
151
|
+
`)])]),e("h5",{id:"example-13"},[s("Example "),e("a",{class:"header-anchor",href:"#example-13"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
152
|
+
update_users_items(
|
|
153
|
+
ids: [`),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(", "),e("span",{class:"hljs-string"},'"9c3d75a8-7a5f-41a4-be0a-1488fd974511"'),s(`]
|
|
154
|
+
data: { title: `),e("span",{class:"hljs-string"},'"CTO"'),s(` }
|
|
155
|
+
) {
|
|
156
|
+
first_name
|
|
157
|
+
last_name
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`)])])],-1),ea=e("hr",null,null,-1),sa=e("h2",{id:"delete-a-user"},[s("Delete a User "),e("a",{class:"header-anchor",href:"#delete-a-user"},"#")],-1),aa=e("p",null,"Delete an existing user.",-1),ta=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"returns-9"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-9"},"#")]),e("p",null,"Empty body.")]),e("div",{class:"right"},[e("h3",{id:"rest-api-9"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-9"},"#")]),e("pre",null,[e("code",null,`DELETE /users/:id
|
|
161
|
+
`)]),e("h5",{id:"example-14"},[s("Example "),e("a",{class:"header-anchor",href:"#example-14"},"#")]),e("pre",null,[e("code",null,`DELETE /users/72a1ce24-4748-47de-a05f-ce9af3033727
|
|
162
|
+
`)]),e("h3",{id:"graphql-9"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-9"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
163
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
164
|
+
delete_users_item(id:`),e("span",{class:"hljs-literal"}," ID"),s(`!): delete_one
|
|
165
|
+
}
|
|
166
|
+
`)])]),e("h5",{id:"example-15"},[s("Example "),e("a",{class:"header-anchor",href:"#example-15"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
167
|
+
delete_users_item(id: `),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(`) {
|
|
168
|
+
id
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`)])])])],-1),la=e("hr",null,null,-1),na=e("h2",{id:"delete-multiple-users"},[s("Delete Multiple Users "),e("a",{class:"header-anchor",href:"#delete-multiple-users"},"#")],-1),ra=e("p",null,"Delete multiple existing users.",-1),ca=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"request-body-5"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-5"},"#")]),e("p",null,"An array of user primary keys"),e("h3",{id:"returns-10"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-10"},"#")]),e("p",null,"Empty body.")]),e("div",{class:"right"},[e("h3",{id:"rest-api-10"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-10"},"#")]),e("pre",null,[e("code",null,`DELETE /users
|
|
172
|
+
`)]),e("h5",{id:"example-16"},[s("Example "),e("a",{class:"header-anchor",href:"#example-16"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// Request"),s(`
|
|
173
|
+
[`),e("span",{class:"hljs-string"},'"653925a9-970e-487a-bfc0-ab6c96affcdc"'),s(", "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`]
|
|
174
|
+
`)])]),e("h3",{id:"graphql-10"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-10"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
175
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
176
|
+
delete_users_items(ids: `),e("span",{class:"hljs-literal"},"[ID"),s(`!]!): delete_many
|
|
177
|
+
}
|
|
178
|
+
`)])]),e("h5",{id:"example-17"},[s("Example "),e("a",{class:"header-anchor",href:"#example-17"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
179
|
+
delete_users_items(ids: [`),e("span",{class:"hljs-string"},'"72a1ce24-4748-47de-a05f-ce9af3033727"'),s(", "),e("span",{class:"hljs-string"},'"9c3d75a8-7a5f-41a4-be0a-1488fd974511"'),s(`]) {
|
|
180
|
+
ids
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
`)])])])],-1),oa=e("hr",null,null,-1),ha=e("h2",{id:"invite-a-new-user"},[s("Invite a new User "),e("a",{class:"header-anchor",href:"#invite-a-new-user"},"#")],-1),ia=e("p",null,"Invite a new user by email.",-1),da={class:"two-up"},ua={class:"left"},pa=e("h3",{id:"request-body-6"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-6"},"#")],-1),_a={class:"definitions"},ga=e("p",null,[e("code",null,"email"),s(),e("strong",null,"Required"),e("br"),s(" User email to invite.")],-1),ma=e("p",null,[e("code",null,"role"),s(),e("strong",null,"Required"),e("br"),s(" Role of the new user.")],-1),fa=e("code",null,"invite_url",-1),ja=e("br",null,null,-1),ya=s(" Provide a custom invite url which the link in the email will lead to. The invite token will be passed as a parameter."),qa=e("br",null,null,-1),ba=e("strong",null,"Note",-1),va=s(": You need to configure the "),wa=e("code",null,"USER_INVITE_URL_ALLOW_LIST",-1),xa=s(" environment variable"),Ta=s(" to enable this feature."),Ea=e("h3",{id:"returns-11"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-11"},"#")],-1),Ra=e("p",null,"Empty body.",-1),Sa=e("div",{class:"right"},[e("h3",{id:"rest-api-11"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-11"},"#")]),e("pre",null,[e("code",null,`POST /users/invite
|
|
184
|
+
`)]),e("h5",{id:"example-18"},[s("Example "),e("a",{class:"header-anchor",href:"#example-18"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users/invite"),s(`
|
|
185
|
+
|
|
186
|
+
{
|
|
187
|
+
`),e("span",{class:"hljs-attr"},'"email"'),s(": "),e("span",{class:"hljs-string"},'"another@example.com"'),s(`,
|
|
188
|
+
`),e("span",{class:"hljs-attr"},'"role"'),s(": "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`
|
|
189
|
+
}
|
|
190
|
+
`)])]),e("h3",{id:"graphql-11"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-11"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
191
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
192
|
+
users_invite(email:`),e("span",{class:"hljs-type"}," String"),s("!, role:"),e("span",{class:"hljs-type"}," String"),s("!, invite_url:"),e("span",{class:"hljs-type"}," String"),s("):"),e("span",{class:"hljs-type"}," Boolean"),s(`
|
|
193
|
+
}
|
|
194
|
+
`)])]),e("h5",{id:"example-19"},[s("Example "),e("a",{class:"header-anchor",href:"#example-19"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
195
|
+
users_invite(email: `),e("span",{class:"hljs-string"},'"another@example.com"'),s(", role: "),e("span",{class:"hljs-string"},'"c86c2761-65d3-43c3-897f-6f74ad6a5bd7"'),s(`)
|
|
196
|
+
}
|
|
197
|
+
`)])])],-1),Pa=e("hr",null,null,-1),ka=e("h2",{id:"accept-user-invite"},[s("Accept User Invite "),e("a",{class:"header-anchor",href:"#accept-user-invite"},"#")],-1),Aa=e("p",null,[s("Accept your invite. The "),e("a",{href:"#invite-a-new-user"},"invite user endpoint"),s(" sends the email a link to the Admin App.")],-1),Ua=e("p",null,"This link includes a token, which is then used to activate the invited user.",-1),Oa=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"request-body-7"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-7"},"#")]),e("div",{class:"definitions"},[e("p",null,[e("code",null,"token"),s(),e("strong",null,"Required"),e("br"),s(" Accept invite token.")]),e("p",null,[e("code",null,"password"),s(),e("strong",null,"Required"),e("br"),s(" Password for the user.")])]),e("h3",{id:"returns-12"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-12"},"#")]),e("p",null,"Empty body.")]),e("div",{class:"right"},[e("h3",{id:"rest-api-12"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-12"},"#")]),e("pre",null,[e("code",null,`POST /users/invite/accept
|
|
198
|
+
`)]),e("h5",{id:"example-20"},[s("Example "),e("a",{class:"header-anchor",href:"#example-20"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users/invite/accept"),s(`
|
|
199
|
+
|
|
200
|
+
{
|
|
201
|
+
`),e("span",{class:"hljs-attr"},'"token"'),s(": "),e("span",{class:"hljs-string"},'"eyJh...KmUk"'),s(`,
|
|
202
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`
|
|
203
|
+
}
|
|
204
|
+
`)])]),e("h3",{id:"graphql-12"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-12"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
205
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
206
|
+
users_invite_accept(token:`),e("span",{class:"hljs-type"}," String"),s("!, password:"),e("span",{class:"hljs-type"}," String"),s("!):"),e("span",{class:"hljs-type"}," Boolean"),s(`
|
|
207
|
+
}
|
|
208
|
+
`)])]),e("h5",{id:"example-21"},[s("Example "),e("a",{class:"header-anchor",href:"#example-21"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
209
|
+
users_invite_accept(token: `),e("span",{class:"hljs-string"},'"eyJh...KmUk"'),s(", password: "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`)
|
|
210
|
+
}
|
|
211
|
+
`)])])])],-1),La=e("hr",null,null,-1),Ca=e("h2",{id:"generate-two-factor-authentication-secret"},[s("Generate Two-Factor Authentication Secret "),e("a",{class:"header-anchor",href:"#generate-two-factor-authentication-secret"},"#")],-1),Ia=e("p",null,"Generates a secret and returns the URL to be used in an authenticator app.",-1),Qa=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"request-body-8"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-8"},"#")]),e("div",{class:"definitions"},[e("p",null,[e("code",null,"password"),s(),e("strong",null,"Required"),e("br"),s(" The user\u2019s password.")])]),e("h3",{id:"returns-13"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-13"},"#")]),e("div",{class:"definitions"},[e("p",null,[e("code",null,"secret"),s(),e("strong",null,"string"),e("br"),s(" OTP secret to be saved in the authenticator app.")]),e("p",null,[e("code",null,"otpauth_url"),s(),e("strong",null,"string"),e("br"),e("code",null,"otpauth://"),s(" formatted URL. Can be rendered as QR code and used in most authenticator apps.")])])]),e("div",{class:"right"},[e("h3",{id:"rest-api-13"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-13"},"#")]),e("pre",null,[e("code",null,`POST /users/me/tfa/generate
|
|
212
|
+
`)]),e("h5",{id:"example-22"},[s("Example "),e("a",{class:"header-anchor",href:"#example-22"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users/me/tfa/generate"),s(`
|
|
213
|
+
{
|
|
214
|
+
`),e("span",{class:"hljs-attr"},'"password"'),s(": "),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`
|
|
215
|
+
}
|
|
216
|
+
`)])]),e("h3",{id:"graphql-13"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-13"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
217
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
218
|
+
users_me_tfa_generate(password:`),e("span",{class:"hljs-type"}," String"),s(`!): users_me_tfa_generate_data
|
|
219
|
+
}
|
|
220
|
+
`)])]),e("h5",{id:"example-23"},[s("Example "),e("a",{class:"header-anchor",href:"#example-23"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
221
|
+
users_me_tfa_generate(password: `),e("span",{class:"hljs-string"},'"d1r3ctu5"'),s(`) {
|
|
222
|
+
secret
|
|
223
|
+
otpauth_url
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
`)])])])],-1),Da=e("hr",null,null,-1),Ga=e("h2",{id:"enable-two-factor-authentication"},[s("Enable Two-Factor Authentication "),e("a",{class:"header-anchor",href:"#enable-two-factor-authentication"},"#")],-1),Ba=e("p",null,"Adds a TFA secret to the user account.",-1),Ma=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"request-body-9"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-9"},"#")]),e("div",{class:"definitions"},[e("p",null,[e("code",null,"secret"),s(),e("strong",null,"Required"),e("br"),s(" The TFA secret from tfa/generate.")]),e("p",null,[e("code",null,"otp"),s(),e("strong",null,"Required"),e("br"),s(" OTP generated with the secret, to recheck if the user has a correct TFA setup")])]),e("h3",{id:"returns-14"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-14"},"#")]),e("div",{class:"definitions"},[e("p",null,"Empty response.")])]),e("div",{class:"right"},[e("h3",{id:"rest-api-14"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-14"},"#")]),e("pre",null,[e("code",null,`POST /users/me/tfa/enable
|
|
227
|
+
`)]),e("h5",{id:"example-24"},[s("Example "),e("a",{class:"header-anchor",href:"#example-24"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users/me/tfa/enable"),s(`
|
|
228
|
+
{
|
|
229
|
+
`),e("span",{class:"hljs-attr"},'"otp"'),s(": "),e("span",{class:"hljs-string"},'"123456"'),s(`,
|
|
230
|
+
`),e("span",{class:"hljs-attr"},'"secret"'),s(": "),e("span",{class:"hljs-string"},'"3CtiutsNBmY3szHE"'),s(`
|
|
231
|
+
}
|
|
232
|
+
`)])]),e("h3",{id:"graphql-14"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-14"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
233
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
234
|
+
users_me_tfa_enable(otp:`),e("span",{class:"hljs-type"}," String"),s("!, secret:"),e("span",{class:"hljs-type"}," String"),s("!):"),e("span",{class:"hljs-type"}," Boolean"),s(`
|
|
235
|
+
}
|
|
236
|
+
`)])]),e("h5",{id:"example-25"},[s("Example "),e("a",{class:"header-anchor",href:"#example-25"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
237
|
+
users_me_tfa_enable(otp: `),e("span",{class:"hljs-string"},'"123456"'),s(", secret: "),e("span",{class:"hljs-string"},'"3CtiutsNBmY3szHE"'),s(`)
|
|
238
|
+
}
|
|
239
|
+
`)])])])],-1),Fa=e("hr",null,null,-1),Ha=e("h2",{id:"disable-two-factor-authentication"},[s("Disable Two-Factor Authentication "),e("a",{class:"header-anchor",href:"#disable-two-factor-authentication"},"#")],-1),Na=e("p",null,"Disables two-factor authentication by removing the OTP secret from the user.",-1),Wa=e("div",{class:"two-up"},[e("div",{class:"left"},[e("h3",{id:"request-body-10"},[s("Request Body "),e("a",{class:"header-anchor",href:"#request-body-10"},"#")]),e("div",{class:"definitions"},[e("p",null,[e("code",null,"otp"),s(),e("strong",null,"Required"),e("br"),s(" One-time password generated by the authenticator app.")])]),e("h3",{id:"returns-15"},[s("Returns "),e("a",{class:"header-anchor",href:"#returns-15"},"#")]),e("p",null,"Empty response.")]),e("div",{class:"right"},[e("h3",{id:"rest-api-15"},[s("REST API "),e("a",{class:"header-anchor",href:"#rest-api-15"},"#")]),e("pre",null,[e("code",null,`POST /users/me/tfa/disable
|
|
240
|
+
`)]),e("h5",{id:"example-26"},[s("Example "),e("a",{class:"header-anchor",href:"#example-26"},"#")]),e("pre",null,[e("code",{class:"language-json"},[e("span",{class:"hljs-comment"},"// POST /users/me/tfa/disable"),s(`
|
|
241
|
+
|
|
242
|
+
{
|
|
243
|
+
`),e("span",{class:"hljs-attr"},'"otp"'),s(": "),e("span",{class:"hljs-string"},'"859014"'),s(`
|
|
244
|
+
}
|
|
245
|
+
`)])]),e("h3",{id:"graphql-15"},[s("GraphQL "),e("a",{class:"header-anchor",href:"#graphql-15"},"#")]),e("pre",null,[e("code",null,`POST /graphql/system
|
|
246
|
+
`)]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"type"),e("span",{class:"hljs-type"}," Mutation"),s(` {
|
|
247
|
+
users_me_tfa_disable(otp:`),e("span",{class:"hljs-type"}," String"),s("!):"),e("span",{class:"hljs-type"}," Boolean"),s(`
|
|
248
|
+
}
|
|
249
|
+
`)])]),e("h5",{id:"example-27"},[s("Example "),e("a",{class:"header-anchor",href:"#example-27"},"#")]),e("pre",null,[e("code",{class:"language-graphql"},[e("span",{class:"hljs-keyword"},"mutation"),s(` {
|
|
250
|
+
users_me_tfa_disable(otp: `),e("span",{class:"hljs-string"},'"591763"'),s(`)
|
|
251
|
+
}
|
|
252
|
+
`)])])])],-1),Ka={setup(Va,{expose:c}){const n={title:"Users",modularExtension:!1,pageClass:"page-reference"};return c({frontmatter:n}),(Ya,za)=>{const t=r("router-link"),o=r("DocsWrapper");return h(),i(o,{frontmatter:n},{default:a(()=>[e("div",d,[e("div",u,[e("div",p,[e("blockquote",null,[e("p",null,[_,l(t,{to:"/docs/getting-started/glossary/#users/"},{default:a(()=>[g]),_:1}),m])])]),f]),j,y,e("div",q,[e("div",b,[e("div",v,[w,x,T,E,R,S,P,k,A,e("p",null,[U,O,L,C,I,l(t,{to:"/docs/reference/files/"},{default:a(()=>[Q]),_:1}),D]),G,B,M,F])]),H]),N,W,V,e("div",Y,[e("div",z,[J,e("p",null,[K,l(t,{to:"/docs/reference/query"},{default:a(()=>[X]),_:1}),Z]),$,e("p",null,[ee,l(t,{to:"/docs/reference/query/#limit"},{default:a(()=>[se]),_:1}),ae,te,le])]),e("div",ne,[re,ce,e("p",null,[l(t,{to:"/docs/reference/introduction/#search-http-method"},{default:a(()=>[oe]),_:1})]),he,ie,de,ue,pe])]),_e,ge,me,e("div",fe,[e("div",je,[ye,e("p",null,[qe,l(t,{to:"/docs/reference/query"},{default:a(()=>[be]),_:1}),ve]),we,xe]),Te]),Ee,Re,Se,e("div",Pe,[e("div",ke,[Ae,e("p",null,[Ue,l(t,{to:"/docs/reference/query"},{default:a(()=>[Oe]),_:1}),Le]),Ce,Ie]),Qe]),De,Ge,Be,e("div",Me,[e("div",Fe,[He,e("p",null,[Ne,l(t,{to:"/docs/reference/query"},{default:a(()=>[We]),_:1}),Ve]),Ye,ze]),Je]),Ke,Xe,Ze,e("div",$e,[e("div",es,[ss,e("p",null,[as,l(t,{to:"/docs/reference/query"},{default:a(()=>[ts]),_:1}),ls]),ns,rs,cs,os,hs]),is]),ds,us,ps,e("div",_s,[e("div",gs,[ms,e("p",null,[fs,l(t,{to:"/docs/reference/query"},{default:a(()=>[js]),_:1}),ys]),qs,bs,vs,ws,xs]),Ts]),Es,Rs,Ss,e("div",Ps,[e("div",ks,[As,e("p",null,[Us,l(t,{to:"/docs/reference/query"},{default:a(()=>[Os]),_:1}),Ls]),Cs,Is,Qs,Ds]),Gs]),Bs,Ms,Fs,e("div",Hs,[e("div",Ns,[Ws,e("p",null,[Vs,l(t,{to:"/docs/reference/query"},{default:a(()=>[Ys]),_:1}),zs]),Js,Ks,Xs,Zs]),$s]),ea,sa,aa,ta,la,na,ra,ca,oa,ha,ia,e("div",da,[e("div",ua,[pa,e("div",_a,[ga,ma,e("p",null,[fa,ja,ya,qa,ba,va,l(t,{to:"/docs/configuration/config-options/#security"},{default:a(()=>[wa,xa]),_:1}),Ta])]),Ea,Ra]),Sa]),Pa,ka,Aa,Ua,Oa,La,Ca,Ia,Qa,Da,Ga,Ba,Ma,Fa,Ha,Na,Wa])]),_:1})}}};export{Ka as default};
|
package/dist/index.html
CHANGED
|
@@ -134,11 +134,11 @@
|
|
|
134
134
|
/>
|
|
135
135
|
<title>Loading…</title>
|
|
136
136
|
<style id="custom-css"></style>
|
|
137
|
-
<script type="module" crossorigin src="assets/index.
|
|
137
|
+
<script type="module" crossorigin src="assets/index.22c0e154.entry.js"></script>
|
|
138
138
|
<link rel="modulepreload" href="assets/vendor.275c9c53.js">
|
|
139
139
|
<link rel="modulepreload" href="assets/use-sync.7375bbee.js">
|
|
140
140
|
<link rel="stylesheet" href="assets/vendor.fe7856f0.css">
|
|
141
|
-
<link rel="stylesheet" href="assets/index.
|
|
141
|
+
<link rel="stylesheet" href="assets/index.ca954ed3.css">
|
|
142
142
|
</head>
|
|
143
143
|
<body class="light">
|
|
144
144
|
<noscript>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/app",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases",
|
|
6
6
|
"author": "Rijk van Zanten <rijkvanzanten@me.com>",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"build": "vite build",
|
|
27
27
|
"serve": "vite preview"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1a5a9180ee6d0ad8f03076bc6e3cfdd62a0dd2f9",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@directus/docs": "9.4.
|
|
32
|
-
"@directus/extensions-sdk": "9.4.
|
|
33
|
-
"@directus/format-title": "9.4.
|
|
34
|
-
"@directus/shared": "9.4.
|
|
31
|
+
"@directus/docs": "9.4.2",
|
|
32
|
+
"@directus/extensions-sdk": "9.4.2",
|
|
33
|
+
"@directus/format-title": "9.4.2",
|
|
34
|
+
"@directus/shared": "9.4.2",
|
|
35
35
|
"@fortawesome/fontawesome-svg-core": "1.2.36",
|
|
36
36
|
"@fortawesome/free-brands-svg-icons": "5.15.4",
|
|
37
37
|
"@fullcalendar/core": "5.10.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={identifier:"Identifiseerder",avatar:"Profiel prentjie",default_provider:"Verstek",published:"Gepubliseer",draft:"Draft",archived:"Geargiveer",modules:"Modules",module_bar:"Modulebalk",tile_size:"Te\xEBlgrootte",edit_field:"Wysig veld",conditions:"Voorwaardes",maps:"Kaarte",and:"En",or:"Of",create_role:"Skep Rol",language:"Taal",create_field:"Skep Veld",auto_generate:"Auto-Genereer",add_note:"Voeg 'n nuttige nota vir gebruikers...",default_value:"Standaard Waarde",clear_value:"Vee waarde uit",title:"Titel",checksum:"Kontrolesom",owner:"Eienaar",created_by:"Geskep Deur",created_on:"Geskep Op",comments:"Kommentaar",create_collection:"Skep Versameling",users:"Gebruikers",activity:"Aktiwiteit",action:"Aksie",ip_address:"IP Adres",user_agent:"Gebruiker Agent",duration:"Tydsduur",status:"Status",bookmarks:"Boekmerke",back:"Terug",operators:{contains:"Bevat"},role:"Rol",create:"Skep",width:"Breedte",height:"Hoogte",wysiwyg_options:{codeblock:"Kode",table:"Tafel"},choices:"Keuses",add_new:"Voeg nuwe",all:"Alle",batch_delete_confirm:"Geen items is gekies nie | Is jy seker jy wil hierdie item uitwis? Hierdie aksie kan nie ontdoen word nie. | Is jy seker jy wil hierdie {count} items uitwis? Hierdie aksie kan nie ontdoen word nie.",cancel:"Kanselleer",collection:"Versameling",fields:{directus_activity:{item:"Item Prim\xEAre Sleutel",action:"Aksie",collection:"Versameling",timestamp:"Aksie Op",user:"Aksie Deur",comment:"Kommentaar",user_agent:"Gebruiker Agent",ip:"IP Adres"},directus_collections:{collection:"Versameling"},directus_files:{title:"Titel",description:"Beskrywing",tags:"Sleutelwoorde",location:"Ligging",metadata:"Metadata",filesize:"L\xEAer Grootte",created_on:"Geskep Op",created_by:"Geskep Deur",uploaded_by:"Opgelaai Deur",width:"Breedte",uploaded_on:"Opgelaai Op",height:"Hoogte",duration:"Tydsduur"},directus_users:{first_name:"Eerste naam",last_name:"Van",email:"E-pos",password:"Wagwoord",avatar:"Profiel prentjie",location:"Ligging",title:"Titel",description:"Beskrywing",tags:"Sleutelwoorde",language:"Taal",theme:"Tema",tfa_secret:"Twee-Faktor Verifikasie",status:"Status",role:"Rol"},directus_settings:{module_bar:"Modulebalk"},directus_fields:{display_template:"Modelvorm"},directus_roles:{description:"Beskrywing"},directus_webhooks:{status:"Status"}},field_options:{directus_activity:{create:"Skep"},directus_collections:{language:"Taal"},directus_webhooks:{actions_create:"Skep"}},comment:"Kommentaar",description:"Beskrywing",email:"E-pos",password:"Wagwoord",template:"Modelvorm",interfaces:{filter:{all:"Alle"},"input-code":{code:"Kode"},"system-collection":{collection:"Versameling"},files:{files:"L\xEAers"},tags:{tags:"Sleutelwoorde"}},displays:{collection:{collection:"Versameling"},user:{avatar:"Profiel prentjie",both:"Beide"}},layouts:{cards:{cards:"Kaarte",image_source:"Foto Bron",title:"Titel",subtitle:"Subtitels"},tabular:{tabular:"Tafel",comfortable:"Gemaklik",compact:"Kompak",cozy:"Snoesig"}}},a=e.identifier,r=e.avatar,t=e.default_provider,i=e.published,o=e.draft,s=e.archived,l=e.modules,d=e.module_bar,n=e.tile_size,c=e.edit_field,u=e.conditions,v=e.maps,_=e.and,m=e.or,p=e.create_role,g=e.language,k=e.create_field,f=e.auto_generate,w=e.add_note,b=e.default_value,y=e.clear_value,h=e.title,S=e.checksum,T=e.owner,V=e.created_by,G=e.created_on,A=e.comments,K=e.create_collection,B=e.users,j=e.activity,O=e.action,I=e.ip_address,M=e.user_agent,P=e.duration,z=e.status,D=e.bookmarks,E=e.back,H=e.operators,L=e.role,W=e.create,R=e.width,F=e.height,x=e.wysiwyg_options,q=e.choices,C=e.add_new,J=e.all,N=e.batch_delete_confirm,Q=e.cancel,U=e.collection,X=e.fields,Y=e.field_options,Z=e.comment,$=e.description,ee=e.email,ae=e.password,re=e.template,te=e.interfaces,ie=e.displays,oe=e.layouts;export{O as action,j as activity,C as add_new,w as add_note,J as all,_ as and,s as archived,f as auto_generate,r as avatar,E as back,N as batch_delete_confirm,D as bookmarks,Q as cancel,S as checksum,q as choices,y as clear_value,U as collection,Z as comment,A as comments,u as conditions,W as create,K as create_collection,k as create_field,p as create_role,V as created_by,G as created_on,e as default,t as default_provider,b as default_value,$ as description,ie as displays,o as draft,P as duration,c as edit_field,ee as email,Y as field_options,X as fields,F as height,a as identifier,te as interfaces,I as ip_address,g as language,oe as layouts,v as maps,d as module_bar,l as modules,H as operators,m as or,T as owner,ae as password,i as published,L as role,z as status,re as template,n as tile_size,h as title,M as user_agent,B as users,R as width,x as wysiwyg_options};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
var fe=Object.defineProperty,me=Object.defineProperties;var ge=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var ye=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var ae=(e,t,n)=>t in e?fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t)=>{for(var n in t||(t={}))ye.call(t,n)&&ae(e,n,t[n]);if(se)for(var n of se(t))be.call(t,n)&&ae(e,n,t[n]);return e},ee=(e,t)=>me(e,ge(t));import{n as V,u as M,o as k,v as I,A as J,y as te,r as s,F as E,G as N,p as u,q as g,w as r,V as h,t as a,I as A,aE as $e,B as O,Y as z,K as U,L as re,aB as K,P as L,C as w,l as ne,$ as Q,ax as he,an as ke,E as R,O as ie,aG as le,U as ue,bk as we,S as Se,D as Oe,M as Ie,N as Ce,a1 as Ve,a2 as Le}from"./vendor.275c9c53.js";import{u as Be,a as ce,_ as B,b as de,g as pe,c as Y,d as F,e as X,M as De,t as Ue,f as Ae,h as Ne,i as je,j as Me,k as Re,l as _e,m as Te,H as Ee,n as Fe}from"./index.29d6735e.entry.js";import"./use-sync.7375bbee.js";const qe=V({setup(){const{t:e}=M(),t=Be(),n=ce(),c=k(()=>{var d;return n.settings===null||!((d=n.settings)==null?void 0:d.project_logo)?null:de(pe()+`assets/${n.settings.project_logo}`)}),_=I(!1),{queueHasItems:l}=J(t);te(()=>l.value,d=>{d&&(_.value=!0)});const i=k(()=>{var d;return(d=n.settings)==null?void 0:d.project_url}),o=k(()=>{var d;return((d=n.settings)==null?void 0:d.project_url)?e("view_project"):!1});return{customLogoPath:c,showLoader:_,stopSpinnerIfQueueIsEmpty:p,url:i,urlTooltip:o};function p(){l.value===!1&&(_.value=!1)}}}),He=["src"];function Pe(e,t,n,c,_,l){const i=s("v-progress-linear"),o=E("tooltip");return N((u(),g(re(e.url?"a":"div"),{href:e.url,target:e.url?"_blank":void 0,rel:e.url?"noopener noreferrer":void 0,class:U(["module-bar-logo",{loading:e.showLoader}])},{default:r(()=>[e.customLogoPath?(u(),h(z,{key:0},[a($e,{name:"fade"},{default:r(()=>[e.showLoader?(u(),g(i,{key:0,indeterminate:"",rounded:"",onAnimationiteration:e.stopSpinnerIfQueueIsEmpty},null,8,["onAnimationiteration"])):A("",!0)]),_:1}),O("img",{class:"custom-logo",src:e.customLogoPath,alt:"Project Logo"},null,8,He)],64)):(u(),h("div",{key:1,class:U(["logo",{running:e.showLoader}]),onAnimationiteration:t[0]||(t[0]=(...p)=>e.stopSpinnerIfQueueIsEmpty&&e.stopSpinnerIfQueueIsEmpty(...p))},null,34))]),_:1},8,["href","target","rel","class"])),[[o,e.urlTooltip,void 0,{right:!0}]])}var Ge=B(qe,[["render",Pe],["__scopeId","data-v-a98d38ac"]]);const ze=V({setup(){const{t:e}=M(),t=Y(),n=F(),{notificationsDrawerOpen:c}=K(t),{unread:_}=K(n),l=X(),i=I(!1),o=k(()=>{var v;return!l.currentUser||!("avatar"in l.currentUser)||!((v=l.currentUser)==null?void 0:v.avatar)?null:de(pe()+`assets/${l.currentUser.avatar.id}?key=system-medium-cover`)}),p=k(()=>{var y;return`/users/${(y=l.currentUser)==null?void 0:y.id}`}),d=k(()=>"/logout"),m=l.fullName;return{t:e,userFullName:m,avatarURL:o,userProfileLink:p,signOutActive:i,signOutLink:d,notificationsDrawerOpen:c,unread:_}}}),Qe={class:"module-bar-avatar"},We=["src","alt"];function Je(e,t,n,c,_,l){const i=s("v-icon"),o=s("v-button"),p=s("v-badge"),d=s("v-card-title"),m=s("v-card-actions"),v=s("v-card"),y=s("v-dialog"),f=s("v-avatar"),b=s("router-link"),D=s("v-hover"),S=E("tooltip");return u(),h("div",Qe,[a(p,{value:e.unread,disabled:e.unread==0,class:"notifications-badge"},{default:r(()=>[N(a(o,{tile:"",icon:"","x-large":"",class:"notifications",onClick:t[0]||(t[0]=C=>e.notificationsDrawerOpen=!0)},{default:r(()=>[a(i,{name:"notifications"})]),_:1},512),[[S,e.t("notifications"),void 0,{right:!0}]])]),_:1},8,["value","disabled"]),a(D,null,{default:r(({hover:C})=>[a(y,{modelValue:e.signOutActive,"onUpdate:modelValue":t[2]||(t[2]=$=>e.signOutActive=$),onEsc:t[3]||(t[3]=$=>e.signOutActive=!1)},{activator:r(({on:$})=>[N(a(o,{tile:"",icon:"","x-large":"",class:U([{show:C},"sign-out"]),onClick:$},{default:r(()=>[a(i,{name:"logout"})]),_:2},1032,["class","onClick"]),[[S,e.t("sign_out"),void 0,{right:!0}]])]),default:r(()=>[a(v,null,{default:r(()=>[a(d,null,{default:r(()=>[L(w(e.t("sign_out_confirm")),1)]),_:1}),a(m,null,{default:r(()=>[a(o,{secondary:"",onClick:t[1]||(t[1]=$=>e.signOutActive=!e.signOutActive)},{default:r(()=>[L(w(e.t("cancel")),1)]),_:1}),a(o,{to:e.signOutLink},{default:r(()=>[L(w(e.t("sign_out")),1)]),_:1},8,["to"])]),_:1})]),_:1})]),_:2},1032,["modelValue"]),a(b,{to:e.userProfileLink},{default:r(()=>[N(a(f,{tile:"",large:"",class:U({"no-avatar":!e.avatarURL})},{default:r(()=>[e.avatarURL?(u(),h("img",{key:0,src:e.avatarURL,alt:e.userFullName,class:"avatar-image"},null,8,We)):(u(),g(i,{key:1,name:"account_circle",outline:""}))]),_:1},8,["class"]),[[S,e.userFullName,void 0,{right:!0}]])]),_:1},8,["to"])]),_:1})])}var Ke=B(ze,[["render",Je],["__scopeId","data-v-09a19bc6"]]);const Ye=V({components:{ModuleBarLogo:Ge,ModuleBarAvatar:Ke},setup(){const e=ce(),{modules:t}=Ae(),n=k(()=>t.value.map(_=>_.id));return{modules:k(()=>{var _;return e.settings?((_=e.settings.module_bar)!=null?_:De).filter(l=>l.type==="link"?!0:l.enabled&&n.value.includes(l.id)).map(l=>{if(l.type==="link"){const o=ne.exports.omit(l,["url"]);return l.url.startsWith("/")?o.to=l.url:o.href=l.url,Ue(o)}const i=t.value.find(o=>o.id===l.id);return ee(W(W({},l),t.value.find(o=>o.id===l.id)),{to:`/${i.id}`})}):[]})}}}),Xe={class:"module-bar"},Ze={class:"modules"};function xe(e,t,n,c,_,l){const i=s("module-bar-logo"),o=s("v-icon"),p=s("v-button"),d=s("module-bar-avatar"),m=E("tooltip");return u(),h("div",Xe,[a(i),O("div",Ze,[(u(!0),h(z,null,Q(e.modules,v=>N((u(),g(p,{key:v.id,icon:"","x-large":"",to:v.to,href:v.href,tile:"",style:he(v.color?{"--v-button-color-active":v.color}:null)},{default:r(()=>[a(o,{name:v.icon,outline:""},null,8,["name"])]),_:2},1032,["to","href","style"])),[[m,v.name,void 0,{right:!0}]])),128))]),a(d)])}var et=B(Ye,[["render",xe],["__scopeId","data-v-dd9f73e8"]]);const tt=V({props:{sidebarOpen:{type:Boolean,default:!1}},setup(e){const t=I([]),n=I(!1);return te(()=>e.sidebarOpen,async c=>{c===!1?t.value=[]:(n.value=!0,await ke(),n.value=!1)}),{openDetail:t,mandatory:n}}});function nt(e,t,n,c,_,l){const i=s("v-item-group");return u(),g(i,{modelValue:e.openDetail,"onUpdate:modelValue":t[0]||(t[0]=o=>e.openDetail=o),class:"sidebar-detail-group",scope:"sidebar-detail",mandatory:e.mandatory},{default:r(()=>[R(e.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","mandatory"])}var ot=B(tt,[["render",nt],["__scopeId","data-v-ebb6371e"]]),q=1e3,H=q*60,P=H*60,T=P*24,st=T*7,at=T*365.25,Z=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return rt(e);if(n==="number"&&isFinite(e))return t.long?lt(e):it(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function rt(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var n=parseFloat(t[1]),c=(t[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return n*at;case"weeks":case"week":case"w":return n*st;case"days":case"day":case"d":return n*T;case"hours":case"hour":case"hrs":case"hr":case"h":return n*P;case"minutes":case"minute":case"mins":case"min":case"m":return n*H;case"seconds":case"second":case"secs":case"sec":case"s":return n*q;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function it(e){var t=Math.abs(e);return t>=T?Math.round(e/T)+"d":t>=P?Math.round(e/P)+"h":t>=H?Math.round(e/H)+"m":t>=q?Math.round(e/q)+"s":e+"ms"}function lt(e){var t=Math.abs(e);return t>=T?x(e,t,T,"day"):t>=P?x(e,t,P,"hour"):t>=H?x(e,t,H,"minute"):t>=q?x(e,t,q,"second"):e+" ms"}function x(e,t,n,c){var _=t>=n*1.5;return Math.round(e/n)+" "+c+(_?"s":"")}const ut=V({setup(){const{t:e}=M(),t=Ne(),n=k(()=>{const o=ne.exports.sortBy(t.latency,["timestamp"]);return o[o.length-1]}),c=k(()=>{if(!t.latency||t.latency.length===0)return 0;const o=ne.exports.sortBy(t.latency,["timestamp"]),p=o.slice(Math.max(o.length-5,0));let d=0;for(const{latency:m}of p)d+=m;return Math.round(d/p.length)}),_=k(()=>c.value<=250?4:c.value>250&&c.value<=500?3:c.value>500&&c.value<=750?2:1),l=k(()=>{switch(_.value){case 4:return`${e("connection_excellent")}
|
|
2
|
-
(${Z(c.value)} ${e("latency")})`;case 3:return`${e("connection_good")}
|
|
3
|
-
(${Z(c.value)} ${e("latency")})`;case 2:return`${e("connection_fair")}
|
|
4
|
-
(${Z(c.value)} ${e("latency")})`;case 1:return`${e("connection_poor")}
|
|
5
|
-
(${Z(c.value)} ${e("latency")})`;default:return null}});return{icon:k(()=>{switch(_.value){case 4:return"signal_wifi_4_bar";case 3:return"signal_wifi_3_bar";case 2:return"signal_wifi_2_bar";case 1:return"signal_wifi_1_bar";default:return null}}),lastLatency:n,latencyTooltip:l}}}),ct={class:"latency-indicator"};function dt(e,t,n,c,_,l){const i=s("v-progress-circular"),o=s("v-icon"),p=E("tooltip");return N((u(),h("div",ct,[e.lastLatency?(u(),g(o,{key:1,name:e.icon},null,8,["name"])):(u(),g(i,{key:0,indeterminate:""}))],512)),[[p,e.latencyTooltip,void 0,{bottom:!0,end:!0}]])}var pt=B(ut,[["render",dt],["__scopeId","data-v-2cfd5c8b"]]);const _t=V({components:{LatencyIndicator:pt},setup(){const e=je();return{name:k(()=>{var n,c;return(c=(n=e.info)==null?void 0:n.project)==null?void 0:c.project_name})}}}),vt={class:"project-info"},ft={class:"name"};function mt(e,t,n,c,_,l){const i=s("latency-indicator");return u(),h("div",vt,[a(i),O("span",ft,w(e.name),1)])}var gt=B(_t,[["render",mt],["__scopeId","data-v-08488eb6"]]);const yt=V({props:{id:{type:String,required:!0},title:{type:String,required:!0},text:{type:String,default:null},icon:{type:String,default:null},type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},tail:{type:Boolean,default:!1},dense:{type:Boolean,default:!1},showClose:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},progress:{type:Number,default:void 0}},setup(e){const t=F();return{close:n};function n(){e.showClose===!0&&t.remove(e.id)}}}),bt={key:0,class:"icon"},$t={class:"content"},ht={class:"title selectable"},kt={key:0,class:"text selectable"};function wt(e,t,n,c,_,l){const i=s("v-progress-circular"),o=s("v-icon");return u(),h("div",{class:U(["notification-item",[e.type,{tail:e.tail,dense:e.dense}]]),onClick:t[0]||(t[0]=(...p)=>e.close&&e.close(...p))},[e.loading||e.progress||e.icon?(u(),h("div",bt,[e.loading?(u(),g(i,{key:0,indeterminate:"",small:""})):e.progress?(u(),g(i,{key:1,small:"",value:e.progress},null,8,["value"])):(u(),g(o,{key:2,name:e.icon},null,8,["name"]))])):A("",!0),O("div",$t,[O("p",ht,w(e.title),1),e.text?(u(),h("p",kt,w(e.text),1)):A("",!0)]),e.showClose?(u(),g(o,{key:1,name:"close",clickable:"",class:"close",onClick:e.close},null,8,["onClick"])):A("",!0)],2)}var ve=B(yt,[["render",wt],["__scopeId","data-v-43553e80"]]);const St=V({components:{NotificationItem:ve},props:{dense:{type:Boolean,default:!1}},setup(){const e=F();return{queue:J(e).queue}}});function Ot(e,t,n,c,_,l){const i=s("notification-item");return u(),g(le,{class:"notifications-group",name:"slide-fade",tag:"div"},{default:r(()=>[R(e.$slots,"default",{},void 0,!0),(u(!0),h(z,null,Q(e.queue,(o,p)=>(u(),g(i,ie({key:o.id},o,{tail:p===e.queue.length-1,dense:e.dense,"show-close":o.persist===!0&&o.closeable!==!1}),null,16,["tail","dense","show-close"]))),128))]),_:3})}var It=B(St,[["render",Ot],["__scopeId","data-v-31bc6bbb"]]);const Ct=V({props:{to:{type:String,default:null},icon:{type:String,default:"box"},active:{type:Boolean,default:!1}},emits:["click"],setup(){const e=Y(),{sidebarOpen:t}=J(e);return{sidebarOpen:t}}}),Vt={class:"icon"},Lt={key:0,class:"title"};function Bt(e,t,n,c,_,l){const i=s("v-icon");return u(),g(re(e.to?"router-link":"button"),{class:U(["sidebar-button",{active:e.active}]),onClick:t[0]||(t[0]=o=>e.$emit("click",o))},{default:r(()=>[O("div",Vt,[a(i,{name:e.icon,outline:""},null,8,["name"])]),e.sidebarOpen?(u(),h("div",Lt,[R(e.$slots,"default",{},void 0,!0)])):A("",!0)]),_:3},8,["class"])}var Dt=B(Ct,[["render",Bt],["__scopeId","data-v-3f4d4d50"]]);const Ut=V({components:{SidebarButton:Dt,NotificationItem:ve},props:{sidebarOpen:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(){const{t:e}=M(),t=F();return{t:e,lastFour:t.lastFour}}}),At={class:"notifications-preview"},Nt={key:0,class:"inline"},jt={class:"padding-box"};function Mt(e,t,n,c,_,l){const i=s("router-link"),o=s("notification-item"),p=s("transition-expand"),d=s("sidebar-button"),m=E("tooltip");return u(),h("div",At,[a(p,{tag:"div"},{default:r(()=>[e.modelValue?(u(),h("div",Nt,[O("div",jt,[a(i,{class:U(["link",{"has-items":e.lastFour.length>0}]),to:"/activity"},{default:r(()=>[L(w(e.t("show_all_activity")),1)]),_:1},8,["class"]),a(le,{tag:"div",name:"notification",class:"transition"},{default:r(()=>[(u(!0),h(z,null,Q(e.lastFour,v=>(u(),g(o,ie({key:v.id},v),null,16))),128))]),_:1})])])):A("",!0)]),_:1}),N(a(d,{active:e.modelValue,class:"toggle",icon:"pending_actions",onClick:t[0]||(t[0]=v=>e.$emit("update:modelValue",!e.modelValue))},{default:r(()=>[L(w(e.t("activity_log")),1)]),_:1},8,["active"]),[[m,e.t("activity_log"),void 0,{left:!0}]])])}var Rt=B(Ut,[["render",Mt],["__scopeId","data-v-415ab206"]]);const Tt=V({setup(){const{t:e}=M(),{parsedInfo:t}=Me(),n=F(),c=X(),_=k(()=>n.dialogs);return{t:e,notifications:_,admin:c.isAdmin,done:i,getGitHubIssueLink:l};function l(o,p){var m,v,y,f;const d=`<!-- Please put a detailed explanation of the problem here. -->
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
### Project details
|
|
10
|
-
Directus Version: ${(m=t.value)==null?void 0:m.directus.version}
|
|
11
|
-
Environment: production
|
|
12
|
-
OS: ${(v=t.value)==null?void 0:v.os.type} ${(y=t.value)==null?void 0:y.os.version}
|
|
13
|
-
Node: ${(f=t.value)==null?void 0:f.node.version}
|
|
14
|
-
|
|
15
|
-
### Error
|
|
16
|
-
|
|
17
|
-
Title: ${p.title||"none"}
|
|
18
|
-
Message: ${p.text||"none"}
|
|
19
|
-
|
|
20
|
-
<details>
|
|
21
|
-
<summary>Stack Trace</summary>
|
|
22
|
-
<pre>
|
|
23
|
-
${JSON.stringify(p.error,Object.getOwnPropertyNames(p.error),2)}
|
|
24
|
-
</pre>
|
|
25
|
-
</details>
|
|
26
|
-
`;return`https://github.com/directus/directus/issues/new?body=${encodeURIComponent(d)}`}function i(o){n.remove(o)}}}),Et={class:"notification-dialogs"},Ft=["href"];function qt(e,t,n,c,_,l){const i=s("v-card-title"),o=s("v-error"),p=s("v-card-text"),d=s("v-button"),m=s("v-card-actions"),v=s("v-card"),y=s("v-dialog");return u(),h("div",Et,[(u(!0),h(z,null,Q(e.notifications,f=>(u(),g(y,{key:f.id,"model-value":!0,persist:""},{default:r(()=>[a(v,{class:U([f.type])},{default:r(()=>[a(i,null,{default:r(()=>[L(w(f.title),1)]),_:2},1024),f.text?(u(),g(p,{key:0},{default:r(()=>[L(w(f.text)+" ",1),f.error?(u(),g(o,{key:0,error:f.error},null,8,["error"])):A("",!0)]),_:2},1024)):A("",!0),a(m,null,{default:r(()=>[f.type==="error"&&e.admin&&f.code==="UNKNOWN"?(u(),g(d,{key:0,secondary:""},{default:r(()=>[O("a",{target:"_blank",href:e.getGitHubIssueLink(f.id,f)},w(e.t("report_error")),9,Ft)]),_:2},1024)):A("",!0),a(d,{onClick:b=>e.done(f.id)},{default:r(()=>[L(w(e.t("dismiss")),1)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1032,["class"])]),_:2},1024))),128))])}var Ht=B(Tt,[["render",qt],["__scopeId","data-v-bb61b36a"]]);const Pt=V({props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e){const{t}=M(),n=Y(),c=X(),_=F(),l=Re(),i=ue(),o=I([]),p=I(0),d=I(!1),m=I(null),v=I([]),y=I(["inbox"]),{notificationsDrawerOpen:f}=K(n),b=I([{text:t("subject"),value:"subject",sortable:!1,width:300,align:"left"},{text:t("timestamp"),value:"timestampDistance",sortable:!1,width:180,align:"left"}]);return D(),te([()=>e.modelValue,y],()=>D()),{tableHeaders:b,t,notificationsDrawerOpen:f,page:p,notifications:o,loading:d,error:m,selection:v,onRowClick:C,toggleArchive:S,tab:y};async function D(){d.value=!0;try{const $=await _e.get("/notifications",{params:{filter:{_and:[{recipient:{_eq:c.currentUser.id}},{status:{_eq:y.value[0]}}]},fields:["id","subject","collection","item","timestamp"],sort:["-timestamp"]}});await _.getUnreadCount();const j=$.data.data,G=[];for(const oe of j)G.push(ee(W({},oe),{timestampDistance:await Te(we(oe.timestamp),new Date,{addSuffix:!0})}));o.value=G}catch($){m.value=$}finally{d.value=!1}}async function S(){await _e.patch("/notifications",{keys:v.value.map(({id:$})=>$),data:{status:y.value[0]==="inbox"?"archived":"inbox"}}),await D(),v.value=[]}function C({item:$}){var G;const j=l.getCollection($.collection);((G=j==null?void 0:j.meta)==null?void 0:G.singleton)?i.push(`/content/${$.collection}`):i.push(`/content/${$.collection}/${$.item}`),f.value=!1}}});function Gt(e,t,n,c,_,l){const i=s("v-icon"),o=s("v-button"),p=s("v-list-item-icon"),d=s("v-list-item-content"),m=s("v-tab"),v=s("v-tabs"),y=s("v-info"),f=s("v-table"),b=s("v-drawer"),D=E("tooltip");return u(),g(b,{modelValue:e.notificationsDrawerOpen,"onUpdate:modelValue":t[3]||(t[3]=S=>e.notificationsDrawerOpen=S),icon:"notifications",title:e.t("notifications"),onCancel:t[4]||(t[4]=S=>e.notificationsDrawerOpen=!1)},{actions:r(()=>[N(a(o,{icon:"",rounded:"",disabled:e.selection.length===0,warning:"",onClick:e.toggleArchive},{default:r(()=>[a(i,{name:e.tab[0]==="inbox"?"archive":"move_to_inbox"},null,8,["name"])]),_:1},8,["disabled","onClick"]),[[D,e.tab[0]==="inbox"?e.t("archive"):e.t("unarchive"),void 0,{bottom:!0}]])]),sidebar:r(()=>[a(v,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=S=>e.tab=S),vertical:""},{default:r(()=>[a(m,{value:"inbox"},{default:r(()=>[a(p,null,{default:r(()=>[a(i,{name:"inbox"})]),_:1}),a(d,null,{default:r(()=>[L(w(e.t("inbox")),1)]),_:1})]),_:1}),a(m,{value:"archived"},{default:r(()=>[a(p,null,{default:r(()=>[a(i,{name:"archive"})]),_:1}),a(d,null,{default:r(()=>[L(w(e.t("archive")),1)]),_:1})]),_:1})]),_:1},8,["modelValue"])]),default:r(()=>[!e.loading&&e.notifications.length===0?(u(),g(y,{key:0,icon:"notifications",title:e.t("no_notifications"),center:""},{default:r(()=>[L(w(e.t("no_notifications_copy")),1)]),_:1},8,["title"])):(u(),g(f,{key:1,modelValue:e.selection,"onUpdate:modelValue":t[1]||(t[1]=S=>e.selection=S),headers:e.tableHeaders,"onUpdate:headers":t[2]||(t[2]=S=>e.tableHeaders=S),"show-select":"",loading:e.loading,items:e.notifications,"item-key":"id","onClick:row":e.onRowClick},null,8,["modelValue","headers","loading","items","onClick:row"]))]),_:1},8,["modelValue","title"])}var zt=B(Pt,[["render",Gt],["__scopeId","data-v-7d6473d9"]]);const Qt=V({components:{ModuleBar:et,SidebarDetailGroup:ot,HeaderBar:Ee,ProjectInfo:gt,NotificationsGroup:It,NotificationsPreview:Rt,NotificationDialogs:Ht,NotificationsDrawer:zt},props:{title:{type:String,default:null},smallHeader:{type:Boolean,default:!1}},setup(e){const{t}=M(),n=ue(),{title:c}=J(e),_=I(!1),l=I(),i=X(),o=Y(),p=k(()=>{var b,D;return i.currentUser?((D=(b=i.currentUser)==null?void 0:b.role)==null?void 0:D.app_access)||!1:!0}),d=I(!1),{sidebarOpen:m,fullScreen:v}=K(o),y=k(()=>{var b;return((b=i.currentUser)==null?void 0:b.theme)||"auto"});return Se("main-element",l),n.afterEach(async()=>{var b;(b=l.value)==null||b.scrollTo({top:0}),v.value=!1}),Fe(c),{t,navOpen:_,contentEl:l,theme:y,sidebarOpen:m,openSidebar:f,notificationsPreviewActive:d,appAccess:p,fullScreen:v};function f(b){b.target&&b.target.classList.contains("close")===!1&&(m.value=!0)}}}),Wt=e=>(Ve("data-v-8fbd5cde"),e=e(),Le(),e),Jt={class:"module-nav alt-colors"},Kt={class:"module-nav-content"},Yt={id:"main-content",ref:"contentEl",class:"content"},Xt={class:"flex-container"},Zt=Wt(()=>O("div",{class:"spacer"},null,-1));function xt(e,t,n,c,_,l){const i=s("v-button"),o=s("v-info"),p=s("module-bar"),d=s("project-info"),m=s("header-bar"),v=s("sidebar-detail-group"),y=s("notifications-preview"),f=s("v-overlay"),b=s("notifications-drawer"),D=s("notifications-group"),S=s("notification-dialogs");return e.appAccess===!1?(u(),g(o,{key:0,center:"",title:e.t("no_app_access"),type:"danger",icon:"block"},{append:r(()=>[a(i,{to:"/logout"},{default:r(()=>[L(w(e.t("switch_user")),1)]),_:1})]),default:r(()=>[L(w(e.t("no_app_access_copy"))+" ",1)]),_:1},8,["title"])):(u(),h("div",{key:1,class:U(["private-view",{theme:e.theme,"full-screen":e.fullScreen}])},[O("aside",{id:"navigation",role:"navigation","aria-label":"Module Navigation",class:U({"is-open":e.navOpen})},[a(p),O("div",Jt,[a(d),O("div",Kt,[R(e.$slots,"navigation",{},void 0,!0)])])],2),O("div",Yt,[a(m,{small:e.smallHeader,"show-sidebar-toggle":"",title:e.title,"onToggle:sidebar":t[0]||(t[0]=C=>e.sidebarOpen=!e.sidebarOpen),onPrimary:t[1]||(t[1]=C=>e.navOpen=!e.navOpen)},Oe({_:2},[Q(e.$slots,(C,$)=>({name:$,fn:r(j=>[R(e.$slots,$,Ie(Ce(j)),void 0,!0)])}))]),1032,["small","title"]),O("main",null,[R(e.$slots,"default",{},void 0,!0)])],512),O("aside",{id:"sidebar",role:"contentinfo",class:U(["alt-colors",{"is-open":e.sidebarOpen}]),"aria-label":"Module Sidebar",onClick:t[3]||(t[3]=(...C)=>e.openSidebar&&e.openSidebar(...C))},[O("div",Xt,[a(v,{"sidebar-open":e.sidebarOpen},{default:r(()=>[R(e.$slots,"sidebar",{},void 0,!0)]),_:3},8,["sidebar-open"]),Zt,a(y,{modelValue:e.notificationsPreviewActive,"onUpdate:modelValue":t[2]||(t[2]=C=>e.notificationsPreviewActive=C),"sidebar-open":e.sidebarOpen},null,8,["modelValue","sidebar-open"])])],2),a(f,{class:"nav-overlay",active:e.navOpen,onClick:t[4]||(t[4]=C=>e.navOpen=!1)},null,8,["active"]),a(f,{class:"sidebar-overlay",active:e.sidebarOpen,onClick:t[5]||(t[5]=C=>e.sidebarOpen=!1)},null,8,["active"]),a(b),e.notificationsPreviewActive===!1?(u(),g(D,{key:0,dense:e.sidebarOpen===!1},null,8,["dense"])):A("",!0),a(S)],2))}var sn=B(Qt,[["render",xt],["__scopeId","data-v-8fbd5cde"]]);export{sn as PrivateView,sn as default};
|