@mojaksebastian/allegro-client 1.0.8 → 1.0.9
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.
Potentially problematic release.
This version of @mojaksebastian/allegro-client might be problematic. Click here for more details.
- package/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install @mojaksebastian/allegro-client
|
|
|
24
24
|
## Szybki Start
|
|
25
25
|
|
|
26
26
|
Poniższy przykład prezentuje podstawową konfigurację z wykorzystaniem strategii DeviceFlow oraz domyślnego magazynu plikowego.
|
|
27
|
-
```
|
|
27
|
+
```ts
|
|
28
28
|
import AllegroClient from "@mojaksebastian/allegro-client";
|
|
29
29
|
|
|
30
30
|
const config = {
|
|
@@ -56,7 +56,6 @@ initialize();
|
|
|
56
56
|
Architektura biblioteki pozwala na wstrzyknięcie własnej klasy zarządzającej danymi sesyjnymi. Jest to rozwiązanie zalecane dla środowisk rozproszonych i bezstanowych (Serverless).
|
|
57
57
|
Przykład: Integracja z Redis
|
|
58
58
|
```TypeScript
|
|
59
|
-
|
|
60
59
|
import { ITokenStorage, IAllegroTokens } from "@mojaksebastian/allegro-client";
|
|
61
60
|
import { createClient } from "redis";
|
|
62
61
|
|
|
@@ -95,11 +94,12 @@ const allegro = new AllegroClient({
|
|
|
95
94
|
|
|
96
95
|
### Interfejs konfiguracji (IAllegroClientConfig)
|
|
97
96
|
|
|
98
|
-
Właściwość
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
| Właściwość | Typ | Wymagane | Opis |
|
|
98
|
+
| :--- | :--- | :--- | :--- |
|
|
99
|
+
| credentials | IAuthCredentials | Tak | Obiekt zawierający clientId oraz clientSecret. |
|
|
100
|
+
| strategy | Tstrategy | Tak | Wybrana strategia autoryzacji (np. "DeviceFlow"). |
|
|
101
|
+
| env | "production" \| "sandbox" | Nie | Środowisko Allegro (Domyślnie: "production"). |
|
|
102
|
+
| storage | ITokenStorage | Nie | Instancja klasy zarządzającej zapisem (Domyślnie: FileTokenStorage). |
|
|
103
103
|
|
|
104
104
|
### Metody klasy AllegroClient
|
|
105
105
|
getAccessToken(): Promise<string> – Zwraca aktywny token dostępowy. Jeśli token wygasł lub nie istnieje, inicjuje proces odświeżania lub autoryzacji.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaksebastian/allegro-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Allegro REST API Client with automatic token refresh. Fetches tokens from allegro and serves them to the user. Supports both the production and sandbox enviroments",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|