Commit Graph

26 Commits

Author SHA1 Message Date
José Varela
de5b34d87b SDK: split readMany into itself and readByQuery (#11204)
* split readMany into self and readByQuery

* add tests

* run tests only on `test` folder

* fix docs

* fix in `cli`
2022-02-16 09:52:42 -05:00
Josh Dean
7497676794 Documentation Polishing (#11267)
* glossary.md small typo

Documentation

* update docs glossary.md type

Documentation

* docs config-options.md typo

Documentation

* Update relationships.md

Documentation small typo

* Update relationships.md

documentation, small typo

* Update relationships.md

Documentation typo. I believe line 261 is an alias for the junction table.

* Update relationships.md

Docs Typo

* Update relationships.md

Docs Typos

* Update data-model.md

Docs Typo.

* Update sso.md

docs typo

* Update introduction.md

docs typo

* Update query.md

example isn't "on right" when read on mobile.

* Update introduction.md

Docs - confusing phrasing. Hope this helps.

* Update sdk.md

Unfinished sentence removed. Likely a copy paste from a discussion of instance prefixes.

* Update activity.md

Docs extra word
2022-01-25 13:06:10 -05:00
Brainslug
595eb696ea Remove reference to readByQuery (#11188)
Updated order of examples and aligned titles to match
Added missing updateOne example
2022-01-20 15:24:40 -05:00
Azri Kahar
ed70219ecb fix Read By Query example code (#10943) 2022-01-10 04:15:26 +00:00
José Varela
fd885b14ea Docs(SDK): use top level await upload (#10827) 2022-01-03 15:04:07 +00:00
Azri Kahar
f4720f6ed2 minor fix for closing tag in file upload example (#10816) 2022-01-03 06:42:41 +00:00
José Varela
865a69a359 Add example of upload file on SDK (#10787) 2021-12-31 12:06:04 +00:00
Joe Innes
4d4c7de74d Add a tip explaining HTTP Only cookies issue (#9574)
* Add a tip explaining HTTP Only cookies issue

Watching the Discord, I see this issue coming up fairly frequently, when someone is developing a front end app locally, and their app suddenly stops working with the message

> Error: "refresh_token" is required in either the JSON payload or Cookie

This tip explains the cause of the issue, and two different workarounds.

* use relative link

Co-authored-by: Azri Kahar <azrikahar@outlook.com>
2021-12-01 17:21:01 -05:00
José Varela
7d44a60e32 Improve example (#9891) 2021-11-24 16:07:25 -05:00
José Varela
ffe6b51387 Docs SDK: BaseStorage instead of IStorage (#9865)
example using SessionStorage
2021-11-24 16:06:58 -05:00
Azri Kahar
82e62bc113 Minor docs fixes (#9553) 2021-11-06 16:04:22 -04:00
José Varela
21dbe06e4b fix docs about sdk refactor (#9486) 2021-11-04 15:50:31 -04:00
José Varela
23f6baa4db SDK: refactor constructors (#9080)
* refactor: more intuitive interfaces

* refactor: simpler refresh
before: on every request we were debouncing a refresh request
after: call refresh only once before now() + 'expires'

* refactor: prefix on base storage

* fixup! refactor: simpler refresh before: on every request we were debouncing a refresh request after: call refresh only once before now() + 'expires'

* refactor: simpler axios transport
before: handle auth headers
after: auth headers are handled on directus instance

* refactor: simpler usage of Directus constructor

* fixup! refactor: simpler refresh before: on every request we were debouncing a refresh request after: call refresh only once before now() + 'expires'

* refactor: fix tests based on previous changes

* refactor: better auth constructor
before: depends on SDK instance
after: depends on Transport and Storage instance

* accept staticToken from auth

* make transport and storage as optional on options

* fix type auth refresh

* simplify transport

* fix test for previous changes

* improve auth class

* revert some IAuth props because tests

* allow to force memory of localstorage on storage

* add tests for previous change

* document everything and simplify some things

* fix override headers on request

* better name typing

* fix private axios

* removed boolean from CLI auth.refresh()

* fix missing url in some examples

* soem grammar updates

Co-authored-by: Jay Cammarano <jay.cammarano@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-04 13:30:30 -04:00
José Varela
45b8c12dee docs: sdk auth.password.request url argument (#7757) 2021-09-01 12:00:26 -04:00
Rijk van Zanten
ee9b7d916b Remove advanced example (#7174)
Fixes #7112
2021-08-04 01:18:35 +02:00
Rijk van Zanten
5f7dce54e2 Use stricter Vue eslint setting (#6833) 2021-07-15 13:49:59 -04:00
WoLfulus
043ae13e40 Adds request and response interceptors on Axios transport (#6538) 2021-06-28 18:44:38 +00:00
Nicola Krumschmidt
051df415df Fix extensions (#6377)
* Add support for npm extensions

* Allow extensions to import vue from the main app

* Bundle app extensions on server startup

* Fix return type of useLayoutState

* Add shared package

* Add extension-sdk package

* Add type declaration files to allow deep import of shared package

* Add extension loading to shared

* Refactor extension loading to use shared package

* Remove app bundle newline replacement

* Fix extension loading in development

* Rename extension entrypoints

* Update extension build instructions

* Remove vite auto-replacement workaround

* Update package-lock.json

* Remove newline from generated extension entrypoint

* Update package-lock.json

* Build shared package as cjs and esm

* Move useLayoutState composable to shared

* Reverse vite base env check

* Share useLayoutState composable through extension-sdk

* Update layout docs

* Update package versions

* Small cleanup

* Fix layout docs

* Fix imports

* Add nickrum to codeowners

* Fix typo

* Add 'em to vite config too

* Fix email

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-06-23 12:43:06 -04:00
Martin Emmert
fb715cc66a docs: update sdk doc with note on using multiple instances (#6311) 2021-06-16 10:34:40 -04:00
João
b20a394f51 Update SDK docs and code to match API (#5437) 2021-05-03 14:46:05 -04:00
Pascal Jufer
f19cf1070c Fix some points in SDK documentation (#5273)
* Change confusing statement about storage adapter

Mainly used to store auth token / expiration
Refresh tokens only in JSON mode

* Remove 'time' option in 1st example since described in 2nd example

* Add infos about options.refresh on Auth
2021-04-27 09:57:49 -04:00
João
63c45a6ae4 Fix SDK docs example 2021-04-26 11:37:25 -03:00
João
af13cfe18e Change token and auth handling behavior. (#5203)
* change tokens and authentication handling/refresh

* update sdk docs
2021-04-22 17:54:30 -04:00
WoLfulus
a5564ce4d1 update sdk docs (#4881) 2021-04-07 10:11:58 -04:00
WoLfulus
3db8b9a1b3 Updated SDK docs and typing fixes (#4787)
* typing fixes

* docs update

* ignore compiled test dir

* use top level await syntax
2021-03-31 14:43:29 -04:00
WoLfulus
3c1204b928 SDK 2.0 (#4510)
* add new sdk

* update version

* fixes and sdk documentation

* typing updates, documentation

* added missing endpoints

* targeting minified version for unpkg

* removed unused types file

* fixed non minified versions

* fix sdk exports

* fix the fix

* Remove old sdk

* Remove old sdk docs

* Install types for Jest, add npm test

* Rely on npm exclusively

* Remove examples folder

* Move typescript down

* Update sdk.md

* added auto refresh and requested changes

added more http test calls
fixed typing issue in customized types

* remove unused endpoint

* updated docs

* added singletons, fixed typing issues, added password handlers

* rename graphql function and fixed system endpoint

* Remove unused imports, fix build

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Ben Haynes <ben@rngr.org>
2021-03-30 18:23:23 -04:00