@directus/app 9.12.2 → 9.14.1

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.
Files changed (405) hide show
  1. package/dist/assets/accounts.40ab36c1.js +1 -0
  2. package/dist/assets/{active-line.ff3bc705.js → active-line.b531d8e7.js} +1 -1
  3. package/dist/assets/activity-log.9449feec.js +1 -0
  4. package/dist/assets/activity.fbd319d5.js +80 -0
  5. package/dist/assets/{apl.cc4825c6.js → apl.091e05c0.js} +1 -1
  6. package/dist/assets/ar-SA.215069dc.js +1 -0
  7. package/dist/assets/architecture.9e90b6f3.js +1 -0
  8. package/dist/assets/{asciiarmor.30bbdfc8.js → asciiarmor.72b1d474.js} +1 -1
  9. package/dist/assets/{asn.1.499e838e.js → asn.1.64b438d1.js} +1 -1
  10. package/dist/assets/{asterisk.a2fa7dc3.js → asterisk.2d23826f.js} +1 -1
  11. package/dist/assets/authentication.bc20bce5.js +73 -0
  12. package/dist/assets/{autorefresh.d36f34c8.js → autorefresh.65071be2.js} +1 -1
  13. package/dist/assets/aws.6652a1fd.js +1 -0
  14. package/dist/assets/backing-directus.02c28d29.js +1 -0
  15. package/dist/assets/bg-BG.9288ea83.js +1 -0
  16. package/dist/assets/bn-IN.4127b7a4.js +1 -0
  17. package/dist/assets/{br-FR.1ad76918.js → br-FR.d3564938.js} +1 -1
  18. package/dist/assets/{brainfuck.dab31c46.js → brainfuck.cb084ebc.js} +1 -1
  19. package/dist/assets/{ca-ES.365a1fc4.js → ca-ES.f3dfdef6.js} +1 -1
  20. package/dist/assets/cli.6e61515e.js +19 -0
  21. package/dist/assets/cli.863ef0d2.js +4 -0
  22. package/dist/assets/{clike.7aacd908.js → clike.c67024f2.js} +1 -1
  23. package/dist/assets/{clojure.c8d9937a.js → clojure.4409f83f.js} +1 -1
  24. package/dist/assets/cloudron.a348537b.js +1 -0
  25. package/dist/assets/{cmake.e0408576.js → cmake.2f7d66e8.js} +1 -1
  26. package/dist/assets/{cobol.86241640.js → cobol.1d3d945c.js} +1 -1
  27. package/dist/assets/codebase-overview.b46635f9.js +1 -0
  28. package/dist/assets/{coffeescript.6090d9e8.js → coffeescript.7dbfeb38.js} +1 -1
  29. package/dist/assets/collections.60e4b448.js +2 -0
  30. package/dist/assets/collections.80e4a52c.js +106 -0
  31. package/dist/assets/{commonlisp.eb3c5619.js → commonlisp.79d346a3.js} +1 -1
  32. package/dist/assets/config-options.8e2d8e17.js +138 -0
  33. package/dist/assets/content.003d7d7c.js +1 -0
  34. package/dist/assets/creating-extensions.9a98925a.js +11 -0
  35. package/dist/assets/{crystal.01db8e68.js → crystal.6f97295f.js} +1 -1
  36. package/dist/assets/cs-CZ.a3c83b73.js +1 -0
  37. package/dist/assets/{css.b1894218.js → css.87d5fc8d.js} +1 -1
  38. package/dist/assets/{cypher.c0cbf899.js → cypher.b46e268d.js} +1 -1
  39. package/dist/assets/{d.54d4201d.js → d.0277a0cc.js} +1 -1
  40. package/dist/assets/{da-DK.88f53a7d.js → da-DK.3c379038.js} +1 -1
  41. package/dist/assets/{dart.2218881c.js → dart.fd756766.js} +1 -1
  42. package/dist/assets/data-model.086edd1e.js +1 -0
  43. package/dist/assets/data-sharing.27afa5ee.js +1 -0
  44. package/dist/assets/de-DE.350023db.js +1 -0
  45. package/dist/assets/{diff.d7f03886.js → diff.1ed63843.js} +1 -1
  46. package/dist/assets/digitalocean-app-platform.aff2a50b.js +3 -0
  47. package/dist/assets/display-templates.d8e93a19.js +1 -0
  48. package/dist/assets/displays.e528abde.js +49 -0
  49. package/dist/assets/{django.913379d3.js → django.afa30018.js} +1 -1
  50. package/dist/assets/{docker.e1bb4205.js → docker.6f265c46.js} +7 -7
  51. package/dist/assets/{dockerfile.9c7cf88b.js → dockerfile.91c6378e.js} +1 -1
  52. package/dist/assets/documentation.ad1fdaf2.js +1 -0
  53. package/dist/assets/{dtd.dbc97bdb.js → dtd.8b391952.js} +1 -1
  54. package/dist/assets/{dylan.0c2df43b.js → dylan.5532ec69.js} +1 -1
  55. package/dist/assets/{ebnf.4c778620.js → ebnf.f179e348.js} +1 -1
  56. package/dist/assets/{ecl.778611ac.js → ecl.a37bdc2f.js} +1 -1
  57. package/dist/assets/{eiffel.2a73cd14.js → eiffel.883e1bfb.js} +1 -1
  58. package/dist/assets/{el-GR.98199dde.js → el-GR.103ebf8d.js} +1 -1
  59. package/dist/assets/{elm.90002323.js → elm.c40484aa.js} +1 -1
  60. package/dist/assets/email-templates.2bdb87a6.js +2 -0
  61. package/dist/assets/{en-CA.58d818b8.js → en-CA.9ad3a3ab.js} +1 -1
  62. package/dist/assets/{en-GB.74320d21.js → en-GB.c55341c7.js} +1 -1
  63. package/dist/assets/endpoints.2c9172db.js +27 -0
  64. package/dist/assets/{erlang.c8e3989e.js → erlang.60963eb0.js} +1 -1
  65. package/dist/assets/es-419.10094709.js +1 -0
  66. package/dist/assets/es-CL.7f44ec7c.js +1 -0
  67. package/dist/assets/es-ES.3ff9088e.js +1 -0
  68. package/dist/assets/es-MX.17370b17.js +1 -0
  69. package/dist/assets/{et-EE.9e35920e.js → et-EE.fb46a361.js} +1 -1
  70. package/dist/assets/extensions.8d3df212.js +12 -0
  71. package/dist/assets/{fa-IR.f3dc75f9.js → fa-IR.b864f77c.js} +1 -1
  72. package/dist/assets/{factor.a2db9c26.js → factor.6c5ee333.js} +1 -1
  73. package/dist/assets/faq.63c79c18.js +2 -0
  74. package/dist/assets/{fcl.02d85986.js → fcl.8e18cfdc.js} +1 -1
  75. package/dist/assets/{fi-FI.42afdce0.js → fi-FI.14f31cb4.js} +1 -1
  76. package/dist/assets/fields.715d4591.js +135 -0
  77. package/dist/assets/file-library.a4de4015.js +1 -0
  78. package/dist/assets/files.7c2ccfe2.js +189 -0
  79. package/dist/assets/filter-rules.056b97be.js +76 -0
  80. package/dist/assets/filters.2cb82fd9.js +1 -0
  81. package/dist/assets/flows.38f60cc8.js +172 -0
  82. package/dist/assets/flows.f378a262.js +15 -0
  83. package/dist/assets/{fo-FO.ffe478b0.js → fo-FO.cc444b75.js} +1 -1
  84. package/dist/assets/folders.fa66a5ce.js +132 -0
  85. package/dist/assets/{forth.725698ea.js → forth.5d8db187.js} +1 -1
  86. package/dist/assets/{fortran.e9ba7b47.js → fortran.ac24d46b.js} +1 -1
  87. package/dist/assets/{fr-CA.caa3fc8d.js → fr-CA.0e824ae4.js} +1 -1
  88. package/dist/assets/fr-FR.77a5277c.js +1 -0
  89. package/dist/assets/{gas.25b17a72.js → gas.f99de41f.js} +1 -1
  90. package/dist/assets/gcp.6c61b39e.js +60 -0
  91. package/dist/assets/{gfm.a7b6e273.js → gfm.c3250bc4.js} +1 -1
  92. package/dist/assets/{gherkin.1db310b6.js → gherkin.dd3614b2.js} +1 -1
  93. package/dist/assets/github-ci.04483301.js +2 -0
  94. package/dist/assets/glossary.485603d9.js +1 -0
  95. package/dist/assets/glossary.6efd77ad.js +1 -0
  96. package/dist/assets/{go.a0c64ca2.js → go.18ea1afe.js} +1 -1
  97. package/dist/assets/{groovy.b0ac2a1f.js → groovy.d1f3a61a.js} +1 -1
  98. package/dist/assets/{haml.233c9608.js → haml.a346df44.js} +1 -1
  99. package/dist/assets/{handlebars.b13fc00f.js → handlebars.a4eff81f.js} +1 -1
  100. package/dist/assets/{haskell-literate.af8f88ee.js → haskell-literate.57a5243e.js} +1 -1
  101. package/dist/assets/{haskell.adcf73db.js → haskell.3acf2710.js} +1 -1
  102. package/dist/assets/{haxe.f1a75c2e.js → haxe.bdf5968b.js} +1 -1
  103. package/dist/assets/{hi-IN.36e79faa.js → hi-IN.c0703db5.js} +1 -1
  104. package/dist/assets/hooks.f7efe9af.js +60 -0
  105. package/dist/assets/{hr-HR.b1e41c07.js → hr-HR.467388ee.js} +1 -1
  106. package/dist/assets/{htmlembedded.145e9718.js → htmlembedded.03cf45db.js} +1 -1
  107. package/dist/assets/{htmlmixed.6794685c.js → htmlmixed.987f61e9.js} +1 -1
  108. package/dist/assets/{http.5bb61ef1.js → http.a4c95466.js} +1 -1
  109. package/dist/assets/{hu-HU.9c7ec38f.js → hu-HU.47ab36e8.js} +1 -1
  110. package/dist/assets/id-ID.8089647c.js +1 -0
  111. package/dist/assets/{idl.f52ce6c3.js → idl.2fcbfa33.js} +1 -1
  112. package/dist/assets/iis.e068f41a.js +24 -0
  113. package/dist/assets/import-export.d334c127.js +2 -0
  114. package/dist/assets/{index.133de9ba.entry.js → index.02dcddad.entry.js} +222 -226
  115. package/dist/assets/index.087465cd.css +1 -0
  116. package/dist/assets/index.4254793b.js +26 -0
  117. package/dist/assets/{index.895a297f.css → index.6f497914.css} +1 -1
  118. package/dist/assets/{input-rich-text-html.817ccf8b.css → input-rich-text-html.172a38cb.css} +1 -1
  119. package/dist/assets/{input-rich-text-html.e9e92552.js → input-rich-text-html.75413785.js} +47 -47
  120. package/dist/assets/insights.b3ba896c.js +2 -0
  121. package/dist/assets/installation.2025f88b.js +1 -0
  122. package/dist/assets/interfaces.606c790c.js +46 -0
  123. package/dist/assets/introduction.41a72fb0.js +1 -0
  124. package/dist/assets/introduction.527c3465.js +4 -0
  125. package/dist/assets/introduction.5566b96e.js +90 -0
  126. package/dist/assets/introduction.ecd17b88.js +1 -0
  127. package/dist/assets/it-IT.58422a56.js +1 -0
  128. package/dist/assets/items.d1f658a9.js +1 -0
  129. package/dist/assets/items.d9c6a0b4.js +136 -0
  130. package/dist/assets/ja-JP.84597497.js +1 -0
  131. package/dist/assets/{javascript-hint.d8a99d8e.js → javascript-hint.db799360.js} +1 -1
  132. package/dist/assets/{javascript.357d6ab4.js → javascript.46c46918.js} +1 -1
  133. package/dist/assets/{jinja2.64181acd.js → jinja2.71e29364.js} +1 -1
  134. package/dist/assets/{jsx.ba14fb9d.js → jsx.9ae3ca09.js} +1 -1
  135. package/dist/assets/{julia.06a9ee42.js → julia.8b46f23e.js} +1 -1
  136. package/dist/assets/{ko-KR.5a129780.js → ko-KR.9056bd31.js} +1 -1
  137. package/dist/assets/{ku-TR.9eee23ff.js → ku-TR.3a07a57e.js} +1 -1
  138. package/dist/assets/layouts.0aa8d645.js +54 -0
  139. package/dist/assets/layouts.14b157dc.js +1 -0
  140. package/dist/assets/{livescript.687f6ca6.js → livescript.1c767a4c.js} +1 -1
  141. package/dist/assets/localization.c89061c7.js +1 -0
  142. package/dist/assets/{lt-LT.772aac6e.js → lt-LT.f2d719ff.js} +1 -1
  143. package/dist/assets/{lua.40597bfe.js → lua.42e69aa3.js} +1 -1
  144. package/dist/assets/manual.20d730b3.js +12 -0
  145. package/dist/assets/{mark-selection.feeab6e5.js → mark-selection.16acf9dc.js} +1 -1
  146. package/dist/assets/{match-highlighter.8afd3316.js → match-highlighter.8f0791ef.js} +1 -1
  147. package/dist/assets/{mathematica.6569f1d2.js → mathematica.6d38a8bc.js} +1 -1
  148. package/dist/assets/{mbox.d8c16b77.js → mbox.04641caf.js} +1 -1
  149. package/dist/assets/migrations.f13ec64d.js +19 -0
  150. package/dist/assets/{mirc.5f909857.js → mirc.a748cdbe.js} +1 -1
  151. package/dist/assets/{mllike.393c4525.js → mllike.78996bae.js} +1 -1
  152. package/dist/assets/{mn-MN.ae109212.js → mn-MN.c504a096.js} +1 -1
  153. package/dist/assets/{modelica.1180cc4d.js → modelica.e521b192.js} +1 -1
  154. package/dist/assets/modules.9b5ee510.js +69 -0
  155. package/dist/assets/{ms-MY.e50ff23a.js → ms-MY.e6553dad.js} +1 -1
  156. package/dist/assets/{mscgen.429d47df.js → mscgen.4b8f9009.js} +1 -1
  157. package/dist/assets/{multiplex.23c498d1.js → multiplex.c8ef0fcd.js} +1 -1
  158. package/dist/assets/{mumps.f94bba13.js → mumps.44c6f7dd.js} +1 -1
  159. package/dist/assets/{nginx.72bf7bab.js → nginx.0aef90d9.js} +1 -1
  160. package/dist/assets/{nl-NL.b57de112.js → nl-NL.2f00af44.js} +1 -1
  161. package/dist/assets/{no-NO.79458b78.js → no-NO.59f9d425.js} +1 -1
  162. package/dist/assets/notifications.674ee6f9.js +153 -0
  163. package/dist/assets/{nsis.68fe2711.js → nsis.21597a35.js} +1 -1
  164. package/dist/assets/{ntriples.964a7402.js → ntriples.a9ce3eee.js} +1 -1
  165. package/dist/assets/{octave.26aad7e7.js → octave.e4e6969c.js} +1 -1
  166. package/dist/assets/operations.46679bea.js +1 -0
  167. package/dist/assets/operations.9995851b.js +169 -0
  168. package/dist/assets/{overlay.b4b97f23.js → overlay.725bd47b.js} +1 -1
  169. package/dist/assets/overview.3616b560.js +1 -0
  170. package/dist/assets/overview.3c9f8f3d.js +1 -0
  171. package/dist/assets/overview.6438dc44.js +1 -0
  172. package/dist/assets/{oz.1076911f.js → oz.439981ca.js} +1 -1
  173. package/dist/assets/panels.570ee526.js +65 -0
  174. package/dist/assets/{pascal.8ad1e64f.js → pascal.e63a97cf.js} +1 -1
  175. package/dist/assets/{pegjs.c362f9d1.js → pegjs.9b76593b.js} +1 -1
  176. package/dist/assets/{perl.afe37b4f.js → perl.e5aa6f87.js} +1 -1
  177. package/dist/assets/permissions.768d1878.js +178 -0
  178. package/dist/assets/{php.2fcb5b78.js → php.d553fa6c.js} +1 -1
  179. package/dist/assets/{pig.1047d3c6.js → pig.657ad6df.js} +1 -1
  180. package/dist/assets/pl-PL.80cfbed6.js +1 -0
  181. package/dist/assets/plesk.b0ee9a9a.js +27 -0
  182. package/dist/assets/{powershell.a493c1a9.js → powershell.d67ba3f4.js} +1 -1
  183. package/dist/assets/presets-bookmarks.522baf53.js +1 -0
  184. package/dist/assets/presets.d902ebfa.js +164 -0
  185. package/dist/assets/project-settings.1f95b799.js +1 -0
  186. package/dist/assets/projects.1ea6a392.js +1 -0
  187. package/dist/assets/{properties.2ccd56b8.js → properties.da88b13f.js} +1 -1
  188. package/dist/assets/{protobuf.a0e463a0.js → protobuf.4d5afee3.js} +1 -1
  189. package/dist/assets/pt-BR.40750500.js +1 -0
  190. package/dist/assets/pt-PT.fae0fcc3.js +1 -0
  191. package/dist/assets/{pug.3909bb70.js → pug.3f42b721.js} +1 -1
  192. package/dist/assets/{puppet.298e3717.js → puppet.c79d85fc.js} +1 -1
  193. package/dist/assets/{python.099f62ce.js → python.d6ada07e.js} +1 -1
  194. package/dist/assets/{q.64763e8e.js → q.1a68bd88.js} +1 -1
  195. package/dist/assets/query.8abea6de.js +152 -0
  196. package/dist/assets/quickstart.75164dd7.js +9 -0
  197. package/dist/assets/quickstart.9985cb15.js +20 -0
  198. package/dist/assets/{r.f2c0470b.js → r.0c2eb3c2.js} +1 -1
  199. package/dist/assets/relations.9011b2b5.js +115 -0
  200. package/dist/assets/relationships.cbc9b1c5.js +55 -0
  201. package/dist/assets/resources.25cb1e34.js +1 -0
  202. package/dist/assets/revisions.c90ecb76.js +40 -0
  203. package/dist/assets/{ro-RO.5161835a.js → ro-RO.a1adfb6a.js} +1 -1
  204. package/dist/assets/roles.22f7aa37.js +171 -0
  205. package/dist/assets/{rpm.cf84a89e.js → rpm.bf07aaab.js} +1 -1
  206. package/dist/assets/{rst.26def927.js → rst.00e6f3ec.js} +1 -1
  207. package/dist/assets/{ru-RU.94a64be6.js → ru-RU.35703ea4.js} +1 -1
  208. package/dist/assets/{ruby.5fdee9b4.js → ruby.a058e7d1.js} +1 -1
  209. package/dist/assets/running-locally.ce0a8200.js +26 -0
  210. package/dist/assets/{rust.ab31720a.js → rust.f7ca883b.js} +1 -1
  211. package/dist/assets/{sas.d35671d3.js → sas.f9db0ec1.js} +1 -1
  212. package/dist/assets/{sass.be16b14c.js → sass.6c26d08e.js} +1 -1
  213. package/dist/assets/{scheme.da057889.js → scheme.b19aee0d.js} +1 -1
  214. package/dist/assets/sdk.916109ed.js +393 -0
  215. package/dist/assets/security.1963da73.js +1 -0
  216. package/dist/assets/server.afec52fc.js +114 -0
  217. package/dist/assets/settings.835be62f.js +51 -0
  218. package/dist/assets/settings.a02abd85.js +1 -0
  219. package/dist/assets/{shell.ba07ff2f.js → shell.b593f3c7.js} +1 -1
  220. package/dist/assets/{show-hint.4c3405db.js → show-hint.252396d2.js} +1 -1
  221. package/dist/assets/{sieve.9a88af42.js → sieve.b20bbc45.js} +1 -1
  222. package/dist/assets/{simple.306c97cf.js → simple.8b298831.js} +1 -1
  223. package/dist/assets/{sl-SI.719d987e.js → sl-SI.632899f8.js} +1 -1
  224. package/dist/assets/{slim.11e72018.js → slim.2a6f8eee.js} +1 -1
  225. package/dist/assets/{smalltalk.802facc0.js → smalltalk.9bee6f9b.js} +1 -1
  226. package/dist/assets/{smarty.410c0c8d.js → smarty.be5c58b8.js} +1 -1
  227. package/dist/assets/{solr.43e14cbf.js → solr.49b61be0.js} +1 -1
  228. package/dist/assets/{soy.18418f41.js → soy.0ff77af9.js} +1 -1
  229. package/dist/assets/{sparql.5169332f.js → sparql.9f5e3d7d.js} +1 -1
  230. package/dist/assets/{spreadsheet.2a7e9b13.js → spreadsheet.062b3700.js} +1 -1
  231. package/dist/assets/{sql.53c1d1ba.js → sql.a5128e43.js} +1 -1
  232. package/dist/assets/{sr-CS.c513578f.js → sr-CS.2e5b18be.js} +1 -1
  233. package/dist/assets/{sso-examples.b52061be.js → sso-examples.048b39c5.js} +12 -12
  234. package/dist/assets/sso.70be105f.js +22 -0
  235. package/dist/assets/{stex.7c4e0033.js → stex.0331c80e.js} +1 -1
  236. package/dist/assets/{stylus.dfe1c737.js → stylus.6423d65d.js} +1 -1
  237. package/dist/assets/support.fce2dba5.js +1 -0
  238. package/dist/assets/{sv-SE.a70fd097.js → sv-SE.d485ddd3.js} +1 -1
  239. package/dist/assets/{swift.e9cb43f5.js → swift.979a2826.js} +1 -1
  240. package/dist/assets/{tcl.7cc3bef5.js → tcl.fa1b798c.js} +1 -1
  241. package/dist/assets/teams.44eb670e.js +1 -0
  242. package/dist/assets/{textile.353c8497.js → textile.9dbd9b93.js} +1 -1
  243. package/dist/assets/{th-TH.bdbc4a8c.js → th-TH.1e9ab13f.js} +1 -1
  244. package/dist/assets/themes.e4a7762f.js +5 -0
  245. package/dist/assets/{tiddlywiki.f4ebe8db.js → tiddlywiki.fb030aa9.js} +1 -1
  246. package/dist/assets/{tiki.95dd78e4.js → tiki.2e2e82c0.js} +1 -1
  247. package/dist/assets/{toml.f50bb93a.js → toml.0c911c34.js} +1 -1
  248. package/dist/assets/{tornado.3e0cfd8c.js → tornado.466faa98.js} +1 -1
  249. package/dist/assets/tr-TR.feb24957.js +1 -0
  250. package/dist/assets/translation-strings.4ed25965.js +1 -0
  251. package/dist/assets/translations.cf2353ca.js +1 -0
  252. package/dist/assets/triggers.05092cdf.js +1 -0
  253. package/dist/assets/{troff.a2834e8f.js → troff.398ba40d.js} +1 -1
  254. package/dist/assets/{ttcn-cfg.447f138c.js → ttcn-cfg.7c37ebe0.js} +1 -1
  255. package/dist/assets/{ttcn.7d877404.js → ttcn.58e768c8.js} +1 -1
  256. package/dist/assets/{turtle.3b4898fd.js → turtle.2b65ee77.js} +1 -1
  257. package/dist/assets/{twig.53dd7cbe.js → twig.0cf35761.js} +1 -1
  258. package/dist/assets/ubuntu.35dc97df.js +11 -0
  259. package/dist/assets/uk-UA.0e92f9a4.js +1 -0
  260. package/dist/assets/upgrades-migrations.9218bbe9.js +1 -0
  261. package/dist/assets/use-sync.c0f4dfab.js +7 -7
  262. package/dist/assets/user-directory.3daaa818.js +1 -0
  263. package/dist/assets/users-roles-permissions.6e18f7ca.js +1 -0
  264. package/dist/assets/users.4f11a7c5.js +252 -0
  265. package/dist/assets/utilities.0e0d0ace.js +74 -0
  266. package/dist/assets/{vb.c3313898.js → vb.269200a5.js} +1 -1
  267. package/dist/assets/{vbscript.0b106bed.js → vbscript.b9c30330.js} +1 -1
  268. package/dist/assets/{velocity.c20bb29d.js → velocity.a54e5f76.js} +1 -1
  269. package/dist/assets/{verilog.2f6698b4.js → verilog.fd6a1be7.js} +1 -1
  270. package/dist/assets/{vhdl.6127eef7.js → vhdl.846afe81.js} +1 -1
  271. package/dist/assets/{vi-VN.7478a743.js → vi-VN.3e9c985f.js} +1 -1
  272. package/dist/assets/{vue.bb756ea0.js → vue.74e2af44.js} +1 -1
  273. package/dist/assets/{wast.66661aa3.js → wast.38b3f34b.js} +1 -1
  274. package/dist/assets/webhooks.00ee297b.js +147 -0
  275. package/dist/assets/webhooks.01ddb390.js +1 -0
  276. package/dist/assets/{webidl.0a42319e.js → webidl.481665e3.js} +1 -1
  277. package/dist/assets/{xquery.44dd200c.js → xquery.e254ba63.js} +1 -1
  278. package/dist/assets/{yacas.6f3863db.js → yacas.fc329640.js} +1 -1
  279. package/dist/assets/{yaml-frontmatter.42fca60b.js → yaml-frontmatter.84cccda6.js} +1 -1
  280. package/dist/assets/{yaml.d85fc2b2.js → yaml.3a95e8e9.js} +1 -1
  281. package/dist/assets/{z80.2bbe85a7.js → z80.691a0cb9.js} +1 -1
  282. package/dist/assets/zh-CN.432cf71e.js +1 -0
  283. package/dist/assets/zh-TW.cac20c88.js +1 -0
  284. package/dist/index.html +2 -2
  285. package/package.json +10 -7
  286. package/dist/assets/accounts.08433099.js +0 -1
  287. package/dist/assets/activity-log.496fa2f2.css +0 -1
  288. package/dist/assets/activity-log.fd558c9b.js +0 -1
  289. package/dist/assets/activity.0def80ca.js +0 -80
  290. package/dist/assets/ar-SA.1a6c2c65.js +0 -1
  291. package/dist/assets/architecture.6e6f13a7.js +0 -1
  292. package/dist/assets/authentication.a6f04750.js +0 -73
  293. package/dist/assets/aws.3b1c64af.js +0 -1
  294. package/dist/assets/backing-directus.0003d237.js +0 -1
  295. package/dist/assets/bg-BG.749c86ae.js +0 -1
  296. package/dist/assets/bn-IN.1385676c.js +0 -1
  297. package/dist/assets/cli.5153aa86.js +0 -4
  298. package/dist/assets/cli.e8e2526b.js +0 -19
  299. package/dist/assets/cloudron.53c430b8.js +0 -1
  300. package/dist/assets/codebase-overview.e9df94fc.js +0 -1
  301. package/dist/assets/collections.2453db3a.js +0 -106
  302. package/dist/assets/collections.aa896b3f.js +0 -2
  303. package/dist/assets/config-options.b1233b4b.js +0 -138
  304. package/dist/assets/content.1b1e95cf.js +0 -1
  305. package/dist/assets/creating-extensions.bfd7c57c.js +0 -11
  306. package/dist/assets/cs-CZ.6910228b.js +0 -1
  307. package/dist/assets/data-model.0e360572.js +0 -1
  308. package/dist/assets/data-sharing.da96e52e.js +0 -1
  309. package/dist/assets/de-DE.a4271e4f.js +0 -1
  310. package/dist/assets/digitalocean-app-platform.3412cb40.js +0 -3
  311. package/dist/assets/display-templates.915c0c5b.js +0 -1
  312. package/dist/assets/displays.99989c6d.js +0 -49
  313. package/dist/assets/documentation.788d4998.js +0 -1
  314. package/dist/assets/email-templates.1f5ac335.js +0 -2
  315. package/dist/assets/endpoints.aaac7c81.js +0 -27
  316. package/dist/assets/es-419.aa0bf259.js +0 -1
  317. package/dist/assets/es-CL.e42c6c3c.js +0 -1
  318. package/dist/assets/es-ES.5c7e9438.js +0 -1
  319. package/dist/assets/es-MX.b9c72674.js +0 -1
  320. package/dist/assets/extensions.34c12005.js +0 -12
  321. package/dist/assets/faq.89e68608.js +0 -2
  322. package/dist/assets/fields.54985585.js +0 -135
  323. package/dist/assets/file-library.b55c53fe.js +0 -1
  324. package/dist/assets/files.064d5a35.js +0 -187
  325. package/dist/assets/filter-rules.aec0af01.js +0 -76
  326. package/dist/assets/filters.3db1b044.js +0 -1
  327. package/dist/assets/flows.22228af1.js +0 -172
  328. package/dist/assets/flows.3ea1b90f.js +0 -15
  329. package/dist/assets/folders.0024d3d3.js +0 -132
  330. package/dist/assets/fr-FR.615da1bd.js +0 -1
  331. package/dist/assets/gcp.627205b5.js +0 -60
  332. package/dist/assets/github-ci.abd39dcc.js +0 -2
  333. package/dist/assets/glossary.312e2401.js +0 -1
  334. package/dist/assets/glossary.75ca2027.js +0 -1
  335. package/dist/assets/hooks.eda18b02.js +0 -60
  336. package/dist/assets/id-ID.a0052c00.js +0 -1
  337. package/dist/assets/iis.109e5a8a.js +0 -24
  338. package/dist/assets/import-export.3da878a4.js +0 -2
  339. package/dist/assets/index.55cf7b0a.js +0 -26
  340. package/dist/assets/index.ef58525d.css +0 -1
  341. package/dist/assets/insights.c8ed7c1c.js +0 -1
  342. package/dist/assets/installation.78c6d9f6.js +0 -1
  343. package/dist/assets/interfaces.9e145c45.js +0 -46
  344. package/dist/assets/introduction.2e6f5c1d.js +0 -90
  345. package/dist/assets/introduction.78a2a844.js +0 -4
  346. package/dist/assets/introduction.8a589eb0.js +0 -1
  347. package/dist/assets/introduction.fd7c08ac.js +0 -1
  348. package/dist/assets/it-IT.7b7f58ec.js +0 -1
  349. package/dist/assets/items.4205dfa0.js +0 -136
  350. package/dist/assets/items.64ed9295.js +0 -1
  351. package/dist/assets/ja-JP.819a38cf.js +0 -1
  352. package/dist/assets/layouts.3c14b583.js +0 -54
  353. package/dist/assets/layouts.ca8afd39.js +0 -1
  354. package/dist/assets/localization.374b7427.js +0 -1
  355. package/dist/assets/manual.ab601c95.js +0 -10
  356. package/dist/assets/migrations.8989fedc.js +0 -19
  357. package/dist/assets/modules.17c944d1.js +0 -69
  358. package/dist/assets/notifications.33c688c9.js +0 -153
  359. package/dist/assets/operations.22151874.js +0 -169
  360. package/dist/assets/operations.50a08aae.js +0 -1
  361. package/dist/assets/overview.3436365c.js +0 -1
  362. package/dist/assets/overview.623fafba.js +0 -1
  363. package/dist/assets/overview.dbebe94a.js +0 -1
  364. package/dist/assets/panels.385b173a.js +0 -65
  365. package/dist/assets/permissions.f84f8d42.js +0 -178
  366. package/dist/assets/pl-PL.7e448fa9.js +0 -1
  367. package/dist/assets/plesk.f7e3d5ef.js +0 -27
  368. package/dist/assets/presets-bookmarks.1b8ec70c.js +0 -1
  369. package/dist/assets/presets.b1e8b6c1.js +0 -164
  370. package/dist/assets/project-settings.d32669a9.js +0 -1
  371. package/dist/assets/projects.bb50c3df.js +0 -1
  372. package/dist/assets/pt-BR.2d6fa7cc.js +0 -1
  373. package/dist/assets/pt-PT.c28534a0.js +0 -1
  374. package/dist/assets/query.dbe0b56d.js +0 -152
  375. package/dist/assets/quickstart.01824cc9.js +0 -9
  376. package/dist/assets/quickstart.4d7c7736.js +0 -20
  377. package/dist/assets/relations.d29aa86d.js +0 -115
  378. package/dist/assets/relationships.c9c5db8a.js +0 -55
  379. package/dist/assets/resources.00028bf0.js +0 -1
  380. package/dist/assets/revisions.2898106e.js +0 -40
  381. package/dist/assets/roles.9fec37da.js +0 -171
  382. package/dist/assets/running-locally.811d0dcc.js +0 -26
  383. package/dist/assets/sdk.12cd7974.js +0 -393
  384. package/dist/assets/security.8e2a8a41.js +0 -1
  385. package/dist/assets/server.9f12ae3e.js +0 -114
  386. package/dist/assets/settings.149d1dff.js +0 -1
  387. package/dist/assets/settings.28abc1f0.js +0 -51
  388. package/dist/assets/sso.64b2717b.js +0 -22
  389. package/dist/assets/support.94e3734b.js +0 -1
  390. package/dist/assets/teams.9ff14f8f.js +0 -1
  391. package/dist/assets/themes.df7ec485.js +0 -5
  392. package/dist/assets/tr-TR.d7a7361f.js +0 -1
  393. package/dist/assets/translations.5191ab7c.js +0 -1
  394. package/dist/assets/triggers.1f1ace5f.js +0 -1
  395. package/dist/assets/ubuntu.f4c21886.js +0 -11
  396. package/dist/assets/uk-UA.473dd1c9.js +0 -1
  397. package/dist/assets/upgrades-migrations.15498a47.js +0 -1
  398. package/dist/assets/user-directory.47c8beb2.js +0 -1
  399. package/dist/assets/users-roles-permissions.005388fa.js +0 -1
  400. package/dist/assets/users.84251ab9.js +0 -252
  401. package/dist/assets/utilities.26e6a9e8.js +0 -74
  402. package/dist/assets/webhooks.4eeecb7d.js +0 -147
  403. package/dist/assets/webhooks.61b11e7d.js +0 -1
  404. package/dist/assets/zh-CN.c51e7308.js +0 -1
  405. package/dist/assets/zh-TW.8ef6cec8.js +0 -1
@@ -1,393 +0,0 @@
1
- import{a as n,o as r,b as h,w as a,g as s,e as l,B as e}from"./runtime-core.esm-bundler.b1f35d24.js";var o={};const d={class:"markdown-body"},p=s("blockquote",null,[s("p",null,[e("The JS SDK provides an intuitive interface for the Directus API from within a JavaScript-powered project (browsers and Node.js). The default implementation uses "),s("a",{href:"https://npmjs.com/axios",target:"_blank",rel:"noopener noreferrer"},"Axios"),e(" for transport and "),s("code",{class:""},"localStorage"),e(" for storing state.")])],-1),u=s("p",null,[s("div",{class:"table-of-contents"},[s("ul",null,[s("li",null,[s("a",{href:"#installation"},"Installation")]),s("li",null,[s("a",{href:"#usage"},"Usage")]),s("li",null,[s("a",{href:"#typescript"},"TypeScript")]),s("li",null,[s("a",{href:"#reference"},"Reference")]),s("li",null,[s("a",{href:"#auth"},"Auth")]),s("li",null,[s("a",{href:"#transport"},"Transport")]),s("li",null,[s("a",{href:"#storage"},"Storage")]),s("li",null,[s("a",{href:"#items"},"Items")]),s("li",null,[s("a",{href:"#activity"},"Activity")]),s("li",null,[s("a",{href:"#comments"},"Comments")]),s("li",null,[s("a",{href:"#collections"},"Collections")]),s("li",null,[s("a",{href:"#fields"},"Fields")]),s("li",null,[s("a",{href:"#files"},"Files")]),s("li",null,[s("a",{href:"#folders"},"Folders")]),s("li",null,[s("a",{href:"#permissions"},"Permissions")]),s("li",null,[s("a",{href:"#presets"},"Presets")]),s("li",null,[s("a",{href:"#relations"},"Relations")]),s("li",null,[s("a",{href:"#revisions"},"Revisions")]),s("li",null,[s("a",{href:"#roles"},"Roles")]),s("li",null,[s("a",{href:"#settings"},"Settings")]),s("li",null,[s("a",{href:"#server"},"Server")]),s("li",null,[s("a",{href:"#users"},"Users")]),s("li",null,[s("a",{href:"#utils"},"Utils")])])])],-1),j=s("h2",{id:"installation"},[e("Installation "),s("a",{class:"header-anchor",href:"#installation"},"#")],-1),m=s("pre",null,[s("code",{class:"language-bash"},`npm install @directus/sdk
2
- `)],-1),_=s("h2",{id:"usage"},[e("Usage "),s("a",{class:"header-anchor",href:"#usage"},"#")],-1),g=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
3
-
4
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://directus.example.com'"),e(`);
5
-
6
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-keyword"},"function"),e(),s("span",{class:"hljs-title"},"start"),e("("),s("span",{class:"hljs-params"}),e(") ")]),e(`{
7
- `),s("span",{class:"hljs-comment"},"// We don't need to authenticate if data is public"),e(`
8
- `),s("span",{class:"hljs-keyword"},"const"),e(" publicData = "),s("span",{class:"hljs-keyword"},"await"),e(" directus.items("),s("span",{class:"hljs-string"},"'public'"),e(").readByQuery({ "),s("span",{class:"hljs-attr"},"meta"),e(": "),s("span",{class:"hljs-string"},"'total_count'"),e(` });
9
-
10
- `),s("span",{class:"hljs-built_in"},"console"),e(`.log({
11
- `),s("span",{class:"hljs-attr"},"items"),e(`: publicData.data,
12
- `),s("span",{class:"hljs-attr"},"total"),e(`: publicData.meta.total_count,
13
- });
14
-
15
- `),s("span",{class:"hljs-comment"},"// But, we need to authenticate if data is private"),e(`
16
- `),s("span",{class:"hljs-keyword"},"let"),e(" authenticated = "),s("span",{class:"hljs-literal"},"false"),e(`;
17
-
18
- `),s("span",{class:"hljs-comment"},"// Try to authenticate with token if exists"),e(`
19
- `),s("span",{class:"hljs-keyword"},"await"),e(` directus.auth
20
- .refresh()
21
- .then(`),s("span",{class:"hljs-function"},"() =>"),e(` {
22
- authenticated = `),s("span",{class:"hljs-literal"},"true"),e(`;
23
- })
24
- .catch(`),s("span",{class:"hljs-function"},"() =>"),e(` {});
25
-
26
- `),s("span",{class:"hljs-comment"},"// Let's login in case we don't have token or it is invalid / expired"),e(`
27
- `),s("span",{class:"hljs-keyword"},"while"),e(` (!authenticated) {
28
- `),s("span",{class:"hljs-keyword"},"const"),e(" email = "),s("span",{class:"hljs-built_in"},"window"),e(".prompt("),s("span",{class:"hljs-string"},"'Email:'"),e(`);
29
- `),s("span",{class:"hljs-keyword"},"const"),e(" password = "),s("span",{class:"hljs-built_in"},"window"),e(".prompt("),s("span",{class:"hljs-string"},"'Password:'"),e(`);
30
-
31
- `),s("span",{class:"hljs-keyword"},"await"),e(` directus.auth
32
- .login({ email, password })
33
- .then(`),s("span",{class:"hljs-function"},"() =>"),e(` {
34
- authenticated = `),s("span",{class:"hljs-literal"},"true"),e(`;
35
- })
36
- .catch(`),s("span",{class:"hljs-function"},"() =>"),e(` {
37
- `),s("span",{class:"hljs-built_in"},"window"),e(".alert("),s("span",{class:"hljs-string"},"'Invalid credentials'"),e(`);
38
- });
39
- }
40
-
41
- `),s("span",{class:"hljs-comment"},"// After authentication, we can fetch the private data in case the user has access to it"),e(`
42
- `),s("span",{class:"hljs-keyword"},"const"),e(" privateData = "),s("span",{class:"hljs-keyword"},"await"),e(" directus.items("),s("span",{class:"hljs-string"},"'privateData'"),e(").readByQuery({ "),s("span",{class:"hljs-attr"},"meta"),e(": "),s("span",{class:"hljs-string"},"'total_count'"),e(` });
43
-
44
- `),s("span",{class:"hljs-built_in"},"console"),e(`.log({
45
- `),s("span",{class:"hljs-attr"},"items"),e(`: privateData.data,
46
- `),s("span",{class:"hljs-attr"},"total"),e(`: privateData.meta.total_count,
47
- });
48
- }
49
-
50
- start();
51
- `)])],-1),f=s("h2",{id:"typescript"},[e("TypeScript "),s("a",{class:"header-anchor",href:"#typescript"},"#")],-1),y=s("p",null,"Version >= 4.1",-1),w=s("p",null,"Although it\u2019s not required, it is recommended to use Typescript to have an easy development experience. This allows more detailed IDE suggestions for return types, sorting, filtering, etc.",-1),k=s("p",null,"To feed the SDK with your current schema, you need to pass it on the constructor.",-1),b=s("pre",null,[s("code",{class:"language-ts"},[s("span",{class:"hljs-keyword"},"type"),e(` BlogPost = {
52
- `),s("span",{class:"hljs-attr"},"id"),e(`: ID;
53
- title: `),s("span",{class:"hljs-built_in"},"string"),e(`;
54
- };
55
-
56
- `),s("span",{class:"hljs-keyword"},"type"),e(` BlogSettings = {
57
- `),s("span",{class:"hljs-attr"},"display_promotions"),e(": "),s("span",{class:"hljs-built_in"},"boolean"),e(`;
58
- };
59
-
60
- `),s("span",{class:"hljs-keyword"},"type"),e(` MyCollections = {
61
- `),s("span",{class:"hljs-attr"},"posts"),e(`: BlogPost;
62
- settings: BlogSettings;
63
- };
64
-
65
- `),s("span",{class:"hljs-comment"},"// This is how you feed custom type information to Directus."),e(`
66
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus<MyCollections>("),s("span",{class:"hljs-string"},"'http://url'"),e(`);
67
-
68
- `),s("span",{class:"hljs-comment"},"// ..."),e(`
69
-
70
- `),s("span",{class:"hljs-keyword"},"const"),e(" post = "),s("span",{class:"hljs-keyword"},"await"),e(" directus.items("),s("span",{class:"hljs-string"},"'posts'"),e(").readOne("),s("span",{class:"hljs-number"},"1"),e(`);
71
- `),s("span",{class:"hljs-comment"},"// typeof(post) is a partial BlogPost object"),e(`
72
-
73
- `),s("span",{class:"hljs-keyword"},"const"),e(" settings = "),s("span",{class:"hljs-keyword"},"await"),e(" posts.singleton("),s("span",{class:"hljs-string"},"'settings'"),e(`).read();
74
- `),s("span",{class:"hljs-comment"},"// typeof(settings) is a partial BlogSettings object"),e(`
75
- `)])],-1),v=s("p",null,"You can also extend the Directus system type information by providing type information for system collections as well.",-1),S=s("pre",null,[s("code",{class:"language-ts"},[s("span",{class:"hljs-keyword"},"import"),e(" { Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
76
-
77
- `),s("span",{class:"hljs-comment"},"// Custom fields added to Directus user collection."),e(`
78
- `),s("span",{class:"hljs-keyword"},"type"),e(` UserType = {
79
- `),s("span",{class:"hljs-attr"},"level"),e(": "),s("span",{class:"hljs-built_in"},"number"),e(`;
80
- experience: `),s("span",{class:"hljs-built_in"},"number"),e(`;
81
- };
82
-
83
- `),s("span",{class:"hljs-keyword"},"type"),e(` CustomTypes = {
84
- `),s("span",{class:"hljs-comment"},`/*
85
- This type will be merged with Directus user type.
86
- It's important that the naming matches a directus
87
- collection name exactly. Typos won't get caught here
88
- since SDK will assume it's a custom user collection.
89
- */`),e(`
90
- `),s("span",{class:"hljs-attr"},"directus_users"),e(`: UserType;
91
- };
92
-
93
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus<CustomTypes>("),s("span",{class:"hljs-string"},"'https://api.example.com'"),e(`);
94
-
95
- `),s("span",{class:"hljs-keyword"},"await"),e(` directus.auth.login({
96
- `),s("span",{class:"hljs-attr"},"email"),e(": "),s("span",{class:"hljs-string"},"'admin@example.com'"),e(`,
97
- `),s("span",{class:"hljs-attr"},"password"),e(": "),s("span",{class:"hljs-string"},"'password'"),e(`,
98
- });
99
-
100
- `),s("span",{class:"hljs-keyword"},"const"),e(" me = "),s("span",{class:"hljs-keyword"},"await"),e(` directus.users.me.read();
101
- `),s("span",{class:"hljs-comment"},"// typeof me = partial DirectusUser & UserType;"),e(`
102
-
103
- `),s("span",{class:"hljs-comment"},"// OK"),e(`
104
- me.level = `),s("span",{class:"hljs-number"},"42"),e(`;
105
-
106
- `),s("span",{class:"hljs-comment"},'// Error TS2322: Type "string" is not assignable to type "number".'),e(`
107
- me.experience = `),s("span",{class:"hljs-string"},"'high'"),e(`;
108
- `)])],-1),D=s("h2",{id:"reference"},[e("Reference "),s("a",{class:"header-anchor",href:"#reference"},"#")],-1),T=s("h3",{id:"constructor"},[e("Constructor "),s("a",{class:"header-anchor",href:"#constructor"},"#")],-1),x=s("p",null,[e("This is the starting point to use the SDK. You need to create an instance and invoke methods from it. In most cases a single instance is sufficient, but in case you need more, you need to define "),s("a",{href:"#options.storage.prefix"},[s("code",{class:""},"options.storage.prefix")]),e(".")],-1),I=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
109
-
110
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(` Directus(url, init);
111
- `)])],-1),A=s("ul",null,[s("li",null,[s("p",null,[s("code",{class:""},"url"),e(" [required] "),s("em",null,"String"),e(" - A string pointing to your Directus instance. E.g. "),s("code",{class:""},"https://admin.directus.io")]),s("p",null,[s("a",{name:"options"})])]),s("li",null,[s("p",null,[s("code",{class:""},"init"),e(" [optional] "),s("em",null,"Object"),e(" - Define settings that you want to customize .The possible options are:")]),s("p",null,[s("a",{name:"options.auth"})]),s("ul",null,[s("li",null,[s("p",null,[s("code",{class:""},"auth"),e(" [optional] "),s("em",null,"Object"),e(" - Defines settings you want to customize regarding "),s("a",{href:"#auth"},"authentication"),e(". The possible options are:")]),s("ul",null,[s("li",null,[s("p",null,[s("code",{class:""},"mode"),e(" [optional] "),s("em",null,"String"),e(" - Defines the mode you want to use for authentication. It can be "),s("code",{class:""},"'cookie'"),e(" for cookies or "),s("code",{class:""},"'json'"),e(" for JWT. Defaults to "),s("code",{class:""},"'cookie'"),e(" on browsers and "),s("code",{class:""},"'json'"),e(" otherwise. We recommend using cookies when possible to prevent any kind of attacks, mostly XSS.")]),s("p",null,[s("a",{name:"options.auth.autoRefresh"})])]),s("li",null,[s("p",null,[s("code",{class:""},"autoRefresh"),e(" [optional] "),s("em",null,"Boolean"),e(" - Tells SDK if it should handle refresh tokens automatically. Defaults to "),s("code",{class:""},"true"),e(".")])]),s("li",null,[s("p",null,[s("code",{class:""},"msRefreshBeforeExpires"),e(" [optional] "),s("em",null,"Number"),e(" - When "),s("code",{class:""},"autoRefresh"),e(" is enabled, this tells how many milliseconds before the refresh token expires and needs to be refreshed. Defaults to "),s("code",{class:""},"30000"),e(".")])]),s("li",null,[s("p",null,[s("code",{class:""},"staticToken"),e(" [optional] "),s("em",null,"String"),e(" - Defines the static token to use. It is not compatible with the options above since it does not refresh. Defaults to "),s("code",{class:""},"''"),e(" (no static token).")])])])])]),s("p",null,[s("a",{name:"options.storage"})]),s("ul",null,[s("li",null,[s("p",null,[s("code",{class:""},"storage"),e(" [optional] "),s("em",null,"Object"),e(" - Defines settings you want to customize regarding "),s("a",{href:"#storage"},"storage"),e(".")]),s("p",null,[s("a",{name:"options.storage.prefix"})]),s("ul",null,[s("li",null,[s("code",{class:""},"prefix"),e(" [optional] "),s("em",null,"String"),e(" - Defines the tokens prefix tokens that are saved. This should be fulfilled with different values when using multiple instances of SDK. Defaults to "),s("code",{class:""},"''"),e(" (no prefix).")]),s("li",null,[s("code",{class:""},"mode"),e(" [optional] "),s("em",null,"String"),e(" - Defines the storage location to be used to save tokens. Allowed values are "),s("code",{class:""},"LocalStorage"),e(" and "),s("code",{class:""},"MemoryStorage"),e(". Defaults to "),s("code",{class:""},"LocalStorage"),e(" on browsers and "),s("code",{class:""},"MemoryStorage"),e(" on Node.js. The mode "),s("code",{class:""},"LocalStorage"),e(" is not compatible with Node.js.")])])])]),s("p",null,[s("a",{name:"options.transport"})]),s("ul",null,[s("li",null,[s("code",{class:""},"transport"),e(" [optional] "),s("em",null,"Object"),e(" - Defines settings you want to customize regarding "),s("a",{href:"#transport"},"transport"),e(". "),s("ul",null,[s("li",null,[s("code",{class:""},"params"),e(" [optional] "),s("em",null,"Object"),e(" - Defines an object with keys and values to be passed as additional query string.")]),s("li",null,[s("code",{class:""},"headers"),e(" [optional] "),s("em",null,"Object"),e(" - Defines an object with keys and values to be passed as additional headers.")]),s("li",null,[s("code",{class:""},"onUploadProgress"),e(" [optional] "),s("em",null,[e("(event: "),s("a",{href:"https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent",target:"_blank",rel:"noopener noreferrer"},"ProgressEvent"),e(" => void)")]),e(" - Defines a callback function to indicate the upload progress.")])])])])])],-1),R=s("h2",{id:"auth"},[e("Auth "),s("a",{class:"header-anchor",href:"#auth"},"#")],-1),q=s("p",null,"Defines how authentication is handled by the SDK.",-1),B=s("h3",{id:"custom-implementation"},[e("Custom Implementation "),s("a",{class:"header-anchor",href:"#custom-implementation"},"#")],-1),M=s("p",null,[e("It is possible to provide a custom implementation by extending "),s("code",{class:""},"IAuth"),e(". While this could be useful for advanced usage, most use-cases do not need it.")],-1),C=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { IAuth, Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
112
-
113
- `),s("span",{class:"hljs-class"},[s("span",{class:"hljs-keyword"},"class"),e(),s("span",{class:"hljs-title"},"MyAuth"),e(),s("span",{class:"hljs-keyword"},"extends"),e(),s("span",{class:"hljs-title"},"IAuth"),e()]),e(`{
114
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"login"),e("("),s("span",{class:"hljs-params"}),e(")")]),e(` {
115
- `),s("span",{class:"hljs-keyword"},"return"),e(" { "),s("span",{class:"hljs-attr"},"access_token"),e(": "),s("span",{class:"hljs-string"},"''"),e(", "),s("span",{class:"hljs-attr"},"expires"),e(": "),s("span",{class:"hljs-number"},"0"),e(` };
116
- }
117
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"logout"),e("("),s("span",{class:"hljs-params"}),e(")")]),e(` {}
118
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"refresh"),e("("),s("span",{class:"hljs-params"}),e(")")]),e(` {
119
- `),s("span",{class:"hljs-keyword"},"return"),e(" { "),s("span",{class:"hljs-attr"},"access_token"),e(": "),s("span",{class:"hljs-string"},"''"),e(", "),s("span",{class:"hljs-attr"},"expires"),e(": "),s("span",{class:"hljs-number"},"0"),e(` };
120
- }
121
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"static"),e("("),s("span",{class:"hljs-params"}),e(")")]),e(` {
122
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-literal"},"true"),e(`;
123
- }
124
- }
125
-
126
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://directus.example.com'"),e(", { "),s("span",{class:"hljs-attr"},"auth"),e(": "),s("span",{class:"hljs-keyword"},"new"),e(` MyAuth() });
127
- `)])],-1),O=s("h3",{id:"directus-implementation"},[e("Directus Implementation "),s("a",{class:"header-anchor",href:"#directus-implementation"},"#")],-1),P=s("p",null,[e("By default, Directus creates an instance of "),s("code",{class:""},"Auth"),e(" which handles refresh tokens automatically. Check "),s("a",{href:"#options.auth"},[s("code",{class:""},"options.auth")]),e(" to see the available settings.")],-1),U=s("h3",{id:"get-current-token"},[e("Get current token "),s("a",{class:"header-anchor",href:"#get-current-token"},"#")],-1),E=s("pre",null,[s("code",{class:"language-ts"},[s("span",{class:"hljs-keyword"},"const"),e(` token = directus.auth.token;
128
- `)])],-1),N=s("h3",{id:"login"},[e("Login "),s("a",{class:"header-anchor",href:"#login"},"#")],-1),F=s("h4",{id:"with-credentials"},[e("With credentials "),s("a",{class:"header-anchor",href:"#with-credentials"},"#")],-1),K=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.auth.login({
129
- `),s("span",{class:"hljs-attr"},"email"),e(": "),s("span",{class:"hljs-string"},"'admin@example.com'"),e(`,
130
- `),s("span",{class:"hljs-attr"},"password"),e(": "),s("span",{class:"hljs-string"},"'d1r3ctu5'"),e(`,
131
- });
132
- `)])],-1),L=s("h4",{id:"with-static-tokens"},[e("With static tokens "),s("a",{class:"header-anchor",href:"#with-static-tokens"},"#")],-1),W=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.auth.static("),s("span",{class:"hljs-string"},"'static_token'"),e(`);
133
- `)])],-1),J=s("h3",{id:"refresh-auth-token"},[e("Refresh Auth Token "),s("a",{class:"header-anchor",href:"#refresh-auth-token"},"#")],-1),H=s("p",null,[e("By default, Directus will handle token refreshes. Although, you can handle this behaviour manually by setting "),s("a",{href:"#options.auth.autoRefresh"},[s("code",{class:""},"autoRefresh")]),e(" to "),s("code",{class:""},"false"),e(".")],-1),V=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.auth.refresh();
134
- `)])],-1),z={class:"tip hint"},G=s("div",{class:"hint-title"},"Developing Locally",-1),Y=e("If you\u2019re developing locally, you might not be able to refresh your auth token automatically in all browsers. This is because the default auth configuration requires secure cookies to be set, and not all browsers allow this for localhost. You can use a browser which does support this such as Firefox, or "),Q=e("disable secure cookies"),$=e("."),X=s("h3",{id:"logout"},[e("Logout "),s("a",{class:"header-anchor",href:"#logout"},"#")],-1),Z=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.auth.logout();
135
- `)])],-1),ss=s("h3",{id:"request-a-password-reset"},[e("Request a Password Reset "),s("a",{class:"header-anchor",href:"#request-a-password-reset"},"#")],-1),es=s("p",null,[e("By default, the address defined in "),s("code",{class:""},"PUBLIC_URL"),e(" on "),s("code",{class:""},".env"),e(" file is used for the link to the reset password page sent in the email:")],-1),as=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.auth.password.request("),s("span",{class:"hljs-string"},"'admin@example.com'"),e(`);
136
- `)])],-1),ts=s("p",null,"But a custom address can be passed as second argument:",-1),ns=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.auth.password.request(
137
- `),s("span",{class:"hljs-string"},"'admin@example.com'"),e(`,
138
- `),s("span",{class:"hljs-string"},"'https://myapp.com'"),e(),s("span",{class:"hljs-comment"},"// In this case, the link will be https://myapp.com?token=FEE0A..."),e(`
139
- );
140
- `)])],-1),ls=s("h3",{id:"reset-a-password"},[e("Reset a Password "),s("a",{class:"header-anchor",href:"#reset-a-password"},"#")],-1),os=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.auth.password.reset("),s("span",{class:"hljs-string"},"'abc.def.ghi'"),e(", "),s("span",{class:"hljs-string"},"'n3w-p455w0rd'"),e(`);
141
- `)])],-1),cs=s("p",null,[e("Note: The token passed in the first parameter is sent in an email to the user when using "),s("code",{class:""},"request()")],-1),is=s("h2",{id:"transport"},[e("Transport "),s("a",{class:"header-anchor",href:"#transport"},"#")],-1),rs=s("p",null,"The transport object abstracts how you communicate with Directus. Transports can be customized to use different HTTP libraries for example.",-1),hs=s("h3",{id:"custom-implementation-2"},[e("Custom Implementation "),s("a",{class:"header-anchor",href:"#custom-implementation-2"},"#")],-1),ds=s("p",null,[e("It is possible to provide a custom implementation by extending "),s("code",{class:""},"ITransport"),e(". While, this could be useful for advanced usage, it is not needed for most use-cases.")],-1),ps=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { ITransport, Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
142
-
143
- `),s("span",{class:"hljs-class"},[s("span",{class:"hljs-keyword"},"class"),e(),s("span",{class:"hljs-title"},"MyTransport"),e(),s("span",{class:"hljs-keyword"},"extends"),e(),s("span",{class:"hljs-title"},"ITransport"),e()]),e(`{
144
- `),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"buildResponse"),e("("),s("span",{class:"hljs-params"}),e(")")]),e(` {
145
- `),s("span",{class:"hljs-keyword"},"return"),e(` {
146
- `),s("span",{class:"hljs-attr"},"raw"),e(": "),s("span",{class:"hljs-string"},"''"),e(`,
147
- `),s("span",{class:"hljs-attr"},"data"),e(`: {},
148
- `),s("span",{class:"hljs-attr"},"status"),e(": "),s("span",{class:"hljs-number"},"0"),e(`,
149
- `),s("span",{class:"hljs-attr"},"headers"),e(`: {},
150
- };
151
- }
152
-
153
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"get"),e("("),s("span",{class:"hljs-params"},"path, options"),e(")")]),e(` {
154
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
155
- }
156
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"head"),e("("),s("span",{class:"hljs-params"},"path, options"),e(")")]),e(` {
157
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
158
- }
159
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"options"),e("("),s("span",{class:"hljs-params"},"path, options"),e(")")]),e(` {
160
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
161
- }
162
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"delete"),e("("),s("span",{class:"hljs-params"},"path, data, options"),e(")")]),e(` {
163
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
164
- }
165
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"post"),e("("),s("span",{class:"hljs-params"},"path, data, options"),e(")")]),e(` {
166
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
167
- }
168
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"put"),e("("),s("span",{class:"hljs-params"},"path, data, options"),e(")")]),e(` {
169
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
170
- }
171
- `),s("span",{class:"hljs-keyword"},"async"),e(),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"patch"),e("("),s("span",{class:"hljs-params"},"path, data, options"),e(")")]),e(` {
172
- `),s("span",{class:"hljs-keyword"},"return"),e(),s("span",{class:"hljs-built_in"},"this"),e(`.buildResponse();
173
- }
174
- }
175
-
176
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://directus.example.com'"),e(", { "),s("span",{class:"hljs-attr"},"transport"),e(": "),s("span",{class:"hljs-keyword"},"new"),e(` MyTransport() });
177
- `)])],-1),us=s("h3",{id:"directus-implementation-2"},[e("Directus Implementation "),s("a",{class:"header-anchor",href:"#directus-implementation-2"},"#")],-1),js=s("p",null,[e("By default, Directus creates an instance of "),s("code",{class:""},"Transport"),e(" which handles requests automatically. Check "),s("a",{href:"#options.transport"},[s("code",{class:""},"options.transport")]),e(" to see the available settings.")],-1),ms=s("p",null,[e("To make HTTP requests SDK uses "),s("code",{class:""},"axios"),e(" so it is compatible in both browsers and Node.js. Also, it is possible to handle upload progress (a downside of "),s("code",{class:""},"fetch"),e(").")],-1),_s=s("h2",{id:"storage"},[e("Storage "),s("a",{class:"header-anchor",href:"#storage"},"#")],-1),gs=s("p",null,"The storage is used to load and save token information.",-1),fs=s("h3",{id:"custom-implementation-3"},[e("Custom Implementation "),s("a",{class:"header-anchor",href:"#custom-implementation-3"},"#")],-1),ys=s("p",null,[e("It is possible to provide a custom implementation by extending "),s("code",{class:""},"BaseStorage"),e(". While, this could be useful for advanced usage, it is not needed for most use-cases.")],-1),ws=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { BaseStorage, Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
178
-
179
- `),s("span",{class:"hljs-class"},[s("span",{class:"hljs-keyword"},"class"),e(),s("span",{class:"hljs-title"},"SessionStorage"),e(),s("span",{class:"hljs-keyword"},"extends"),e(),s("span",{class:"hljs-title"},"BaseStorage"),e()]),e(`{
180
- `),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"get"),e("("),s("span",{class:"hljs-params"},"key"),e(")")]),e(` {
181
- `),s("span",{class:"hljs-keyword"},"return"),e(` sessionStorage.getItem(key);
182
- }
183
- `),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"set"),e("("),s("span",{class:"hljs-params"},"key, value"),e(")")]),e(` {
184
- `),s("span",{class:"hljs-keyword"},"return"),e(` sessionStorage.setItem(key, value);
185
- }
186
- `),s("span",{class:"hljs-function"},[s("span",{class:"hljs-title"},"delete"),e("("),s("span",{class:"hljs-params"},"key"),e(")")]),e(` {
187
- `),s("span",{class:"hljs-keyword"},"return"),e(` sessionStorage.removeItem(key);
188
- }
189
- }
190
-
191
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://directus.example.com'"),e(", { "),s("span",{class:"hljs-attr"},"storage"),e(": "),s("span",{class:"hljs-keyword"},"new"),e(` SessionStorage() });
192
- `)])],-1),ks=s("h3",{id:"directus-implementation-3"},[e("Directus Implementation "),s("a",{class:"header-anchor",href:"#directus-implementation-3"},"#")],-1),bs=s("p",null,[e("By default, Directus creates an instance of "),s("code",{class:""},"Storage"),e(" which handles store information automatically. Check "),s("a",{href:"#options.storage"},[s("code",{class:""},"options.storage")]),e(" to see the available settings.")],-1),vs=s("p",null,[e("SDK uses "),s("code",{class:""},"localStorage"),e(" on browsers and the memory itself on Node.js to save tokens. This behavior can be configured in "),s("a",{href:"#options.storage.mode"},[s("code",{class:""},"options.storage.mode")]),e(". The "),s("code",{class:""},"LocalStorage"),e(" is only available on browsers and the "),s("code",{class:""},"MemoryStorage"),e(" is not persistent, i.e., once you leave the tab or quit the process, you will need to authenticate again.")],-1),Ss=s("p",null,[e("If you want to use multiple instances of the SDK you should set a different "),s("a",{href:"#options.storage.prefix"},[s("code",{class:""},"prefix")]),e(" for each one.")],-1),Ds=s("h2",{id:"items"},[e("Items "),s("a",{class:"header-anchor",href:"#items"},"#")],-1),Ts=s("p",null,[e("You can get an instance of the item handler by providing the collection (and type, in the case of TypeScript) to the "),s("code",{class:""},"items"),e(" function. The following examples will use the "),s("code",{class:""},"Article"),e(" type.")],-1),xs=s("blockquote",null,[s("p",null,"JavaScript")],-1),Is=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-comment"},"// import { Directus, ID } from '@directus/sdk';"),e(`
193
- `),s("span",{class:"hljs-keyword"},"const"),e(" { Directus } = "),s("span",{class:"hljs-built_in"},"require"),e("("),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`);
194
-
195
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://directus.example.com'"),e(`);
196
-
197
- `),s("span",{class:"hljs-keyword"},"const"),e(" articles = directus.items("),s("span",{class:"hljs-string"},"'articles'"),e(`);
198
- `)])],-1),As=s("blockquote",null,[s("p",null,"TypeScript")],-1),Rs=s("pre",null,[s("code",{class:"language-ts"},[s("span",{class:"hljs-keyword"},"import"),e(" { Directus, ID } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'@directus/sdk'"),e(`;
199
-
200
- `),s("span",{class:"hljs-comment"},"// Map your collection structure based on its fields."),e(`
201
- `),s("span",{class:"hljs-keyword"},"type"),e(` Article = {
202
- `),s("span",{class:"hljs-attr"},"id"),e(`: ID;
203
- title: `),s("span",{class:"hljs-built_in"},"string"),e(`;
204
- body: `),s("span",{class:"hljs-built_in"},"string"),e(`;
205
- published: `),s("span",{class:"hljs-built_in"},"boolean"),e(`;
206
- };
207
-
208
- `),s("span",{class:"hljs-comment"},"// Map your collections to its respective types. The SDK will"),e(`
209
- `),s("span",{class:"hljs-comment"},"// infer its types based on usage later."),e(`
210
- `),s("span",{class:"hljs-keyword"},"type"),e(` MyBlog = {
211
- `),s("span",{class:"hljs-comment"},"// [collection_name]: typescript_type"),e(`
212
- `),s("span",{class:"hljs-attr"},"articles"),e(`: Article;
213
-
214
- `),s("span",{class:"hljs-comment"},"// You can also extend Directus collection. The naming has"),e(`
215
- `),s("span",{class:"hljs-comment"},"// to match a Directus system collection and it will be merged"),e(`
216
- `),s("span",{class:"hljs-comment"},"// into the system spec."),e(`
217
- directus_users: {
218
- `),s("span",{class:"hljs-attr"},"bio"),e(": "),s("span",{class:"hljs-built_in"},"string"),e(`;
219
- };
220
- };
221
-
222
- `),s("span",{class:"hljs-comment"},"// Let the SDK know about your collection types."),e(`
223
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus<MyBlog>("),s("span",{class:"hljs-string"},"'https://directus.myblog.com'"),e(`);
224
-
225
- `),s("span",{class:"hljs-comment"},'// typeof(article) is a partial "Article"'),e(`
226
- `),s("span",{class:"hljs-keyword"},"const"),e(" article = "),s("span",{class:"hljs-keyword"},"await"),e(" directus.items("),s("span",{class:"hljs-string"},"'articles'"),e(").readOne("),s("span",{class:"hljs-number"},"10"),e(`);
227
-
228
- `),s("span",{class:"hljs-comment"},'// Error TS2322: "hello" is not assignable to type "boolean".'),e(`
229
- `),s("span",{class:"hljs-comment"},"// post.published = 'hello';"),e(`
230
- `)])],-1),qs=s("h3",{id:"create-single-item"},[e("Create Single Item "),s("a",{class:"header-anchor",href:"#create-single-item"},"#")],-1),Bs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.createOne({
231
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'My New Article'"),e(`,
232
- });
233
- `)])],-1),Ms=s("h3",{id:"create-multiple-items"},[e("Create Multiple Items "),s("a",{class:"header-anchor",href:"#create-multiple-items"},"#")],-1),Cs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.createMany([
234
- {
235
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'My First Article'"),e(`,
236
- },
237
- {
238
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'My Second Article'"),e(`,
239
- },
240
- ]);
241
- `)])],-1),Os=s("h3",{id:"read-by-query"},[e("Read By Query "),s("a",{class:"header-anchor",href:"#read-by-query"},"#")],-1),Ps=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.readByQuery({
242
- `),s("span",{class:"hljs-attr"},"search"),e(": "),s("span",{class:"hljs-string"},"'Directus'"),e(`,
243
- `),s("span",{class:"hljs-attr"},"filter"),e(`: {
244
- `),s("span",{class:"hljs-attr"},"date_published"),e(`: {
245
- `),s("span",{class:"hljs-attr"},"_gte"),e(": "),s("span",{class:"hljs-string"},"'$NOW'"),e(`,
246
- },
247
- },
248
- });
249
- `)])],-1),Us=s("h3",{id:"read-all"},[e("Read All "),s("a",{class:"header-anchor",href:"#read-all"},"#")],-1),Es=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.readByQuery({
250
- `),s("span",{class:"hljs-comment"},"// By default API limits results to 100."),e(`
251
- `),s("span",{class:"hljs-comment"},"// With -1, it will return all results, but it may lead to performance degradation"),e(`
252
- `),s("span",{class:"hljs-comment"},"// for large result sets."),e(`
253
- `),s("span",{class:"hljs-attr"},"limit"),e(": -"),s("span",{class:"hljs-number"},"1"),e(`,
254
- });
255
- `)])],-1),Ns=s("h3",{id:"read-single-item"},[e("Read Single Item "),s("a",{class:"header-anchor",href:"#read-single-item"},"#")],-1),Fs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.readOne("),s("span",{class:"hljs-number"},"15"),e(`);
256
- `)])],-1),Ks=s("p",null,"Supports optional query:",-1),Ls=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.readOne("),s("span",{class:"hljs-number"},"15"),e(`, {
257
- `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'title'"),e(`],
258
- });
259
- `)])],-1),Ws=s("h3",{id:"read-multiple-items"},[e("Read Multiple Items "),s("a",{class:"header-anchor",href:"#read-multiple-items"},"#")],-1),Js=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.readMany(["),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"16"),e(", "),s("span",{class:"hljs-number"},"17"),e(`]);
260
- `)])],-1),Hs=s("p",null,"Supports optional query:",-1),Vs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.readMany(["),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"16"),e(", "),s("span",{class:"hljs-number"},"17"),e(`], {
261
- `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'title'"),e(`],
262
- });
263
- `)])],-1),zs=s("h3",{id:"update-single-item"},[e("Update Single Item "),s("a",{class:"header-anchor",href:"#update-single-item"},"#")],-1),Gs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.updateOne("),s("span",{class:"hljs-number"},"15"),e(`, {
264
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'This articles now has a different title'"),e(`,
265
- });
266
- `)])],-1),Ys=s("p",null,"Supports optional query:",-1),Qs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.updateOne(
267
- `),s("span",{class:"hljs-number"},"42"),e(`,
268
- {
269
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'This articles now has a similar title'"),e(`,
270
- },
271
- {
272
- `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'title'"),e(`],
273
- }
274
- );
275
- `)])],-1),$s=s("h3",{id:"update-multiple-items"},[e("Update Multiple Items "),s("a",{class:"header-anchor",href:"#update-multiple-items"},"#")],-1),Xs=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" articles.updateMany(["),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"42"),e(`], {
276
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'Both articles now have the same title'"),e(`,
277
- });
278
- `)])],-1),Zs=s("p",null,"Supports optional query:",-1),se=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.updateMany(
279
- [`),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"42"),e(`],
280
- {
281
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'Both articles now have the same title'"),e(`,
282
- },
283
- {
284
- `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'title'"),e(`],
285
- }
286
- );
287
- `)])],-1),ee=s("h3",{id:"delete"},[e("Delete "),s("a",{class:"header-anchor",href:"#delete"},"#")],-1),ae=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-comment"},"// One"),e(`
288
- `),s("span",{class:"hljs-keyword"},"await"),e(" articles.deleteOne("),s("span",{class:"hljs-number"},"15"),e(`);
289
-
290
- `),s("span",{class:"hljs-comment"},"// Multiple"),e(`
291
- `),s("span",{class:"hljs-keyword"},"await"),e(" articles.deleteMany(["),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"42"),e(`]);
292
- `)])],-1),te=s("h3",{id:"request-parameter-overrides"},[e("Request Parameter Overrides "),s("a",{class:"header-anchor",href:"#request-parameter-overrides"},"#")],-1),ne=s("p",null,[e("To override any of the axios request parameters, provide an additional parameter with a "),s("code",{class:""},"requestOptions"),e(" object:")],-1),le=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` articles.createOne(
293
- { `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'example'"),e(` },
294
- { `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'id'"),e(`] },
295
- {
296
- `),s("span",{class:"hljs-attr"},"requestOptions"),e(`: {
297
- `),s("span",{class:"hljs-attr"},"headers"),e(`: {
298
- `),s("span",{class:"hljs-string"},"'X-My-Custom-Header'"),e(": "),s("span",{class:"hljs-string"},"'example'"),e(`,
299
- },
300
- },
301
- }
302
- );
303
- `)])],-1),oe=s("h2",{id:"activity"},[e("Activity "),s("a",{class:"header-anchor",href:"#activity"},"#")],-1),ce=s("pre",null,[s("code",{class:"language-js"},`directus.activity;
304
- `)],-1),ie=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_activity")'),e(".")],-1),re=s("h2",{id:"comments"},[e("Comments "),s("a",{class:"header-anchor",href:"#comments"},"#")],-1),he=s("pre",null,[s("code",{class:"language-js"},`directus.comments;
305
- `)],-1),de=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_comments")'),e(".")],-1),pe=s("h2",{id:"collections"},[e("Collections "),s("a",{class:"header-anchor",href:"#collections"},"#")],-1),ue=s("pre",null,[s("code",{class:"language-js"},`directus.collections;
306
- `)],-1),je=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_collections")'),e(".")],-1),me=s("h2",{id:"fields"},[e("Fields "),s("a",{class:"header-anchor",href:"#fields"},"#")],-1),_e=s("pre",null,[s("code",{class:"language-js"},`directus.fields;
307
- `)],-1),ge=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_fields")'),e(".")],-1),fe=s("h2",{id:"files"},[e("Files "),s("a",{class:"header-anchor",href:"#files"},"#")],-1),ye=s("pre",null,[s("code",{class:"language-js"},`directus.files;
308
- `)],-1),we=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_files")'),e(".")],-1),ke=s("h3",{id:"uploading-a-file"},[e("Uploading a file "),s("a",{class:"header-anchor",href:"#uploading-a-file"},"#")],-1),be=s("p",null,[e("To upload a file you will need to send a "),s("code",{class:""},"multipart/form-data"),e(" as body. On browser side you do so:")],-1),ve=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-comment"},"/* index.js */"),e(`
309
- `),s("span",{class:"hljs-keyword"},"import"),e(" { Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'https://unpkg.com/@directus/sdk@latest/dist/sdk.esm.min.js'"),e(`;
310
-
311
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://localhost:8055'"),e(`, {
312
- `),s("span",{class:"hljs-attr"},"auth"),e(`: {
313
- `),s("span",{class:"hljs-attr"},"staticToken"),e(": "),s("span",{class:"hljs-string"},"'STATIC_TOKEN'"),e(", "),s("span",{class:"hljs-comment"},"// If you want to use a static token, otherwise check below how you can use email and password."),e(`
314
- },
315
- });
316
-
317
- `),s("span",{class:"hljs-comment"},"// await directus.auth.login({ email, password }) // If you want to use email and password. You should remove the staticToken above"),e(`
318
-
319
- `),s("span",{class:"hljs-keyword"},"const"),e(" form = "),s("span",{class:"hljs-built_in"},"document"),e(".querySelector("),s("span",{class:"hljs-string"},"'#upload-file'"),e(`);
320
-
321
- `),s("span",{class:"hljs-keyword"},"if"),e(" (form && form "),s("span",{class:"hljs-keyword"},"instanceof"),e(` HTMLFormElement) {
322
- form.addEventListener(`),s("span",{class:"hljs-string"},"'submit'"),e(", "),s("span",{class:"hljs-keyword"},"async"),e(` (event) => {
323
- event.preventDefault();
324
-
325
- `),s("span",{class:"hljs-keyword"},"const"),e(" form = "),s("span",{class:"hljs-keyword"},"new"),e(` FormData(event.target);
326
- `),s("span",{class:"hljs-keyword"},"await"),e(` directus.files.createOne(form);
327
- });
328
- }
329
- `)])],-1),Se=s("pre",null,[s("code",{class:"language-html"},[s("span",{class:"hljs-comment"},"<!-- index.html -->"),e(`
330
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"head"),e(">")]),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"head"),e(">")]),e(`
331
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"body"),e(">")]),e(`
332
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"form"),e(),s("span",{class:"hljs-attr"},"id"),e("="),s("span",{class:"hljs-string"},'"upload-file"'),e(">")]),e(`
333
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"input"),e(),s("span",{class:"hljs-attr"},"type"),e("="),s("span",{class:"hljs-string"},'"text"'),e(),s("span",{class:"hljs-attr"},"name"),e("="),s("span",{class:"hljs-string"},'"title"'),e(" />")]),e(`
334
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"input"),e(),s("span",{class:"hljs-attr"},"type"),e("="),s("span",{class:"hljs-string"},'"file"'),e(),s("span",{class:"hljs-attr"},"name"),e("="),s("span",{class:"hljs-string"},'"file"'),e(" />")]),e(`
335
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"button"),e(">")]),e("Send"),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"button"),e(">")]),e(`
336
- `),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"form"),e(">")]),e(`
337
- `),s("span",{class:"hljs-tag"},[e("<"),s("span",{class:"hljs-name"},"script"),e(),s("span",{class:"hljs-attr"},"src"),e("="),s("span",{class:"hljs-string"},'"/index.js"'),e(),s("span",{class:"hljs-attr"},"type"),e("="),s("span",{class:"hljs-string"},'"module"'),e(">")]),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"script"),e(">")]),e(`
338
- `),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"body"),e(">")]),e(`
339
- `),s("span",{class:"hljs-tag"},[e("</"),s("span",{class:"hljs-name"},"html"),e(">")]),e(`
340
- `)])],-1),De=s("h4",{id:"nodejs-usage"},[e("NodeJS usage "),s("a",{class:"header-anchor",href:"#nodejs-usage"},"#")],-1),Te=s("p",null,"When uploading a file from a NodeJS environment, you\u2019ll have to override the headers to ensure the correct boundary is set:",-1),xe=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"import"),e(" { Directus } "),s("span",{class:"hljs-keyword"},"from"),e(),s("span",{class:"hljs-string"},"'https://unpkg.com/@directus/sdk@latest/dist/sdk.esm.min.js'"),e(`;
341
-
342
- `),s("span",{class:"hljs-keyword"},"const"),e(" directus = "),s("span",{class:"hljs-keyword"},"new"),e(" Directus("),s("span",{class:"hljs-string"},"'http://localhost:8055'"),e(`, {
343
- `),s("span",{class:"hljs-attr"},"auth"),e(`: {
344
- `),s("span",{class:"hljs-attr"},"staticToken"),e(": "),s("span",{class:"hljs-string"},"'STATIC_TOKEN'"),e(", "),s("span",{class:"hljs-comment"},"// If you want to use a static token, otherwise check below how you can use email and password."),e(`
345
- },
346
- });
347
-
348
- `),s("span",{class:"hljs-keyword"},"const"),e(" form = "),s("span",{class:"hljs-keyword"},"new"),e(` FormData();
349
- form.append(`),s("span",{class:"hljs-string"},'"file"'),e(", fs.createReadStream("),s("span",{class:"hljs-string"},'"./to_upload.jpeg"'),e(`));
350
-
351
- `),s("span",{class:"hljs-keyword"},"const"),e(" fileId = "),s("span",{class:"hljs-keyword"},"await"),e(` directus.files.createOne(form, {}, {
352
- `),s("span",{class:"hljs-attr"},"requestOptions"),e(`: {
353
- `),s("span",{class:"hljs-attr"},"headers"),e(`: {
354
- ...form.getHeaders()
355
- }
356
- }
357
- );
358
- `)])],-1),Ie=s("h3",{id:"importing-a-file"},[e("Importing a file "),s("a",{class:"header-anchor",href:"#importing-a-file"},"#")],-1),Ae=e("Example of "),Re=e("importing a file from a URL"),qe=e(":"),Be=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.files.import({
359
- `),s("span",{class:"hljs-attr"},"url"),e(": "),s("span",{class:"hljs-string"},"'http://www.example.com/example-image.jpg'"),e(`,
360
- });
361
- `)])],-1),Me=s("p",null,"Example of importing file with custom data:",-1),Ce=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.files.import({
362
- `),s("span",{class:"hljs-attr"},"url"),e(": "),s("span",{class:"hljs-string"},"'http://www.example.com/example-image.jpg'"),e(`,
363
- `),s("span",{class:"hljs-attr"},"data"),e(`: {
364
- `),s("span",{class:"hljs-attr"},"title"),e(": "),s("span",{class:"hljs-string"},"'My Custom File'"),e(`,
365
- },
366
- });
367
- `)])],-1),Oe=s("h2",{id:"folders"},[e("Folders "),s("a",{class:"header-anchor",href:"#folders"},"#")],-1),Pe=s("pre",null,[s("code",{class:"language-js"},`directus.folders;
368
- `)],-1),Ue=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_folders")'),e(".")],-1),Ee=s("h2",{id:"permissions"},[e("Permissions "),s("a",{class:"header-anchor",href:"#permissions"},"#")],-1),Ne=s("pre",null,[s("code",{class:"language-js"},`directus.permissions;
369
- `)],-1),Fe=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_permissions")'),e(".")],-1),Ke=s("h2",{id:"presets"},[e("Presets "),s("a",{class:"header-anchor",href:"#presets"},"#")],-1),Le=s("pre",null,[s("code",{class:"language-js"},`directus.presets;
370
- `)],-1),We=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_presets")'),e(".")],-1),Je=s("h2",{id:"relations"},[e("Relations "),s("a",{class:"header-anchor",href:"#relations"},"#")],-1),He=s("pre",null,[s("code",{class:"language-js"},`directus.relations;
371
- `)],-1),Ve=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_relations")'),e(".")],-1),ze=s("h2",{id:"revisions"},[e("Revisions "),s("a",{class:"header-anchor",href:"#revisions"},"#")],-1),Ge=s("pre",null,[s("code",{class:"language-js"},`directus.revisions;
372
- `)],-1),Ye=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_revisions")'),e(".")],-1),Qe=s("h2",{id:"roles"},[e("Roles "),s("a",{class:"header-anchor",href:"#roles"},"#")],-1),$e=s("pre",null,[s("code",{class:"language-js"},`directus.roles;
373
- `)],-1),Xe=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_roles")'),e(".")],-1),Ze=s("h2",{id:"settings"},[e("Settings "),s("a",{class:"header-anchor",href:"#settings"},"#")],-1),sa=s("pre",null,[s("code",{class:"language-js"},`directus.settings;
374
- `)],-1),ea=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_settings")'),e(".")],-1),aa=s("h2",{id:"server"},[e("Server "),s("a",{class:"header-anchor",href:"#server"},"#")],-1),ta=s("h3",{id:"ping-the-server"},[e("Ping the Server "),s("a",{class:"header-anchor",href:"#ping-the-server"},"#")],-1),na=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.server.ping();
375
- `)])],-1),la=s("h3",{id:"get-server%2Fproject-info"},[e("Get Server/Project Info "),s("a",{class:"header-anchor",href:"#get-server%2Fproject-info"},"#")],-1),oa=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.server.info();
376
- `)])],-1),ca=s("h2",{id:"users"},[e("Users "),s("a",{class:"header-anchor",href:"#users"},"#")],-1),ia=s("pre",null,[s("code",{class:"language-js"},`directus.users;
377
- `)],-1),ra=s("p",null,[e("Same methods as "),s("code",{class:""},'directus.items("directus_users")'),e(", and:")],-1),ha=s("h3",{id:"invite-a-new-user"},[e("Invite a New User "),s("a",{class:"header-anchor",href:"#invite-a-new-user"},"#")],-1),da=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.invites.send("),s("span",{class:"hljs-string"},"'admin@example.com'"),e(", "),s("span",{class:"hljs-string"},"'fe38136e-52f7-4622-8498-112b8a32a1e2'"),e(`);
378
- `)])],-1),pa=s("p",null,"The second parameter is the role of the user",-1),ua=s("h3",{id:"accept-a-user-invite"},[e("Accept a User Invite "),s("a",{class:"header-anchor",href:"#accept-a-user-invite"},"#")],-1),ja=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.invites.accept("),s("span",{class:"hljs-string"},"'<accept-token>'"),e(", "),s("span",{class:"hljs-string"},"'n3w-p455w0rd'"),e(`);
379
- `)])],-1),ma=s("p",null,"The provided token is sent to the user\u2019s email",-1),_a=s("h3",{id:"enable-two-factor-authentication"},[e("Enable Two-Factor Authentication "),s("a",{class:"header-anchor",href:"#enable-two-factor-authentication"},"#")],-1),ga=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.tfa.enable("),s("span",{class:"hljs-string"},"'my-password'"),e(`);
380
- `)])],-1),fa=s("h3",{id:"disable-two-factor-authentication"},[e("Disable Two-Factor Authentication "),s("a",{class:"header-anchor",href:"#disable-two-factor-authentication"},"#")],-1),ya=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.tfa.disable("),s("span",{class:"hljs-string"},"'691402'"),e(`);
381
- `)])],-1),wa=s("h3",{id:"get-the-current-user"},[e("Get the Current User "),s("a",{class:"header-anchor",href:"#get-the-current-user"},"#")],-1),ka=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.users.me.read();
382
- `)])],-1),ba=s("p",null,"Supports optional query:",-1),va=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.users.me.read({
383
- `),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'last_access'"),e(`],
384
- });
385
- `)])],-1),Sa=s("h3",{id:"update-the-current-users"},[e("Update the Current Users "),s("a",{class:"header-anchor",href:"#update-the-current-users"},"#")],-1),Da=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.me.update({ "),s("span",{class:"hljs-attr"},"first_name"),e(": "),s("span",{class:"hljs-string"},"'Admin'"),e(` });
386
- `)])],-1),Ta=s("p",null,"Supports optional query:",-1),xa=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.users.me.update({ "),s("span",{class:"hljs-attr"},"first_name"),e(": "),s("span",{class:"hljs-string"},"'Admin'"),e(" }, { "),s("span",{class:"hljs-attr"},"fields"),e(": ["),s("span",{class:"hljs-string"},"'last_access'"),e(`] });
387
- `)])],-1),Ia=s("h2",{id:"utils"},[e("Utils "),s("a",{class:"header-anchor",href:"#utils"},"#")],-1),Aa=s("h3",{id:"get-a-random-string"},[e("Get a Random String "),s("a",{class:"header-anchor",href:"#get-a-random-string"},"#")],-1),Ra=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(` directus.utils.random.string();
388
- `)])],-1),qa=s("p",null,[e("Supports an optional "),s("code",{class:""},"length"),e(" (defaults to 32):")],-1),Ba=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.utils.random.string("),s("span",{class:"hljs-number"},"50"),e(`);
389
- `)])],-1),Ma=s("h3",{id:"generate-a-hash-for-a-given-value"},[e("Generate a Hash for a Given Value "),s("a",{class:"header-anchor",href:"#generate-a-hash-for-a-given-value"},"#")],-1),Ca=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.utils.hash.generate("),s("span",{class:"hljs-string"},"'My String'"),e(`);
390
- `)])],-1),Oa=s("h3",{id:"verify-if-a-hash-is-valid"},[e("Verify if a Hash is Valid "),s("a",{class:"header-anchor",href:"#verify-if-a-hash-is-valid"},"#")],-1),Pa=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.utils.hash.verify("),s("span",{class:"hljs-string"},"'My String'"),e(", "),s("span",{class:"hljs-string"},"'$argon2i$v=19$m=4096,t=3,p=1$A5uogJh'"),e(`);
391
- `)])],-1),Ua=s("h3",{id:"sort-items-in-a-collection"},[e("Sort Items in a Collection "),s("a",{class:"header-anchor",href:"#sort-items-in-a-collection"},"#")],-1),Ea=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.utils.sort("),s("span",{class:"hljs-string"},"'articles'"),e(", "),s("span",{class:"hljs-number"},"15"),e(", "),s("span",{class:"hljs-number"},"42"),e(`);
392
- `)])],-1),Na=s("p",null,[e("This will move item "),s("code",{class:""},"15"),e(" to the position of item "),s("code",{class:""},"42"),e(", and move everything in between one \u201Cslot\u201D up.")],-1),Fa=s("h3",{id:"revert-to-a-previous-revision"},[e("Revert to a Previous Revision "),s("a",{class:"header-anchor",href:"#revert-to-a-previous-revision"},"#")],-1),Ka=s("pre",null,[s("code",{class:"language-js"},[s("span",{class:"hljs-keyword"},"await"),e(" directus.utils.revert("),s("span",{class:"hljs-number"},"451"),e(`);
393
- `)])],-1),La=s("p",null,"Note: The key passed is the primary key of the revision you\u2019d like to apply.",-1),Wa=s("hr",null,null,-1),Ja={title:"JavaScript SDK",modularExtension:!1},Ha={name:"sdk",setup(Va,{expose:c}){return c({frontmatter:{title:"JavaScript SDK",modularExtension:!1}}),(za,Ga)=>{const t=n("router-link"),i=n("docswrapper");return r(),h(i,{frontmatter:Ja},{default:a(()=>[s("div",d,[p,u,j,m,_,g,f,y,w,k,b,v,S,D,T,x,I,A,R,q,B,M,C,O,P,U,E,N,F,K,L,W,J,H,V,s("div",z,[G,s("p",null,[Y,l(t,{to:"/docs/configuration/config-options/#security"},{default:a(()=>[Q]),_:1}),$])]),X,Z,ss,es,as,ts,ns,ls,os,cs,is,rs,hs,ds,ps,us,js,ms,_s,gs,fs,ys,ws,ks,bs,vs,Ss,Ds,Ts,xs,Is,As,Rs,qs,Bs,Ms,Cs,Os,Ps,Us,Es,Ns,Fs,Ks,Ls,Ws,Js,Hs,Vs,zs,Gs,Ys,Qs,$s,Xs,Zs,se,ee,ae,te,ne,le,oe,ce,ie,re,he,de,pe,ue,je,me,_e,ge,fe,ye,we,ke,be,ve,Se,De,Te,xe,Ie,s("p",null,[Ae,l(t,{to:"/docs/reference/files/#import-a-file"},{default:a(()=>[Re]),_:1}),qe]),Be,Me,Ce,Oe,Pe,Ue,Ee,Ne,Fe,Ke,Le,We,Je,He,Ve,ze,Ge,Ye,Qe,$e,Xe,Ze,sa,ea,aa,ta,na,la,oa,ca,ia,ra,ha,da,pa,ua,ja,ma,_a,ga,fa,ya,wa,ka,ba,va,Sa,Da,Ta,xa,Ia,Aa,Ra,qa,Ba,Ma,Ca,Oa,Pa,Ua,Ea,Na,Fa,Ka,La,Wa])]),_:1})}}};typeof o=="function"&&o(Ha);export{Ha as default,Ja as frontmatter};
@@ -1 +0,0 @@
1
- import{a as i,o as c,b as n,w as o,g as e,B as a}from"./runtime-core.esm-bundler.b1f35d24.js";var r={};const d=e("div",{class:"markdown-body"},[e("blockquote",null,[e("p",null,"TK")]),e("h2",{id:"https"},[a("HTTPS "),e("a",{class:"header-anchor",href:"#https"},"#")]),e("h2",{id:"password-salting%2Fhashing%2Falgorithm-%26-password-policy"},[a("Password Salting/Hashing/Algorithm & Password Policy "),e("a",{class:"header-anchor",href:"#password-salting%2Fhashing%2Falgorithm-%26-password-policy"},"#")]),e("h2",{id:"static-tokens"},[a("Static Tokens "),e("a",{class:"header-anchor",href:"#static-tokens"},"#")]),e("h2",{id:"encrypted-fields-%26-encrypted-database"},[a("Encrypted Fields & Encrypted Database "),e("a",{class:"header-anchor",href:"#encrypted-fields-%26-encrypted-database"},"#")]),e("h2",{id:"private-file-links"},[a("Private File Links "),e("a",{class:"header-anchor",href:"#private-file-links"},"#")]),e("h2",{id:"mfa-(required)-%26-sso"},[a("MFA (Required) & SSO "),e("a",{class:"header-anchor",href:"#mfa-(required)-%26-sso"},"#")]),e("h2",{id:"granular-access-control-%26-ip-white-listing-%26-app-access"},[a("Granular Access Control & IP WHite-Listing & App Access "),e("a",{class:"header-anchor",href:"#granular-access-control-%26-ip-white-listing-%26-app-access"},"#")]),e("h2",{id:"rate-limiting"},[a("Rate Limiting "),e("a",{class:"header-anchor",href:"#rate-limiting"},"#")]),e("h2",{id:"encrypted"},[a("Encrypted "),e("a",{class:"header-anchor",href:"#encrypted"},"#")]),e("h2",{id:"parameterized-database-queries"},[a("Parameterized Database Queries "),e("a",{class:"header-anchor",href:"#parameterized-database-queries"},"#")])],-1),l={title:"Security",modularExtension:!1},h={name:"security",setup(p,{expose:s}){return s({frontmatter:{title:"Security",modularExtension:!1}}),(f,u)=>{const t=i("docswrapper");return c(),n(t,{frontmatter:l},{default:o(()=>[d]),_:1})}}};typeof r=="function"&&r(h);export{h as default,l as frontmatter};