@agroshine/ags-web-http 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +492 -0
- package/dist/auth/index.cjs +1 -0
- package/dist/auth/index.d.cts +14 -0
- package/dist/auth/index.d.ts +14 -0
- package/dist/auth/index.js +1 -0
- package/dist/chunk-ACO6G7O2.js +1 -0
- package/dist/chunk-DJ5M3T5L.js +1 -0
- package/dist/crop-Dd6QL8u1.d.cts +19 -0
- package/dist/crop-Dd6QL8u1.d.ts +19 -0
- package/dist/crops/index.cjs +1 -0
- package/dist/crops/index.d.cts +14 -0
- package/dist/crops/index.d.ts +14 -0
- package/dist/crops/index.js +1 -0
- package/dist/customer-CgeUUBHe.d.cts +119 -0
- package/dist/customer-CgeUUBHe.d.ts +119 -0
- package/dist/customers/index.cjs +1 -0
- package/dist/customers/index.d.cts +66 -0
- package/dist/customers/index.d.ts +66 -0
- package/dist/customers/index.js +1 -0
- package/dist/group-CnJEil9u.d.cts +14 -0
- package/dist/group-CnJEil9u.d.ts +14 -0
- package/dist/groups/index.cjs +1 -0
- package/dist/groups/index.d.cts +14 -0
- package/dist/groups/index.d.ts +14 -0
- package/dist/groups/index.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +73 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +1 -0
- package/dist/indicator-BI8cP2F2.d.cts +62 -0
- package/dist/indicator-BI8cP2F2.d.ts +62 -0
- package/dist/indicators/index.cjs +1 -0
- package/dist/indicators/index.d.cts +15 -0
- package/dist/indicators/index.d.ts +15 -0
- package/dist/indicators/index.js +1 -0
- package/dist/layer/index.cjs +1 -0
- package/dist/layer/index.d.cts +18 -0
- package/dist/layer/index.d.ts +18 -0
- package/dist/layer/index.js +1 -0
- package/dist/layer-C4sBuqRI.d.cts +9 -0
- package/dist/layer-C4sBuqRI.d.ts +9 -0
- package/dist/login-Dq5rerGn.d.cts +6 -0
- package/dist/login-Dq5rerGn.d.ts +6 -0
- package/dist/modules/index.cjs +1 -0
- package/dist/modules/index.d.cts +6 -0
- package/dist/modules/index.d.ts +6 -0
- package/dist/modules/index.js +1 -0
- package/dist/permission-Dxx9IAbQ.d.cts +9 -0
- package/dist/permission-Dxx9IAbQ.d.ts +9 -0
- package/dist/permissions/index.cjs +1 -0
- package/dist/permissions/index.d.cts +14 -0
- package/dist/permissions/index.d.ts +14 -0
- package/dist/permissions/index.js +1 -0
- package/dist/role-Bimwb-vf.d.cts +10 -0
- package/dist/role-Bimwb-vf.d.ts +10 -0
- package/dist/roles/index.cjs +1 -0
- package/dist/roles/index.d.cts +14 -0
- package/dist/roles/index.d.ts +14 -0
- package/dist/roles/index.js +1 -0
- package/dist/structure/index.cjs +1 -0
- package/dist/structure/index.d.cts +176 -0
- package/dist/structure/index.d.ts +176 -0
- package/dist/structure/index.js +1 -0
- package/dist/structure-CNfJ_8fX.d.cts +218 -0
- package/dist/structure-CNfJ_8fX.d.ts +218 -0
- package/dist/user-FIov3LUo.d.cts +29 -0
- package/dist/user-FIov3LUo.d.ts +29 -0
- package/dist/users/index.cjs +1 -0
- package/dist/users/index.d.cts +14 -0
- package/dist/users/index.d.ts +14 -0
- package/dist/users/index.js +1 -0
- package/dist/varieties/index.cjs +1 -0
- package/dist/varieties/index.d.cts +20 -0
- package/dist/varieties/index.d.ts +20 -0
- package/dist/varieties/index.js +1 -0
- package/dist/variety-nx4Q5Ncw.d.cts +25 -0
- package/dist/variety-nx4Q5Ncw.d.ts +25 -0
- package/package.json +151 -0
package/README.md
ADDED
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
# @agroshine/ags-web-http
|
|
2
|
+
|
|
3
|
+
Cliente HTTP centralizado para todas las aplicaciones web de AgroShine.
|
|
4
|
+
|
|
5
|
+
Encapsula la instancia de Axios, la autenticación por token, el unwrap del envelope `{ success, data }` del gateway y el manejo del error 401. Las apps solo importan las funciones `fetch*` que necesitan — sin configurar Axios, sin instanciar repositorios, sin lógica de auth.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Instalación
|
|
10
|
+
|
|
11
|
+
> Este paquete **no se publica en npm**. Es un repositorio **privado** y se consume directamente desde Git, fijando siempre una **etiqueta de versión** (`#vX.Y.Z`).
|
|
12
|
+
|
|
13
|
+
Agrégalo a las `dependencies` de la app consumidora:
|
|
14
|
+
|
|
15
|
+
```jsonc
|
|
16
|
+
// package.json
|
|
17
|
+
{
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@agroshine/ags-web-http": "git+ssh://git@github.com/AgroShine/ags-web-http.git#v1.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
O con el CLI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add "git+ssh://git@github.com/AgroShine/ags-web-http.git#v1.0.0"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Luego `pnpm install`. El paquete **se compila y ofusca automáticamente al instalarse** (script `prepare` → `tsup` + ofuscación) y se empaqueta respetando el campo `files` (`dist` + `README.md`). Por eso la app consumidora recibe en su `node_modules` **únicamente el `dist/` ya minificado y ofuscado; el código fuente `src/` NO se incluye en el paquete instalado**.
|
|
31
|
+
|
|
32
|
+
**Requisitos:**
|
|
33
|
+
|
|
34
|
+
- Acceso SSH al repositorio privado `AgroShine/ags-web-http` (clave SSH cargada en GitHub). En CI, configura una deploy key o token con acceso de lectura al repo.
|
|
35
|
+
- Para subir de versión, cambia la etiqueta en `#vX.Y.Z` y vuelve a instalar (`pnpm update @agroshine/ags-web-http` no cambia el tag por sí solo; edita el `package.json`).
|
|
36
|
+
|
|
37
|
+
> Formato de la URL: usa `git+ssh://git@github.com/AgroShine/...` (con `/` tras el host). También es válido el atajo `github:AgroShine/ags-web-http#v1.0.0`.
|
|
38
|
+
>
|
|
39
|
+
> **Nota sobre protección de código:** el artefacto instalado va minificado y ofuscado, y no contiene `src/`. Aun así, quien tenga acceso de lectura al **repositorio** privado puede clonar y ver el fuente (el `src/` vive en `main`). La ofuscación protege el *artefacto distribuido*, no el repositorio; controla el acceso al repo para proteger el fuente.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Configuración inicial
|
|
44
|
+
|
|
45
|
+
Llama a `createHttpConfig()` **una sola vez** al arrancar la app, antes de cualquier llamada HTTP. El lugar correcto es `src/main.tsx`.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
// src/main.tsx
|
|
49
|
+
import { createHttpConfig } from '@agroshine/ags-web-http';
|
|
50
|
+
|
|
51
|
+
createHttpConfig({
|
|
52
|
+
clientId: 'web_admin', // 'web_admin' | 'web_client'
|
|
53
|
+
onUnauthorized: () => {
|
|
54
|
+
clearQueryCache(); // limpiar React Query cache
|
|
55
|
+
toast.error('Sesión expirada');
|
|
56
|
+
window.location.href = '/login';
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> **URL base:** por defecto el paquete lee `VITE_API_URL` de las variables de entorno (Vite, o `process.env` en Node/SSR). Si tu app **no** usa Vite (Next.js, Webpack, CRA), pasa `baseURL` explícitamente a `createHttpConfig()` — tiene prioridad sobre el entorno.
|
|
62
|
+
|
|
63
|
+
### Opciones de `createHttpConfig`
|
|
64
|
+
|
|
65
|
+
| Opción | Tipo | Requerido | Descripción |
|
|
66
|
+
|--------|------|-----------|-------------|
|
|
67
|
+
| `clientId` | `'web_admin' \| 'web_client'` | ✅ | Identifica la app en el header `auth` del gateway |
|
|
68
|
+
| `baseURL` | `string` | — | URL base del API. Tiene prioridad sobre `VITE_API_URL`. Úsala en apps que no sean Vite |
|
|
69
|
+
| `onUnauthorized` | `() => void` | — | Se ejecuta cuando el API responde 401. Aquí va la limpieza de cache, toast y redirección |
|
|
70
|
+
| `tokenKey` | `string` | — | Clave en `localStorage` donde está el JWT. Por defecto: `'uuid'`. Ignorada si pasas `tokenStorage` |
|
|
71
|
+
| `tokenStorage` | `TokenStorage` | — | Adaptador de almacenamiento del token. Por defecto `localStorage`; úsalo para `sessionStorage`, memoria o cookies `HttpOnly` |
|
|
72
|
+
| `timeout` | `number` | — | Timeout por request en ms. Por defecto: `15000` |
|
|
73
|
+
| `signingKey` | `string` | — | Clave HMAC compartida con el gateway (ver nota de seguridad abajo) |
|
|
74
|
+
| `maxRetries` | `number` | — | Reintentos en red/5xx **solo en métodos idempotentes**. Por defecto: `2` |
|
|
75
|
+
|
|
76
|
+
> **Almacenamiento del token:** por defecto el JWT se lee/borra de `localStorage`. Para usar otro almacén (p. ej. `sessionStorage` o memoria) pasa un `tokenStorage`:
|
|
77
|
+
> ```ts
|
|
78
|
+
> import { createHttpConfig, type TokenStorage } from '@agroshine/ags-web-http';
|
|
79
|
+
>
|
|
80
|
+
> const sessionTokenStorage: TokenStorage = {
|
|
81
|
+
> getToken: () => sessionStorage.getItem('uuid'),
|
|
82
|
+
> removeToken: () => sessionStorage.removeItem('uuid'),
|
|
83
|
+
> };
|
|
84
|
+
>
|
|
85
|
+
> createHttpConfig({ clientId: 'web_admin', tokenStorage: sessionTokenStorage });
|
|
86
|
+
> ```
|
|
87
|
+
> Con cookies `HttpOnly` gestionadas por el backend, `getToken()` devuelve `null` y el navegador adjunta la cookie automáticamente (mayor protección ante XSS).
|
|
88
|
+
|
|
89
|
+
> **client-front:** la redirección en `onUnauthorized` debe ser locale-aware:
|
|
90
|
+
> ```ts
|
|
91
|
+
> import { getBrowserLocale, getLocaleFromPathname } from '@agroshine/ags-web-i18n';
|
|
92
|
+
>
|
|
93
|
+
> onUnauthorized: () => {
|
|
94
|
+
> clearQueryCache();
|
|
95
|
+
> const locale = getLocaleFromPathname(window.location.pathname) ?? getBrowserLocale();
|
|
96
|
+
> window.location.href = `/${locale}/login`;
|
|
97
|
+
> }
|
|
98
|
+
> ```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Uso
|
|
103
|
+
|
|
104
|
+
### Importar por módulo del backend
|
|
105
|
+
|
|
106
|
+
Cada entry point corresponde a un módulo del API. Las apps importan solo lo que usan — el resto no entra al bundle (tree-shaking).
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { fetchLogin, fetchProfile } from '@agroshine/ags-web-http/auth';
|
|
110
|
+
import { fetchUsers, fetchCreateUser } from '@agroshine/ags-web-http/users';
|
|
111
|
+
import { fetchCustomers, fetchCustomerById } from '@agroshine/ags-web-http/customers';
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Importar tipos
|
|
115
|
+
|
|
116
|
+
Los tipos de dominio del API están disponibles desde el entry principal:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import type { IUser, ICustomer, IRole, ICrop } from '@agroshine/ags-web-http';
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Módulos disponibles
|
|
125
|
+
|
|
126
|
+
### `/auth` — Autenticación
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { fetchLogin, fetchProfile, fetchCheck } from '@agroshine/ags-web-http/auth';
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| Función | Método | Endpoint | Auth |
|
|
133
|
+
|---------|--------|----------|------|
|
|
134
|
+
| `fetchLogin({ email, password })` | POST | `/auth/login` | No |
|
|
135
|
+
| `fetchProfile()` | GET | `/auth/profile` | Sí |
|
|
136
|
+
| `fetchCheck()` | GET | `/auth/check` | Sí |
|
|
137
|
+
|
|
138
|
+
> La contraseña se hashea con SHA-256 automáticamente dentro del paquete.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### `/roles` — Roles del sistema
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import { fetchRoles, fetchRolesId, fetchCreateRoles, fetchUpdateRoles } from '@agroshine/ags-web-http/roles';
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Función | Método | Endpoint |
|
|
149
|
+
|---------|--------|----------|
|
|
150
|
+
| `fetchRoles()` | GET | `/config/roles` |
|
|
151
|
+
| `fetchRolesId({ _id })` | GET | `/config/roles/:id` |
|
|
152
|
+
| `fetchCreateRoles(data)` | POST | `/config/roles` |
|
|
153
|
+
| `fetchUpdateRoles({ id, data })` | PUT | `/config/roles/:id` |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### `/permissions` — Permisos del sistema
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { fetchPermissions, fetchPermissionsId, fetchCreatePermissions, fetchUpdatePermissions } from '@agroshine/ags-web-http/permissions';
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
| Función | Método | Endpoint |
|
|
164
|
+
|---------|--------|----------|
|
|
165
|
+
| `fetchPermissions()` | GET | `/config/permissions` |
|
|
166
|
+
| `fetchPermissionsId({ _id })` | GET | `/config/permissions/:id` |
|
|
167
|
+
| `fetchCreatePermissions(data)` | POST | `/config/permissions` |
|
|
168
|
+
| `fetchUpdatePermissions({ id, data })` | PUT | `/config/permissions/:id` |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### `/users` — Usuarios
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import { fetchUsers, fetchUserId, fetchCreateUser, fetchUpdateUser } from '@agroshine/ags-web-http/users';
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Función | Método | Endpoint |
|
|
179
|
+
|---------|--------|----------|
|
|
180
|
+
| `fetchUsers()` | GET | `/config/users` |
|
|
181
|
+
| `fetchUserId({ _id })` | GET | `/config/users/:id` |
|
|
182
|
+
| `fetchCreateUser(data)` | POST | `/config/users` |
|
|
183
|
+
| `fetchUpdateUser({ id, data })` | PUT | `/config/users/:id` |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
### `/groups` — Grupos
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { fetchGroups, fetchGroupById, fetchCreateGroup, fetchUpdateGroup } from '@agroshine/ags-web-http/groups';
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
| Función | Método | Endpoint |
|
|
194
|
+
|---------|--------|----------|
|
|
195
|
+
| `fetchGroups()` | GET | `/config/groups` |
|
|
196
|
+
| `fetchGroupById({ _id })` | GET | `/config/groups/:id` |
|
|
197
|
+
| `fetchCreateGroup(data)` | POST | `/config/groups` |
|
|
198
|
+
| `fetchUpdateGroup({ id, data })` | PUT | `/config/groups/:id` |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### `/crops` — Catálogo de cultivos
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import { fetchCrops, fetchCropById, fetchCreateCrop, fetchUpdateCrop } from '@agroshine/ags-web-http/crops';
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
| Función | Método | Endpoint |
|
|
209
|
+
|---------|--------|----------|
|
|
210
|
+
| `fetchCrops()` | GET | `/config/crops` |
|
|
211
|
+
| `fetchCropById({ _id })` | GET | `/config/crops/:id` |
|
|
212
|
+
| `fetchCreateCrop(data)` | POST | `/config/crops` |
|
|
213
|
+
| `fetchUpdateCrop({ id, data })` | PUT | `/config/crops/:id` |
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### `/varieties` — Variedades
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
import {
|
|
221
|
+
fetchVarieties, fetchVarietyById,
|
|
222
|
+
fetchCreateVariety, fetchUpdateVariety,
|
|
223
|
+
fetchFragranceLevel, fetchBreedingMethod,
|
|
224
|
+
} from '@agroshine/ags-web-http/varieties';
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
| Función | Método | Endpoint |
|
|
228
|
+
|---------|--------|----------|
|
|
229
|
+
| `fetchVarieties()` | GET | `/config/varieties` |
|
|
230
|
+
| `fetchVarietyById({ _id })` | GET | `/config/varieties/:id` |
|
|
231
|
+
| `fetchCreateVariety(data)` | POST | `/config/varieties` |
|
|
232
|
+
| `fetchUpdateVariety({ id, data })` | PUT | `/config/varieties/:id` |
|
|
233
|
+
| `fetchFragranceLevel()` | GET | `/config/varieties/fragrance-level` |
|
|
234
|
+
| `fetchBreedingMethod()` | GET | `/config/varieties/breeding-method` |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### `/indicators` — Indicadores de monitoreo
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
import {
|
|
242
|
+
fetchIndicators, fetchIndicatorById,
|
|
243
|
+
fetchCreateIndicator, fetchUpdateIndicator,
|
|
244
|
+
fetchIndicatorCategories,
|
|
245
|
+
fetchIndicatorPestTypes, fetchIndicatorDamageTypes,
|
|
246
|
+
fetchIndicatorSeverities, fetchIndicatorAffectedParts,
|
|
247
|
+
fetchIndicatorControlMethods,
|
|
248
|
+
} from '@agroshine/ags-web-http/indicators';
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
| Función | Método | Endpoint |
|
|
252
|
+
|---------|--------|----------|
|
|
253
|
+
| `fetchIndicators()` | GET | `/config/indicators` |
|
|
254
|
+
| `fetchIndicatorById(id)` | GET | `/config/indicators/:id` |
|
|
255
|
+
| `fetchCreateIndicator(data)` | POST | `/config/indicators` |
|
|
256
|
+
| `fetchUpdateIndicator(id, data)` | PUT | `/config/indicators/:id` |
|
|
257
|
+
| `fetchIndicatorCategories()` | GET | `/config/indicator-categories` |
|
|
258
|
+
| `fetchIndicatorPestTypes()` | GET | `/config/indicators/pest-type` |
|
|
259
|
+
| `fetchIndicatorDamageTypes()` | GET | `/config/indicators/damage-type` |
|
|
260
|
+
| `fetchIndicatorSeverities()` | GET | `/config/indicators/severity` |
|
|
261
|
+
| `fetchIndicatorAffectedParts()` | GET | `/config/indicators/affected-parts` |
|
|
262
|
+
| `fetchIndicatorControlMethods()` | GET | `/config/indicators/control-methods` |
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### `/customers` — Clientes y fincas
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
import {
|
|
270
|
+
fetchCustomers, fetchCustomerById,
|
|
271
|
+
fetchCreateCustomer, fetchUpdateCustomer,
|
|
272
|
+
fetchCustomerFarmTypes, fetchCustomerSizes,
|
|
273
|
+
fetchCustomerCrops, fetchUpdateCustomerCrops,
|
|
274
|
+
fetchCustomerVarieties, fetchUpdateCustomerVarieties,
|
|
275
|
+
fetchCustomerIndicators, fetchUpdateCustomerIndicators,
|
|
276
|
+
} from '@agroshine/ags-web-http/customers';
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
| Función | Método | Endpoint |
|
|
280
|
+
|---------|--------|----------|
|
|
281
|
+
| `fetchCustomers()` | GET | `/config/customers` |
|
|
282
|
+
| `fetchCustomerById({ _id })` | GET | `/config/customers/:id` |
|
|
283
|
+
| `fetchCreateCustomer(data)` | POST | `/config/customers` |
|
|
284
|
+
| `fetchUpdateCustomer({ _id, data })` | PUT | `/config/customers/:id` |
|
|
285
|
+
| `fetchCustomerFarmTypes()` | GET | `/config/customers/farm-type` |
|
|
286
|
+
| `fetchCustomerSizes()` | GET | `/config/customers/size` |
|
|
287
|
+
| `fetchCustomerCrops({ id })` | GET | `/config/customers/:id/crops` |
|
|
288
|
+
| `fetchUpdateCustomerCrops({ id, data })` | PUT | `/config/customers/:id/crops` |
|
|
289
|
+
| `fetchCustomerVarieties({ id })` | GET | `/config/customers/:id/varieties` |
|
|
290
|
+
| `fetchUpdateCustomerVarieties({ id, data })` | PUT | `/config/customers/:id/varieties` |
|
|
291
|
+
| `fetchCustomerIndicators({ id })` | GET | `/config/customers/:id/indicators` |
|
|
292
|
+
| `fetchUpdateCustomerIndicators({ id, data })` | PUT | `/config/customers/:id/indicators` |
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
### `/structure` — Estructura de bloques
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
import {
|
|
300
|
+
fetchStructure, fetchStructureById,
|
|
301
|
+
fetchCreateStructure, fetchUpdateStructure,
|
|
302
|
+
} from '@agroshine/ags-web-http/structure';
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
| Función | Método | Endpoint |
|
|
306
|
+
|---------|--------|----------|
|
|
307
|
+
| `fetchStructure({ _id })` | GET | `/structure/versions/latest/all/:id` |
|
|
308
|
+
| `fetchStructureById({ _id })` | GET | `/structure/block/:id` |
|
|
309
|
+
| `fetchCreateStructure(data)` | POST | `/structure` |
|
|
310
|
+
| `fetchUpdateStructure({ id, data })` | PATCH | `/structure/alignments/update/:id` |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### `/layer` — Capas de mapa
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { fetchLayerUrl } from '@agroshine/ags-web-http/layer';
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
| Función | Método | Endpoint |
|
|
321
|
+
|---------|--------|----------|
|
|
322
|
+
| `fetchLayerUrl({ _id })` | GET | `/structure/layers/squares/:id` |
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Tipos exportados
|
|
327
|
+
|
|
328
|
+
Todos los tipos del dominio están disponibles desde el entry principal:
|
|
329
|
+
|
|
330
|
+
```ts
|
|
331
|
+
import type {
|
|
332
|
+
// Auth
|
|
333
|
+
ILogin,
|
|
334
|
+
// Usuarios
|
|
335
|
+
IUser, IUserCreate, IProfile, IEmail,
|
|
336
|
+
// Roles y permisos
|
|
337
|
+
IRole, IPermissions,
|
|
338
|
+
// Grupos
|
|
339
|
+
IGroup,
|
|
340
|
+
// Cultivos
|
|
341
|
+
ICrop,
|
|
342
|
+
// Variedades
|
|
343
|
+
IVariety, IVarietyUpsert, FragranceLevel, PropagationMethod,
|
|
344
|
+
// Indicadores
|
|
345
|
+
IIndicators, IIndicatorCategory, IOption, IControlMethodOption,
|
|
346
|
+
PestType, DamageType, AffectedParts, Severity,
|
|
347
|
+
IControlMethod, IRegionAffected, IAssociatedDisease, IReference,
|
|
348
|
+
// Clientes
|
|
349
|
+
ICustomer, ICustomerCrop, ICustomerVariety, ICustomerIndicator,
|
|
350
|
+
IBlock, IFarmType, ISizes,
|
|
351
|
+
// Estructura
|
|
352
|
+
IStructure, Bed, Nave, Square,
|
|
353
|
+
// Layer
|
|
354
|
+
ILayer,
|
|
355
|
+
} from '@agroshine/ags-web-http';
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Comportamiento automático
|
|
361
|
+
|
|
362
|
+
### Autenticación por token
|
|
363
|
+
|
|
364
|
+
Cuando `useAuthorization` es `true` en el repositorio interno, el paquete lee el JWT de `localStorage` (clave `uuid` por defecto) y lo adjunta como `Authorization: Bearer <token>` en cada request.
|
|
365
|
+
|
|
366
|
+
### Unwrap del envelope del gateway
|
|
367
|
+
|
|
368
|
+
El gateway responde con `{ success: boolean, data: T }`. El paquete desenvuelve esto automáticamente — las funciones `fetch*` retornan `AxiosResponse<T>` directamente, sin que el componente tenga que acceder a `.data.data`.
|
|
369
|
+
|
|
370
|
+
### Manejo del error 401
|
|
371
|
+
|
|
372
|
+
Cuando el API responde `401 Unauthorized`:
|
|
373
|
+
1. Se elimina el token de `localStorage`
|
|
374
|
+
2. Se llama al `onUnauthorized` definido en `createHttpConfig`
|
|
375
|
+
3. Un flag `isRedirecting` evita múltiples redirects simultáneos
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Desarrollo
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
# Instalar dependencias
|
|
383
|
+
pnpm install
|
|
384
|
+
|
|
385
|
+
# Compilar el paquete
|
|
386
|
+
pnpm build
|
|
387
|
+
|
|
388
|
+
# Modo watch
|
|
389
|
+
pnpm dev
|
|
390
|
+
|
|
391
|
+
# Verificar tipos
|
|
392
|
+
pnpm typecheck
|
|
393
|
+
|
|
394
|
+
# Formatear código
|
|
395
|
+
pnpm format
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Agregar un nuevo módulo del backend
|
|
401
|
+
|
|
402
|
+
Cuando el backend exponga un nuevo recurso (ej. `/config/health`):
|
|
403
|
+
|
|
404
|
+
**1. Crear el archivo del módulo:**
|
|
405
|
+
|
|
406
|
+
```ts
|
|
407
|
+
// src/health/index.ts
|
|
408
|
+
import { createRepo } from '../core/factory';
|
|
409
|
+
import type { IHealth } from '../types/health';
|
|
410
|
+
|
|
411
|
+
export async function fetchHealth() {
|
|
412
|
+
return createRepo('/config/health', true).GET<object, IHealth[]>();
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
**2. Agregar el tipo en `src/types/`:**
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
// src/types/health.ts
|
|
420
|
+
export interface IHealth {
|
|
421
|
+
_id: string;
|
|
422
|
+
// ...
|
|
423
|
+
}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**3. Registrar el entry en `tsup.config.ts`:**
|
|
427
|
+
|
|
428
|
+
```ts
|
|
429
|
+
entry: {
|
|
430
|
+
// ... entradas existentes
|
|
431
|
+
'health/index': 'src/health/index.ts',
|
|
432
|
+
},
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**4. Agregar el export en `package.json`:**
|
|
436
|
+
|
|
437
|
+
```json
|
|
438
|
+
"./health": {
|
|
439
|
+
"types": "./dist/health/index.d.ts",
|
|
440
|
+
"import": "./dist/health/index.js",
|
|
441
|
+
"require": "./dist/health/index.cjs"
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**5. Exportar el tipo en `src/types/index.ts` y liberar una versión:**
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
pnpm build # validar que compila
|
|
449
|
+
# commit con conventional-commits (feat/fix/…) y push a main
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
Al llegar a `main`, `semantic-release` versiona, actualiza el `CHANGELOG`, y **crea el tag `vX.Y.Z` + el release de GitHub** (no publica en npm). Las apps consumidoras apuntan a la nueva etiqueta en su `package.json`:
|
|
453
|
+
|
|
454
|
+
```jsonc
|
|
455
|
+
"@agroshine/ags-web-http": "git+ssh://git@github.com/AgroShine/ags-web-http.git#v1.1.0"
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
y corren `pnpm install` para tener acceso a `@agroshine/ags-web-http/health`.
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## Migración desde la config local
|
|
463
|
+
|
|
464
|
+
Si la app tenía su propio `src/services/axios.generic.ts`:
|
|
465
|
+
|
|
466
|
+
**1.** Instalar el paquete desde el repo git privado:
|
|
467
|
+
```bash
|
|
468
|
+
pnpm add "git+ssh://git@github.com/AgroShine/ags-web-http.git#v1.0.0"
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
**2.** Agregar `createHttpConfig` en `src/main.tsx` (ver sección de configuración).
|
|
472
|
+
|
|
473
|
+
**3.** Reemplazar los imports en cada servicio:
|
|
474
|
+
```ts
|
|
475
|
+
// antes
|
|
476
|
+
import GenericRepository from '#services/axios.generic';
|
|
477
|
+
import { PUBLIC_API_BACK_URL } from '#services/config';
|
|
478
|
+
|
|
479
|
+
const httpAxios = new GenericRepository({
|
|
480
|
+
API_URL: `${PUBLIC_API_BACK_URL}/config/roles`,
|
|
481
|
+
useAuthorization: true,
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
export async function fetchRoles() {
|
|
485
|
+
return httpAxios.GET<object, IRole[]>();
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// después
|
|
489
|
+
import { fetchRoles } from '@agroshine/ags-web-http/roles';
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**4.** Eliminar `src/services/axios.generic.ts`, `src/services/base.ts` y `src/services/config.ts`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x8758b9=_0x5e5a;(function(_0x1b4929,_0x3fd65c){const _0x3deea1=_0x5e5a,_0xcdd81a=_0x1b4929();while(!![]){try{const _0x3409af=parseInt(_0x3deea1(0x1b0))/(0x1dad*-0x1+-0x1695+0x3443)+parseInt(_0x3deea1(0x1da))/(-0x1a26+-0x1be3+0x360b)*(parseInt(_0x3deea1(0x1d5))/(-0x13*-0x43+-0x1b2c+-0x2*-0xb1b))+-parseInt(_0x3deea1(0x1bd))/(0xb7*0x8+-0xb7e+-0xd*-0x72)*(parseInt(_0x3deea1(0x214))/(0x9*-0x21e+0x7a4+0xb6f))+parseInt(_0x3deea1(0x221))/(-0x1*0x22fc+-0xda3+-0x6f3*-0x7)*(parseInt(_0x3deea1(0x20e))/(-0x16c4+-0x652+-0x101*-0x1d))+-parseInt(_0x3deea1(0x1fc))/(0x26*-0x9b+0xc87*0x3+-0xe8b)+parseInt(_0x3deea1(0x232))/(-0x265e+0x1bd1+0xa*0x10f)*(-parseInt(_0x3deea1(0x1dc))/(-0x34*0x76+0x4*0x674+-0x1ce))+parseInt(_0x3deea1(0x206))/(0x48*-0x48+0x194*0x1+-0x63d*-0x3);if(_0x3409af===_0x3fd65c)break;else _0xcdd81a['push'](_0xcdd81a['shift']());}catch(_0x4e4aa5){_0xcdd81a['push'](_0xcdd81a['shift']());}}}(_0x4a7b,0x1b2dc+0x148d3+-0x174e7));var _=require('axios');function _interopDefault(_0x224a8b){const _0x498a64=_0x5e5a;return _0x224a8b&&_0x224a8b[_0x498a64(0x225)+'le']?_0x224a8b:{'default':_0x224a8b};}var ___default=_interopDefault(_),v=new Set();function _0x5e5a(_0x1257b2,_0x54c884){_0x1257b2=_0x1257b2-(0x10d8*0x1+-0x329*0x1+-0x20*0x60);const _0x50f13c=_0x4a7b();let _0x2852f9=_0x50f13c[_0x1257b2];if(_0x5e5a['BtOeOa']===undefined){var _0xc95b49=function(_0xce028c){const _0x433ec0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x56cd1a='',_0x5f1a75='';for(let _0x193d74=-0x376*0x1+0x5*-0x634+0x227a,_0x4ea55b,_0x1a5b72,_0x35cf7=0x2467+-0x157d*0x1+-0xeea;_0x1a5b72=_0xce028c['charAt'](_0x35cf7++);~_0x1a5b72&&(_0x4ea55b=_0x193d74%(-0x320*0x6+0x12a2+0x2*0x11)?_0x4ea55b*(0x355*0x8+0x962*0x1+-0x23ca)+_0x1a5b72:_0x1a5b72,_0x193d74++%(0x13d2+0x1*0x1549+-0x2917))?_0x56cd1a+=String['fromCharCode'](0x2357+-0xb*-0x3e+-0x2502&_0x4ea55b>>(-(-0x1*-0x1f7b+0x1e9e+-0x5*0xc6b)*_0x193d74&-0x249d+0x21cd+0x16b*0x2)):0xdf1+-0x8f0+-0x501){_0x1a5b72=_0x433ec0['indexOf'](_0x1a5b72);}for(let _0x5ce898=0x394+-0xce4+-0x1*-0x950,_0x49eb86=_0x56cd1a['length'];_0x5ce898<_0x49eb86;_0x5ce898++){_0x5f1a75+='%'+('00'+_0x56cd1a['charCodeAt'](_0x5ce898)['toString'](0x1*-0x73d+-0x3*0xb55+0x294c))['slice'](-(-0x13*-0x12e+0xee0+-0x2548));}return decodeURIComponent(_0x5f1a75);};_0x5e5a['XixcIg']=_0xc95b49,_0x5e5a['dKOFXV']={},_0x5e5a['BtOeOa']=!![];}const _0x5caa32=_0x50f13c[-0x58+0x1d7c+0x1d24*-0x1],_0x2a85ee=_0x1257b2+_0x5caa32,_0x50da5a=_0x5e5a['dKOFXV'][_0x2a85ee];return!_0x50da5a?(_0x2852f9=_0x5e5a['XixcIg'](_0x2852f9),_0x5e5a['dKOFXV'][_0x2a85ee]=_0x2852f9):_0x2852f9=_0x50da5a,_0x2852f9;}function b(_0x49f2e1){const _0xba4ccb=_0x5e5a;v[_0xba4ccb(0x208)](_0x49f2e1);}function S(){const _0xbb919=_0x5e5a,_0x1ba8b7={};_0x1ba8b7['dJOEI']=_0xbb919(0x22f)+'ine/ags-'+_0xbb919(0x247)+_0xbb919(0x1ca)+_0xbb919(0x1fd)+_0xbb919(0x217)+_0xbb919(0x1cb)+_0xbb919(0x1ce)+'ar\x20cualq'+_0xbb919(0x1eb)+'ción\x20fet'+_0xbb919(0x1d3);const _0x1911cf=_0x1ba8b7;throw new Error(_0x1911cf[_0xbb919(0x22d)]);}function A(_0x327edb){const _0x2e34f6=_0x5e5a,_0x1588e5={'YtZVm':function(_0x3b1946,_0xb2d865){return _0x3b1946(_0xb2d865);},'wIUdv':function(_0x1c274a,_0x4a9a46){return _0x1c274a==_0x4a9a46;},'NkIdA':'number','hhMgg':function(_0x563fcf,_0x27b211){return _0x563fcf<_0x27b211;},'iNYuI':function(_0x357331,_0x61ff48){return _0x357331*_0x61ff48;}};try{let _0x34953d=_0x327edb[_0x2e34f6(0x1f2)]('.')[-0x19cd*-0x1+-0x152f*-0x1+-0x2efb]['replace'](/-/g,'+')['replace'](/_/g,'/'),_0x41de6f=JSON[_0x2e34f6(0x1e9)](_0x1588e5[_0x2e34f6(0x1ff)](atob,_0x34953d));return _0x1588e5['wIUdv'](typeof _0x41de6f[_0x2e34f6(0x1e4)],_0x1588e5['NkIdA'])&&_0x1588e5[_0x2e34f6(0x1f0)](_0x1588e5['iNYuI'](_0x41de6f['exp'],0xc94*-0x1+-0x2*0x11b6+0x58*0x97),Date[_0x2e34f6(0x1bc)]());}catch{return![];}}function w(_0x5ae756){const _0x258b41=_0x5e5a;return Array[_0x258b41(0x211)](new Uint8Array(_0x5ae756))[_0x258b41(0x23e)](_0x4074a9=>_0x4074a9[_0x258b41(0x23b)](0x76e+-0x639*0x4+0x1186)['padStart'](-0xf2e*-0x2+0x327*0xc+-0x442e,'0'))[_0x258b41(0x1d4)]('');}async function h(_0x398812){const _0x16f140=_0x5e5a,_0x14e168={'iMLNK':_0x16f140(0x229),'OTVCY':function(_0x19f19f,_0x3a7fda){return _0x19f19f(_0x3a7fda);}};let _0x2cf4c0=await crypto[_0x16f140(0x1ec)][_0x16f140(0x24b)](_0x14e168[_0x16f140(0x246)],new TextEncoder()[_0x16f140(0x1de)](_0x398812));return _0x14e168[_0x16f140(0x1fe)](w,_0x2cf4c0);}function U(_0x3ccc89){const _0x4fdc96=_0x5e5a;return!_0x3ccc89||typeof _0x3ccc89!=_0x4fdc96(0x1b8)?'':Object[_0x4fdc96(0x1ef)](_0x3ccc89)['filter'](([,_0x28555d])=>_0x28555d!=null)[_0x4fdc96(0x1b3)](([_0x478be4],[_0x586d2a])=>_0x478be4<_0x586d2a?-(0xdbb+-0x6bc*-0x2+-0x2*0xd99):_0x478be4>_0x586d2a?0x1*0x2519+0x170*0x16+-0x225c*0x2:-0xd27+-0x1b72+0x2899)[_0x4fdc96(0x23e)](([_0x103677,_0x9c84ef])=>encodeURIComponent(_0x103677)+'='+encodeURIComponent(String(_0x9c84ef)))[_0x4fdc96(0x1d4)]('&');}async function k(_0xa4fc91,_0x43756a,_0x1a0716,_0x524a3e='',_0x5b5d5c=''){const _0x542456=_0x5e5a,_0x354e19={'XFNwx':function(_0x17c32f,_0x4d323a){return _0x17c32f/_0x4d323a;},'cGyeT':function(_0x29c40a,_0x41b928){return _0x29c40a(_0x41b928);},'yDxnD':'raw','AIzLP':_0x542456(0x1ea),'fDCcU':_0x542456(0x229),'SJQMo':_0x542456(0x200),'RaeJq':function(_0x2f5c75,_0x172a6d){return _0x2f5c75(_0x172a6d);}};let _0x5dee2f=Math[_0x542456(0x228)](_0x354e19[_0x542456(0x1dd)](Date[_0x542456(0x1bc)](),0x5*-0x1d+-0x1725+0x1f9*0xe))[_0x542456(0x23b)](),_0x32631a=await _0x354e19[_0x542456(0x201)](h,_0x5b5d5c),_0x3774e3='v1:'+_0x5dee2f+':'+_0x43756a[_0x542456(0x21e)+_0x542456(0x1c1)]()+':'+_0x1a0716+':'+_0x524a3e+':'+_0x32631a,_0x5781fe=new TextEncoder(),_0x10d127=await crypto[_0x542456(0x1ec)]['importKe'+'y'](_0x354e19[_0x542456(0x1df)],_0x5781fe['encode'](_0xa4fc91),{'name':_0x354e19[_0x542456(0x22e)],'hash':_0x354e19[_0x542456(0x1e8)]},![],[_0x354e19[_0x542456(0x1c9)]]),_0x53f1f1=await crypto[_0x542456(0x1ec)][_0x542456(0x200)](_0x354e19[_0x542456(0x22e)],_0x10d127,_0x5781fe['encode'](_0x3774e3));return't='+_0x5dee2f+',v='+_0x354e19[_0x542456(0x1d6)](w,_0x53f1f1);}var L=[_0x8758b9(0x20f)+'ation','X-Signat'+_0x8758b9(0x1b5)];function E(_0x313b1c){const _0x55888c=_0x8758b9,_0x107e57={};_0x107e57[_0x55888c(0x1f4)]=function(_0x3482a6,_0x532228){return _0x3482a6!=_0x532228;},_0x107e57[_0x55888c(0x1b6)]=_0x55888c(0x1f6)+'D]';const _0x5d581c=_0x107e57;if(!_0x313b1c||_0x5d581c[_0x55888c(0x1f4)](typeof _0x313b1c,_0x55888c(0x1b8)))return;let _0xa1a537=_0x313b1c;for(let _0x88b8fd of[_0xa1a537[_0x55888c(0x1e6)]?.[_0x55888c(0x1bb)],_0xa1a537[_0x55888c(0x203)]?.[_0x55888c(0x1bb)]])if(_0x88b8fd){for(let _0x399942 of L)_0x88b8fd[_0x399942]&&(_0x88b8fd[_0x399942]=_0x5d581c[_0x55888c(0x1b6)]);}}var j=new Set([-0x1*0x2256+0x95*0x9+0x1eb1,0x1dad+-0x177f+0x481*-0x1,0x2a*-0xa1+0x3cd+0x1893*0x1,-0x119+0x13*-0x13d+0x1a97*0x1,0x24fb+-0x987+0x1d2*-0xe]),z=new Set([_0x8758b9(0x1e0),_0x8758b9(0x215),'options',_0x8758b9(0x1d0),_0x8758b9(0x209)]),D=new Set(['blob',_0x8758b9(0x1f1)+'fer','stream',_0x8758b9(0x21a),'text']),a=class a{constructor({API_URL:_0x5ab3d4,useAuthorization:_0x2d4bfc,clientId:_0x3dc27d,tokenStorage:_0x1b3a4e,timeout:_0x1602a0,signingKey:_0x14e749,maxRetries:_0x57ac05,onUnauthorized:_0x61a553}){const _0x3c74f0=_0x8758b9,_0x2e2a95={'niNkN':_0x3c74f0(0x204),'RtcDb':_0x3c74f0(0x218)+_0x3c74f0(0x21d),'vGjoy':function(_0x4443c0,_0x4e542d){return _0x4443c0(_0x4e542d);},'IJyrv':_0x3c74f0(0x23a)+_0x3c74f0(0x1b9),'oNyMk':function(_0x336672,_0x32e8b7){return _0x336672===_0x32e8b7;},'PSrFx':function(_0x446c42,_0x11ff32){return _0x446c42!=_0x11ff32;},'dlFtp':'content-'+_0x3c74f0(0x23f),'nnkEU':function(_0x3d68df,_0x3865ef){return _0x3d68df==_0x3865ef;},'nSNUP':function(_0x234e17,_0x20ea8e){return _0x234e17 in _0x20ea8e;},'fJyxS':_0x3c74f0(0x1db),'LbcbT':_0x3c74f0(0x1e0),'ZyeJD':function(_0x21fc7a,_0x45df1a){return _0x21fc7a<_0x45df1a;},'HbNYA':function(_0x34007b,_0x453a0c){return _0x34007b*_0x453a0c;},'yDkBr':function(_0x1458b5){return _0x1458b5();},'lCJZS':function(_0x4c33e2,_0xe5f3f8,_0x33ebd2){return _0x4c33e2(_0xe5f3f8,_0x33ebd2);},'rAOUL':_0x3c74f0(0x24a)+'ion/json'},_0x359a44={};_0x359a44['Content-'+'Type']=_0x2e2a95[_0x3c74f0(0x239)],_0x359a44[_0x3c74f0(0x249)]=_0x3dc27d;const _0x1b29c2={};_0x1b29c2[_0x3c74f0(0x1cd)]=_0x5ab3d4,_0x1b29c2[_0x3c74f0(0x21b)]=_0x1602a0,_0x1b29c2[_0x3c74f0(0x1bb)]=_0x359a44,(this[_0x3c74f0(0x1e3)+_0x3c74f0(0x1fa)]=_0x2d4bfc,this[_0x3c74f0(0x212)+'t']=___default['default'][_0x3c74f0(0x1d9)](_0x1b29c2),this['apiClien'+'t'][_0x3c74f0(0x21c)+'tors'][_0x3c74f0(0x203)][_0x3c74f0(0x1ba)](async _0x51ecb4=>{const _0x3368a9=_0x3c74f0;if(_0x3368a9(0x230)!==_0x2e2a95[_0x3368a9(0x224)]){if(_0x51ecb4[_0x3368a9(0x1bb)][_0x2e2a95[_0x3368a9(0x248)]]=crypto[_0x3368a9(0x205)+'ID'](),this[_0x3368a9(0x1e3)+_0x3368a9(0x1fa)]){let _0x1022a9=_0x1b3a4e[_0x3368a9(0x1cf)]();if(_0x1022a9&&_0x2e2a95[_0x3368a9(0x1f9)](A,_0x1022a9))return a[_0x3368a9(0x223)+'cting']||(a['isRedire'+'cting']=!![],_0x1b3a4e[_0x3368a9(0x1c4)+_0x3368a9(0x220)](),_0x61a553(),setTimeout(()=>{const _0x4f1e0b=_0x3368a9;a['isRedire'+_0x4f1e0b(0x236)]=![];},-0x3*-0x789+-0x127*-0xd+-0x21ae)),Promise[_0x3368a9(0x1d7)](new Error(_0x2e2a95[_0x3368a9(0x23d)]));_0x1022a9&&(_0x51ecb4['headers'][_0x3368a9(0x20f)+_0x3368a9(0x216)]='Bearer\x20'+_0x1022a9);}if(_0x14e749){if(_0x2e2a95['oNyMk']('lGNmC',_0x3368a9(0x227))){let _0x5c78e3=this['combineC'+_0x3368a9(0x226)](_0x40f9a1,_0x20b282);return this[_0x3368a9(0x212)+'t'][_0x3368a9(0x1ed)](_0x40e5bc['path']??'',_0x5c78e3[_0x3368a9(0x1db)],_0x5c78e3);}else{let _0xbf6f33=_0x51ecb4[_0x3368a9(0x20a)]??_0x3368a9(0x1e0),_0x28a4f8=_0x51ecb4[_0x3368a9(0x1d8)]??'',_0x45a412=_0x2e2a95[_0x3368a9(0x1f9)](U,_0x51ecb4[_0x3368a9(0x231)]),_0x1e6b92=_0x2e2a95[_0x3368a9(0x1e1)](_0x51ecb4[_0x3368a9(0x1db)],null)?JSON[_0x3368a9(0x1c3)+'y'](_0x51ecb4[_0x3368a9(0x1db)]):'';_0x51ecb4[_0x3368a9(0x1bb)][_0x3368a9(0x237)+_0x3368a9(0x1b5)]=await k(_0x14e749,_0xbf6f33,_0x28a4f8,_0x45a412,_0x1e6b92);}}return _0x51ecb4;}else _0x321a1e[_0x3368a9(0x223)+_0x3368a9(0x236)]=![];},_0x30eabc=>Promise['reject'](_0x30eabc)),this[_0x3c74f0(0x212)+'t'][_0x3c74f0(0x21c)+_0x3c74f0(0x202)]['response'][_0x3c74f0(0x1ba)](_0x118c33=>{const _0x5bb6fa=_0x3c74f0;let _0x3ce224=_0x2e2a95[_0x5bb6fa(0x1f9)](String,_0x118c33[_0x5bb6fa(0x1bb)][_0x2e2a95['dlFtp']]??''),_0x156e8b=_0x118c33[_0x5bb6fa(0x1e6)]?.[_0x5bb6fa(0x243)+'Type']??'';if(_0x118c33[_0x5bb6fa(0x1db)]&&!D[_0x5bb6fa(0x21f)](_0x156e8b)&&!_0x3ce224[_0x5bb6fa(0x23c)](_0x5bb6fa(0x24a)+'ion/json'))return Promise[_0x5bb6fa(0x1d7)](new Error('Respuest'+_0x5bb6fa(0x210)+_0x5bb6fa(0x1c0)+_0x5bb6fa(0x1c6)+'\x20('+_0x3ce224+(_0x5bb6fa(0x20d)+_0x5bb6fa(0x244)+_0x5bb6fa(0x240)+'json.')));let _0x245f54=_0x118c33[_0x5bb6fa(0x1db)];return _0x245f54&&_0x2e2a95[_0x5bb6fa(0x1d2)](typeof _0x245f54[_0x5bb6fa(0x1f3)],_0x5bb6fa(0x1ee))&&_0x2e2a95[_0x5bb6fa(0x1e2)](_0x2e2a95[_0x5bb6fa(0x219)],_0x245f54)&&(_0x118c33[_0x5bb6fa(0x1db)]=_0x245f54[_0x5bb6fa(0x1db)]),_0x118c33;},async _0x4bc0a4=>{const _0x1ed40d=_0x3c74f0;_0x2e2a95[_0x1ed40d(0x1f9)](E,_0x4bc0a4);let _0xc8bc1c=_0x4bc0a4[_0x1ed40d(0x1e6)],_0x5f298b=_0x4bc0a4[_0x1ed40d(0x243)]?.[_0x1ed40d(0x213)],_0x1022ab=(_0xc8bc1c?.[_0x1ed40d(0x20a)]??_0x2e2a95[_0x1ed40d(0x1c8)])['toLowerC'+_0x1ed40d(0x1c1)](),_0x595a78=z[_0x1ed40d(0x21f)](_0x1022ab)&&(!_0x5f298b||j[_0x1ed40d(0x21f)](_0x5f298b)),_0x40f634=_0xc8bc1c?.['_retryCo'+_0x1ed40d(0x22b)]??0x415+0x1532+-0x9*0x2cf;if(_0xc8bc1c&&_0x595a78&&_0x2e2a95[_0x1ed40d(0x234)](_0x40f634,_0x57ac05)){_0xc8bc1c[_0x1ed40d(0x207)+'unt']=_0x40f634+(0x113d*0x1+-0x61c+0x590*-0x2);let _0x3e19fc=_0x2e2a95['HbNYA'](Math[_0x1ed40d(0x1b4)](-0x1ea7+-0xdfc+0x40f*0xb,_0xc8bc1c[_0x1ed40d(0x207)+_0x1ed40d(0x22b)]),0x10f0+0x42e+-0x1*0x132a);return await new Promise(_0x4b98dd=>setTimeout(_0x4b98dd,_0x3e19fc)),this['apiClien'+'t'](_0xc8bc1c);}return _0x5f298b===_[_0x1ed40d(0x1f5)+_0x1ed40d(0x1c7)][_0x1ed40d(0x20b)+'ized']&&!a[_0x1ed40d(0x223)+_0x1ed40d(0x236)]&&(a[_0x1ed40d(0x223)+_0x1ed40d(0x236)]=!![],_0x1b3a4e[_0x1ed40d(0x1c4)+'ken'](),_0x2e2a95[_0x1ed40d(0x1b7)](_0x61a553),_0x2e2a95[_0x1ed40d(0x235)](setTimeout,()=>{const _0x13d28c=_0x1ed40d;a[_0x13d28c(0x223)+_0x13d28c(0x236)]=![];},-0x4b5+0x2106+-0x823*0x3)),Promise[_0x1ed40d(0x1d7)](_0x4bc0a4);}));}['combineC'+'onfig'](_0x3dc16c,_0x4811f0){const _0x206400=_0x8758b9,_0x2470c2={..._0x3dc16c?.[_0x206400(0x1e5)+'fig']};return _0x2470c2[_0x206400(0x1bb)]={..._0x3dc16c?.[_0x206400(0x1e5)+_0x206400(0x238)]?.['headers'],..._0x4811f0?.[_0x206400(0x1bb)]},_0x2470c2['params']=_0x3dc16c?.[_0x206400(0x231)],_0x2470c2[_0x206400(0x1db)]=_0x3dc16c?.[_0x206400(0x1db)],_0x2470c2;}async[_0x8758b9(0x22a)](_0x3bd3cc,_0x23ea67){const _0x24cfa4=_0x8758b9;return this[_0x24cfa4(0x212)+'t']['get'](_0x3bd3cc?.[_0x24cfa4(0x1cc)]??'',this[_0x24cfa4(0x1e7)+_0x24cfa4(0x226)](_0x3bd3cc,_0x23ea67));}async['POST'](_0x341893,_0x31d696){const _0x1215a0=_0x8758b9;let _0x401de3=this[_0x1215a0(0x1e7)+_0x1215a0(0x226)](_0x341893,_0x31d696);return this['apiClien'+'t'][_0x1215a0(0x1ed)](_0x341893[_0x1215a0(0x1cc)]??'',_0x401de3[_0x1215a0(0x1db)],_0x401de3);}async[_0x8758b9(0x1c5)](_0x1e68e9,_0x5c0878){const _0x28b294=_0x8758b9;let _0x29775b=this['combineC'+_0x28b294(0x226)](_0x1e68e9,_0x5c0878);return this['apiClien'+'t'][_0x28b294(0x1d0)](_0x1e68e9['path']??'',_0x29775b['data'],_0x29775b);}async['PATCH'](_0x2c6e11,_0x311c94){const _0x686a3d=_0x8758b9;let _0x5ccd9b=this['combineC'+_0x686a3d(0x226)](_0x2c6e11,_0x311c94);return this['apiClien'+'t'][_0x686a3d(0x1bf)](_0x2c6e11[_0x686a3d(0x1cc)]??'',_0x5ccd9b[_0x686a3d(0x1db)],_0x5ccd9b);}async[_0x8758b9(0x1be)](_0x1a89b5,_0x316443){const _0x2daded=_0x8758b9;return this[_0x2daded(0x212)+'t']['delete'](_0x1a89b5[_0x2daded(0x1cc)]??'',this[_0x2daded(0x1e7)+_0x2daded(0x226)](_0x1a89b5,_0x316443));}};function _0x4a7b(){const _0x34ad1f=['CgfYyw1Z','mtyXndy5ovHLyxrgBW','AenYwwm','wNLLsKq','BenkwLm','y3rPBMC','wc1tAwDUyxq','zMLN','CKfpvuW','vg9Rzw4GzxG','Dg9tDhjPBMC','Aw5JBhvKzxm','suP5CNy','BwfW','DhLWzq','AwnHDgLVBI8','zMv0y2HdAgu','Ew5Nqu4','CMvZCg9UC2u','ywjHigfWCgW','q053vfa','Au1mtKS','D2vIlwH0Dha','uNrJrgi','yxv0Aa','yxbWBgLJyxq','zgLNzxn0','zMLSzq','mta3mti3s0nzvLPe','l2XVz2LU','zMv0y2HqCM8','C29YDa','Cg93','DxjL','D2zKzeS','EurRqNi','B2jQzwn0','CgLYywrV','DxnL','AgvHzgvYCW','BM93','mte1mdrKquDZENK','revmrvrf','Cgf0y2G','CMfKysbKzwW','yxnL','y2XLyxi','C3rYAw5NAwy','CMvTB3zLvg8','ufvu','igDHDgv3yxK','DxndB2rL','tgjJyLq','u0Prtw8','xsbmBgfTysa','AwCOksbHBNq','Cgf0Aa','yMfZzvvsta','zxmGzguGDxm','z2v0vg9Rzw4','Chv0','l2f1DgG','BM5Rrvu','y2GU','AM9PBG','ndmZoePfzNPgrW','uMfLsNe','CMvQzwn0','DxjS','y3jLyxrL','mtqWtMfsvvni','zgf0yq','mtblA0T1D2y','wezoD3G','zw5JB2rL','Eur4BKq','z2v0','ufnYrNG','BLnovva','DxnLqxv0Ag8','zxHW','yxHPB3ndB24','y29UzMLN','y29TyMLUzum','zKrdy1u','CgfYC2u','se1bqW','DwLLCIbMDw4','C3vIDgXL','Cg9ZDa','yM9VBgvHBG','zw50CMLLCW','AgHnz2C','yxjYyxLIDwy','C3bSAxq','C3vJy2vZCW','tufLvMG','shr0Cfn0yxq','w1jfrefdveu','C2v0','tgvjBuK','DKDQB3K','CML6yxrPB24','qNjgzLG','mta5odG0mfPXrfvLAG','ysbJCMvHDgu','t1rwq1K','wxrAvM0','C2LNBG','y0D5zvq','Dg9YCW','CMvXDwvZDa','C0jgzfa','CMfUzg9Tvvu','mJmZntGZovHIEMfdtq','x3jLDhj5q28','ywrK','zgvSzxrL','Bwv0Ag9K','vw5HDxrOB3i','ue9tva','ks4GrxnWzxi','mtrMBuTXzLC','qxv0Ag9YAxO','ysbPBMvZCgu','zNjVBq','yxbPq2XPzw4','C3rHDhvZ','odvht0jSugW','AgvHza','yxrPB24','shr0CenVBMy','wc1szxf1zxm','zKP5Efm','zg9JDw1LBNq','DgLTzw91Da','Aw50zxjJzxa','Dc1jra','Dg9vChbLCKm','AgfZ','A2vU','mtm1mda2u1bRvgrz','l2nOzwnR','AxnszwrPCMu','BMLoA04','x19LC01Vzhu','B25MAwC','tKrhA1m','zMXVB3i','u0Hblti1nG','r0vu','Dw50','C1nWDha','zePpruK','quL6tfa','w0bHz3jVC2G','D29MsNi'];_0x4a7b=function(){return _0x34ad1f;};return _0x4a7b();}a[_0x8758b9(0x223)+_0x8758b9(0x236)]=![];var C=a,I=C,R=new Map();b(()=>R[_0x8758b9(0x1c2)]());function m(_0x4b749f,_0x514c39){const _0x49f95c=_0x8758b9,_0x4cad46={'hCrYc':function(_0x1f2f8e){return _0x1f2f8e();}};let _0x9ea321=_0x4b749f+'|'+_0x514c39,_0x99ea9e=R[_0x49f95c(0x1e0)](_0x9ea321);if(_0x99ea9e)return _0x99ea9e;let {baseURL:_0x30ee95,clientId:_0x200c70,tokenStorage:_0x3b92e5,timeout:_0x1ff3be,signingKey:_0x18a9c0,maxRetries:_0x209b6b,onUnauthorized:_0x560e90}=_0x4cad46[_0x49f95c(0x233)](S),_0x20269d=new I({'API_URL':''+_0x30ee95+_0x4b749f,'useAuthorization':_0x514c39,'clientId':_0x200c70,'tokenStorage':_0x3b92e5,'timeout':_0x1ff3be,'signingKey':_0x18a9c0,'maxRetries':_0x209b6b,'onUnauthorized':_0x560e90});return R[_0x49f95c(0x1f7)](_0x9ea321,_0x20269d),_0x20269d;}async function ne({email:_0x1aa8d2,password:_0x53b52e}){const _0x20e65a=_0x8758b9,_0x4ae71c={'LeImI':function(_0x1aa759,_0x2f3908,_0x2f0506){return _0x1aa759(_0x2f3908,_0x2f0506);},'BrFfX':'/auth','CNwTP':function(_0x3aa761,_0x4a9d82){return _0x3aa761(_0x4a9d82);}};return _0x4ae71c[_0x20e65a(0x1f8)](m,_0x4ae71c[_0x20e65a(0x1fb)],![])[_0x20e65a(0x20c)]({'path':_0x20e65a(0x1b1),'data':{'email':_0x1aa8d2,'password':await _0x4ae71c[_0x20e65a(0x245)](h,_0x53b52e)}});}async function oe(){const _0x5a41a9=_0x8758b9,_0x39d235={'xXavo':function(_0x2e3cec,_0x36deeb,_0x47fa9a){return _0x2e3cec(_0x36deeb,_0x47fa9a);},'sSptp':'/profile'};return _0x39d235['xXavo'](m,_0x5a41a9(0x1d1),!![])[_0x5a41a9(0x22a)]({'path':_0x39d235[_0x5a41a9(0x22c)]});}async function ie(){const _0x1aeb85=_0x8758b9,_0x1212b6={};_0x1212b6['yngAN']=_0x1aeb85(0x1d1);const _0x1f23d5=_0x1212b6,_0x2dbdac={};return _0x2dbdac['path']=_0x1aeb85(0x222),m(_0x1f23d5[_0x1aeb85(0x242)],!![])['GET'](_0x2dbdac);}exports[_0x8758b9(0x241)+'ck']=ie,exports['fetchLog'+'in']=ne,exports[_0x8758b9(0x1b2)+_0x8758b9(0x1af)]=oe;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as axios from 'axios';
|
|
2
|
+
import { I as ILogin } from '../login-Dq5rerGn.cjs';
|
|
3
|
+
|
|
4
|
+
declare function fetchLogin({ email, password }: ILogin): Promise<axios.AxiosResponse<{
|
|
5
|
+
token: string;
|
|
6
|
+
}, any, {}>>;
|
|
7
|
+
declare function fetchProfile(): Promise<axios.AxiosResponse<{
|
|
8
|
+
name: string;
|
|
9
|
+
}, any, {}>>;
|
|
10
|
+
declare function fetchCheck(): Promise<axios.AxiosResponse<{
|
|
11
|
+
message: string;
|
|
12
|
+
}, any, {}>>;
|
|
13
|
+
|
|
14
|
+
export { fetchCheck, fetchLogin, fetchProfile };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as axios from 'axios';
|
|
2
|
+
import { I as ILogin } from '../login-Dq5rerGn.js';
|
|
3
|
+
|
|
4
|
+
declare function fetchLogin({ email, password }: ILogin): Promise<axios.AxiosResponse<{
|
|
5
|
+
token: string;
|
|
6
|
+
}, any, {}>>;
|
|
7
|
+
declare function fetchProfile(): Promise<axios.AxiosResponse<{
|
|
8
|
+
name: string;
|
|
9
|
+
}, any, {}>>;
|
|
10
|
+
declare function fetchCheck(): Promise<axios.AxiosResponse<{
|
|
11
|
+
message: string;
|
|
12
|
+
}, any, {}>>;
|
|
13
|
+
|
|
14
|
+
export { fetchCheck, fetchLogin, fetchProfile };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x3b4f14,_0x22422b){var _0x2d7dd1=_0xf881,_0x1bd239=_0x3b4f14();while(!![]){try{var _0x42916a=parseInt(_0x2d7dd1(0x18e))/(0x11c2*-0x2+-0x4*0x277+-0x1*-0x2d61)+parseInt(_0x2d7dd1(0x18c))/(0x142b+0x270b+-0x1a5*0x24)*(-parseInt(_0x2d7dd1(0x18a))/(-0x2065+-0x1*-0x12b2+0xdb6))+-parseInt(_0x2d7dd1(0x188))/(0x1*-0xf4d+-0xb*-0x103+-0x86*-0x8)+-parseInt(_0x2d7dd1(0x196))/(0x1762+0x1ea9+0x1b03*-0x2)*(-parseInt(_0x2d7dd1(0x194))/(-0x227+-0x180c+-0x31*-0x89))+-parseInt(_0x2d7dd1(0x189))/(-0xd72*-0x1+0x3c2+-0x1*0x112d)+parseInt(_0x2d7dd1(0x18f))/(0x1*-0x7a5+-0x11*0x21d+0x2b9a)+-parseInt(_0x2d7dd1(0x18d))/(0xada+0x1a0c+-0x24dd)*(-parseInt(_0x2d7dd1(0x184))/(0x1ab8+-0x288+-0x1826));if(_0x42916a===_0x22422b)break;else _0x1bd239['push'](_0x1bd239['shift']());}catch(_0x10ec7e){_0x1bd239['push'](_0x1bd239['shift']());}}}(_0x3ff8,0x549fb+-0x3e971+0x59a26));import{b,a}from'../chunk-ACO6G7O2.js';import'../chunk-DJ5M3T5L.js';async function i({email:_0x45882a,password:_0x2a3a9f}){var _0x2df448=_0xf881,_0x5ef8df={'BQiDU':function(_0x476b09,_0x839ffa,_0x44a10d){return _0x476b09(_0x839ffa,_0x44a10d);},'NiIPu':_0x2df448(0x190),'QgbnB':function(_0x13ce95,_0x1ce3ae){return _0x13ce95(_0x1ce3ae);}};return _0x5ef8df[_0x2df448(0x195)](b,_0x2df448(0x192),![])[_0x2df448(0x185)]({'path':_0x5ef8df['NiIPu'],'data':{'email':_0x45882a,'password':await _0x5ef8df[_0x2df448(0x191)](a,_0x2a3a9f)}});}async function c(){var _0x36feba=_0xf881,_0x412b42={};_0x412b42[_0x36feba(0x193)]=_0x36feba(0x192),_0x412b42[_0x36feba(0x187)]=_0x36feba(0x18b);var _0x45b04a=_0x412b42;return b(_0x45b04a['jgETt'],!![])[_0x36feba(0x186)]({'path':_0x45b04a[_0x36feba(0x187)]});}function _0xf881(_0x2a3a9f,_0x5ef8df){_0x2a3a9f=_0x2a3a9f-(-0x1e9*-0x4+-0x1e*-0x33+-0x1*0xc1a);var _0x476b09=_0x3ff8();var _0x839ffa=_0x476b09[_0x2a3a9f];if(_0xf881['wVoGdS']===undefined){var _0x44a10d=function(_0x45b04a){var _0x4890da='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1f4888='',_0x531f13='';for(var _0x25e05a=0x1684+0x1d12+-0x3396,_0x5a925c,_0x43ec85,_0x1a84a0=-0xc*0x4d+0x4*-0x95+0x5*0x130;_0x43ec85=_0x45b04a['charAt'](_0x1a84a0++);~_0x43ec85&&(_0x5a925c=_0x25e05a%(-0xfbc+0x2b*-0xd+0x11ef)?_0x5a925c*(0x9*0x96+0x1f08+-0x240e)+_0x43ec85:_0x43ec85,_0x25e05a++%(0x6df*0x3+-0x1af7+0x65e))?_0x1f4888+=String['fromCharCode'](0xc90+0x1815+-0x23a6&_0x5a925c>>(-(0x2b4+-0x1386+0x10d4)*_0x25e05a&0xe*-0x167+-0x494*-0x5+-0x45*0xc)):-0x2*0xee3+-0x10*-0x68+-0x296*-0x9){_0x43ec85=_0x4890da['indexOf'](_0x43ec85);}for(var _0x3b2ca8=0x15ed+0x34d*0x1+-0x2*0xc9d,_0x1ab758=_0x1f4888['length'];_0x3b2ca8<_0x1ab758;_0x3b2ca8++){_0x531f13+='%'+('00'+_0x1f4888['charCodeAt'](_0x3b2ca8)['toString'](-0x2349+0x97*0x11+-0x39e*-0x7))['slice'](-(-0x1*-0x23c9+0x67f+-0x2a46));}return decodeURIComponent(_0x531f13);};_0xf881['yGblwa']=_0x44a10d,_0xf881['fOtZzj']={},_0xf881['wVoGdS']=!![];}var _0x13ce95=_0x476b09[0x83+0x26b8+0x53*-0x79],_0x1ce3ae=_0x2a3a9f+_0x13ce95,_0x412b42=_0xf881['fOtZzj'][_0x1ce3ae];return!_0x412b42?(_0x839ffa=_0xf881['yGblwa'](_0x839ffa),_0xf881['fOtZzj'][_0x1ce3ae]=_0x839ffa):_0x839ffa=_0x412b42,_0x839ffa;}async function p(){var _0x10d707=_0xf881,_0x4890da={};_0x4890da['EKuxi']=_0x10d707(0x192);var _0x1f4888=_0x4890da,_0x531f13={};return _0x531f13[_0x10d707(0x197)]='/check',b(_0x1f4888[_0x10d707(0x198)],!![])['GET'](_0x531f13);}function _0x3ff8(){var _0x42c7c7=['r0vu','AK9dy1G','mtyYndCZmMTUyxbqzq','mJGXnJy3nhPVy1Pxta','mJC3odm5wwP5zNP2','l3bYB2zPBgu','mtHyzvzLrgy','mZG3AKXoC0vI','odiYnZCYwevNANni','nde5ndmXmMPtzNnXBa','l2XVz2LU','uwDIBKi','l2f1DgG','AMDfvhq','mta0otrgshLuqMu','qLfPrfu','nJmWAwXbsu1X','Cgf0Aa','ruT1EgK','mtiZnZmWve1oCwfq','ue9tva'];_0x3ff8=function(){return _0x42c7c7;};return _0x3ff8();}export{p as fetchCheck,i as fetchLogin,c as fetchProfile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x161fc6=_0xf9ef;(function(_0x58c907,_0x5233bb){const _0x100344=_0xf9ef,_0x54f8af=_0x58c907();while(!![]){try{const _0x2a9838=parseInt(_0x100344(0x129))/(-0x23*0x55+-0x2*0xc5+-0xa*-0x151)*(-parseInt(_0x100344(0x17b))/(-0x1437+-0x1*0x3d7+-0x4d0*-0x5))+parseInt(_0x100344(0x178))/(0x12fc+0x1f22+-0x321b)*(parseInt(_0x100344(0x19d))/(0x6e2+0xd11+0x1b*-0xbd))+parseInt(_0x100344(0x185))/(-0x48e*-0x4+-0x6d*-0x52+-0x351d*0x1)*(parseInt(_0x100344(0x192))/(0x268e+-0x12f5*-0x1+-0x397d*0x1))+-parseInt(_0x100344(0x137))/(0x1*-0x841+0x340+0x508)+parseInt(_0x100344(0x152))/(-0x1*-0x1a03+0x5*0xbf+-0x1db6)+-parseInt(_0x100344(0x199))/(-0x251e+-0x19e5*0x1+-0x14*-0x327)+parseInt(_0x100344(0x135))/(0x1*-0x264+0x104*0x6+-0x3aa)*(parseInt(_0x100344(0x1a0))/(0x1e29+-0x2*0x10a2+0x326));if(_0x2a9838===_0x5233bb)break;else _0x54f8af['push'](_0x54f8af['shift']());}catch(_0x4e0bb5){_0x54f8af['push'](_0x54f8af['shift']());}}}(_0x40f9,0x75d11+-0xaae4*0x5+0x42ee0));import{b as _0x28ed96,d}from'./chunk-DJ5M3T5L.js';import _0x20b29f,{HttpStatusCode}from'axios';function x(_0x2f4327){const _0xdc9ff1=_0xf9ef,_0x516607={'nASmq':function(_0x46dadf,_0x79ffbd){return _0x46dadf!=_0x79ffbd;},'JRytL':'object','IIgYB':_0xdc9ff1(0x141),'XUHsB':_0xdc9ff1(0x196),'TSsPH':function(_0x38cff9,_0x126769){return _0x38cff9(_0x126769);},'crJBR':function(_0x593ce8,_0x2d673e){return _0x593ce8==_0x2d673e;}};try{if(_0x516607[_0xdc9ff1(0x157)]!==_0x516607['XUHsB']){let _0x5b502a=_0x2f4327['split']('.')[-0x1*0x158e+0xb1a*-0x2+0x2bc3][_0xdc9ff1(0x191)](/-/g,'+')[_0xdc9ff1(0x191)](/_/g,'/'),_0x1a1312=JSON[_0xdc9ff1(0x197)](_0x516607[_0xdc9ff1(0x19f)](atob,_0x5b502a));return _0x516607[_0xdc9ff1(0x16a)](typeof _0x1a1312['exp'],'number')&&_0x1a1312[_0xdc9ff1(0x143)]*(0x1d56+0x567+0x36d*-0x9)<Date[_0xdc9ff1(0x18a)]();}else return!_0x419c8c||_0x516607[_0xdc9ff1(0x183)](typeof _0x207f98,_0x516607[_0xdc9ff1(0x13b)])?'':_0x1d648d[_0xdc9ff1(0x174)](_0x554b41)['filter'](([,_0x1c01aa])=>_0x1c01aa!=null)[_0xdc9ff1(0x122)](([_0x375e0a],[_0x2b6c60])=>_0x375e0a<_0x2b6c60?-(-0x132d*0x1+-0x4*0x806+-0x1*-0x3346):_0x375e0a>_0x2b6c60?-0x2*-0x433+-0xb45+-0x20*-0x17:-0x318+-0xe74+0x1*0x118c)[_0xdc9ff1(0x170)](([_0x235964,_0x4972ce])=>_0x54ba91(_0x235964)+'='+_0x527b0e(_0x4017c1(_0x4972ce)))['join']('&');}catch{return![];}}function T(_0x76493e){const _0x3a1209=_0xf9ef;return Array[_0x3a1209(0x18f)](new Uint8Array(_0x76493e))[_0x3a1209(0x170)](_0x24b9b0=>_0x24b9b0[_0x3a1209(0x176)](0x138*-0x16+0x45b+-0x481*-0x5)[_0x3a1209(0x173)](-0x23c6+-0x2578+0x4940,'0'))['join']('');}async function P(_0x27d305){const _0x523b5e=_0xf9ef,_0x20f687={'KFHJQ':_0x523b5e(0x184),'eYAJm':function(_0x373bd6,_0x44fc69){return _0x373bd6(_0x44fc69);}};let _0x3ca438=await crypto[_0x523b5e(0x132)]['digest'](_0x20f687[_0x523b5e(0x148)],new TextEncoder()[_0x523b5e(0x14b)](_0x27d305));return _0x20f687[_0x523b5e(0x168)](T,_0x3ca438);}function A(_0x125541){const _0x24c022=_0xf9ef;return!_0x125541||typeof _0x125541!=_0x24c022(0x169)?'':Object['entries'](_0x125541)[_0x24c022(0x171)](([,_0x5ad661])=>_0x5ad661!=null)['sort'](([_0x59958b],[_0x2d7707])=>_0x59958b<_0x2d7707?-(0xb*-0x2a6+0x235d+-0x63a):_0x59958b>_0x2d7707?-0x2533+0x6*0xe0+-0x1ff4*-0x1:-0x1*0x4c4+0x2*-0x1323+0xe*0x313)[_0x24c022(0x170)](([_0x1d4d7f,_0x7b007])=>encodeURIComponent(_0x1d4d7f)+'='+encodeURIComponent(String(_0x7b007)))[_0x24c022(0x189)]('&');}function _0x40f9(){const _0x4749b5=['wNLTvLC','qMvHCMvYia','BKftBxe','u0Hblti1nG','mtKWntbxr0fvv3C','w1jfrefdveu','y29UzMLN','revmrvrf','AM9PBG','BM93','CMfKysbKzwW','C2LNBG','r0vu','Dgv4Da','zNjVBq','rwDWy3q','CMvWBgfJzq','mty4yKjoDvbs','yxjYyxLIDwy','C3rHDhvZ','zgvSzxrL','B1jRCfq','CgfYC2u','vg9Rzw4GzxG','oduZmJu0ow1Uz3LdAa','wc1tAwDUyxq','B3b0Aw9UCW','uefuq0G','nfbHzg1pzq','Aw9Ul2PZB24','vfnZueG','mZnZA2PHugi','DxjL','Cg9ZDa','CMvXDwvZDa','Dc1jra','BhDNt0K','zNftC2O','Cgf0y2G','Aw5JBhvKzxm','CxHdq3i','C29YDa','lhy9','txzNqum','qxv0Ag9YAxO','DNbuq24','yxHPB3ndB24','BhDQBgW','mwfZCKfyDG','AgvHza','zgf0yq','igDHDgv3yxK','BeXXy0S','zMXVB3i','AuvZuuW','ysbPBMvZCgu','ufvu','C3vIDgXL','B25MAwC','AgvHzgvYCW','nJmZndy3mfLvENH5EG','DhLWzq','nJGZnty0mgXnExrfua','Chv0','Bwv0Ag9K','Dg9vChbLCKm','sLj5DeW','y29UDgvUDc0','DxnLqxv0Ag8','uKfntfy','yMfZzvvsta','yxnL','CKHXwve','CgfYyw1Z','zxHW','yxbPq2XPzw4','CMvZCg9UC2u','AwveBM4','zMLN','s0zisLe','DJe6','CMvQzwn0','zw5JB2rL','z0fJEem','ks4GrxnWzxi','uMvZChvLC3q','v25byNm','AgfZ','wc1szxf1zxm','mZC3nJu1mLHAweLsyW','rMLxB08','DxnL','vw5HDxrOB3i','Cg93','suLNwui','x3jLDhj5q28','ue9tva','CMf3','zMvY','A2vU','CgLYywrV','r056s08','rufzsfi','tvriExi','CMfUzg9Tvvu','Cgf0Aa','DxjS','yM9VBgvHBG','AxnszwrPCMu','se1bqW','AgnyEvq','zvLbsM0','B2jQzwn0','y3jkqLi','CMvTB3zLvg8','yxrPB24','ExzYBeS','AwnHDgLVBI8','vhLWzq','BwfW','zMLSDgvY','Dw50','CgfKu3rHCNq','zw50CMLLCW','CML6yxrPB24','Dg9tDhjPBMC','y2XLyxi','mZqYmtm1rNDsrvzN','Dg9YCW','z2v0','mJyXmJy2y1vnt2Du','y29TyMLUzum','y3jLyxrL','y3rPBMC','DLHQwve','Aw1WB3j0s2u'];_0x40f9=function(){return _0x4749b5;};return _0x40f9();}function _0xf9ef(_0x248bed,_0x5e79ac){_0x248bed=_0x248bed-(-0x10b*-0x11+-0x1c*0x11f+0xec8);const _0x59db7e=_0x40f9();let _0x20dc23=_0x59db7e[_0x248bed];if(_0xf9ef['bypYEv']===undefined){var _0x1fc861=function(_0x59e275){const _0x56638d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48a210='',_0x429241='';for(let _0x241ee7=0x237e+-0x1c90+-0x1*0x6ee,_0x5862f0,_0x549882,_0x434f26=-0x4d5+0xa9b+0x5c6*-0x1;_0x549882=_0x59e275['charAt'](_0x434f26++);~_0x549882&&(_0x5862f0=_0x241ee7%(0x1*0x6cd+0x11*-0x20f+-0x1c36*-0x1)?_0x5862f0*(-0x43*0x5c+-0x622+0x1e76)+_0x549882:_0x549882,_0x241ee7++%(-0x991+0x3f0*-0x5+0x1d45))?_0x48a210+=String['fromCharCode'](-0x44*-0x20+-0x29*-0xc8+-0x15d*0x1d&_0x5862f0>>(-(-0x1de4+0xeaf+0x29*0x5f)*_0x241ee7&0x27a*-0x7+-0x26d7*0x1+-0x1*-0x3833)):0x114f+0x59d*-0x2+-0x1*0x615){_0x549882=_0x56638d['indexOf'](_0x549882);}for(let _0x444434=-0x98c+0x214f*-0x1+0x2adb,_0x35130e=_0x48a210['length'];_0x444434<_0x35130e;_0x444434++){_0x429241+='%'+('00'+_0x48a210['charCodeAt'](_0x444434)['toString'](0x253c+0x2b6+-0x27e2))['slice'](-(0x266a+-0xdbe*0x1+-0x18aa));}return decodeURIComponent(_0x429241);};_0xf9ef['cwirYI']=_0x1fc861,_0xf9ef['zUeSMW']={},_0xf9ef['bypYEv']=!![];}const _0x48e7c9=_0x59db7e[0x162+-0xf21*-0x1+-0x1083*0x1],_0x471658=_0x248bed+_0x48e7c9,_0xe18b3a=_0xf9ef['zUeSMW'][_0x471658];return!_0xe18b3a?(_0x20dc23=_0xf9ef['cwirYI'](_0x20dc23),_0xf9ef['zUeSMW'][_0x471658]=_0x20dc23):_0x20dc23=_0xe18b3a,_0x20dc23;}async function b(_0xe07290,_0x1fce3c,_0x59e122,_0x12cf0d='',_0x108661=''){const _0x2825fc=_0xf9ef,_0x4112af={'YFrPJ':function(_0x5f1ff9,_0x4cce75){return _0x5f1ff9/_0x4cce75;},'GNzKO':function(_0x1e146a,_0x1a758b){return _0x1e146a(_0x1a758b);},'Egpct':_0x2825fc(0x15a),'MvgAC':_0x2825fc(0x166),'RAMLV':_0x2825fc(0x184),'FiWoO':_0x2825fc(0x18c)};let _0x2fa629=Math[_0x2825fc(0x12e)](_0x4112af['YFrPJ'](Date['now'](),-0x1a1a+0x16f1+0x3*0x25b))['toString'](),_0x53ea54=await _0x4112af['GNzKO'](P,_0x108661),_0x3c4c41=_0x2825fc(0x149)+_0x2fa629+':'+_0x1fce3c[_0x2825fc(0x13a)+_0x2825fc(0x140)]()+':'+_0x59e122+':'+_0x12cf0d+':'+_0x53ea54,_0x55dc2f=new TextEncoder(),_0x3d5d56=await crypto[_0x2825fc(0x132)][_0x2825fc(0x180)+'y'](_0x4112af[_0x2825fc(0x190)],_0x55dc2f[_0x2825fc(0x14b)](_0xe07290),{'name':_0x4112af[_0x2825fc(0x124)],'hash':_0x4112af[_0x2825fc(0x13e)]},![],[_0x4112af[_0x2825fc(0x153)]]),_0x25683a=await crypto[_0x2825fc(0x132)][_0x2825fc(0x18c)](_0x4112af[_0x2825fc(0x124)],_0x3d5d56,_0x55dc2f[_0x2825fc(0x14b)](_0x3c4c41));return't='+_0x2fa629+_0x2825fc(0x123)+_0x4112af[_0x2825fc(0x15e)](T,_0x25683a);}var I=[_0x161fc6(0x125)+_0x161fc6(0x16c),_0x161fc6(0x19a)+_0x161fc6(0x1a1)];function w(_0x2767ee){const _0x130bd6=_0x161fc6,_0x3a0f35={};_0x3a0f35[_0x130bd6(0x16d)]=function(_0x10cb7f,_0x25b029){return _0x10cb7f!=_0x25b029;},_0x3a0f35[_0x130bd6(0x167)]='object',_0x3a0f35[_0x130bd6(0x146)]=_0x130bd6(0x186)+'D]';const _0x2d1a6d=_0x3a0f35;if(!_0x2767ee||_0x2d1a6d[_0x130bd6(0x16d)](typeof _0x2767ee,_0x2d1a6d['hcXyT']))return;let _0x2cfc0b=_0x2767ee;for(let _0x4eb948 of[_0x2cfc0b[_0x130bd6(0x187)]?.[_0x130bd6(0x134)],_0x2cfc0b[_0x130bd6(0x1a3)]?.['headers']])if(_0x4eb948){for(let _0xd05b5b of I)_0x4eb948[_0xd05b5b]&&(_0x4eb948[_0xd05b5b]=_0x2d1a6d[_0x130bd6(0x146)]);}}var $=new Set([-0x3*0xab3+0xa51+0x2c*0x88,0x202+0x17de+0x1*-0x1833,-0x4*-0x665+0x120f+0x29ad*-0x1,0x1*0x1bb5+-0x2c*-0xbb+-0x39e2,0x25a1+0x1419+-0x37c2]),j=new Set([_0x161fc6(0x17a),_0x161fc6(0x12a),_0x161fc6(0x19b),_0x161fc6(0x138),_0x161fc6(0x195)]),v=new Set(['blob',_0x161fc6(0x193)+_0x161fc6(0x15b),'stream','document',_0x161fc6(0x18e)]),a=class a{constructor({API_URL:_0x5c199e,useAuthorization:_0x4cd0bf,clientId:_0x4e8650,tokenStorage:_0x1e7235,timeout:_0x20171b,signingKey:_0x4d532e,maxRetries:_0x149572,onUnauthorized:_0x3f935b}){const _0x41ec60=_0x161fc6,_0x1b5d8b={'vXjYQ':_0x41ec60(0x151)+_0x41ec60(0x1a4),'HdCqR':function(_0x2334b3,_0x559785){return _0x2334b3(_0x559785);},'WnAbs':function(_0x5ad76f){return _0x5ad76f();},'qxCCr':function(_0x26526a,_0x2fd5ea,_0x1f8bb2){return _0x26526a(_0x2fd5ea,_0x1f8bb2);},'MTHyr':_0x41ec60(0x198)+_0x41ec60(0x15d),'lwgOI':_0x41ec60(0x17a),'AoXGE':function(_0x50d424,_0x1a576b){return _0x50d424!=_0x1a576b;},'vpTCn':function(_0x3dabbd,_0x37ecdf){return _0x3dabbd(_0x37ecdf);},'ZymVW':_0x41ec60(0x13c)+_0x41ec60(0x136),'gAcxC':_0x41ec60(0x164),'KWXQb':function(_0x3d7202,_0x5f0080){return _0x3d7202 in _0x5f0080;},'lLqcK':_0x41ec60(0x12b),'fqSsj':function(_0x52bdc0,_0x137770){return _0x52bdc0&&_0x137770;},'lwjll':function(_0x2a1760,_0x46904d){return _0x2a1760<_0x46904d;},'iEsQL':function(_0x13df0b){return _0x13df0b();},'EAYHR':'applicat'+'ion/json'},_0x4d5572={};_0x4d5572['Content-'+_0x41ec60(0x16f)]=_0x1b5d8b[_0x41ec60(0x15f)],_0x4d5572['auth']=_0x4e8650;const _0x3e8b31={};_0x3e8b31[_0x41ec60(0x13f)]=_0x5c199e,_0x3e8b31['timeout']=_0x20171b,_0x3e8b31['headers']=_0x4d5572,(this['useAutho'+'rization']=_0x4cd0bf,this['apiClien'+'t']=_0x20b29f[_0x41ec60(0x17d)](_0x3e8b31),this[_0x41ec60(0x144)+'t']['intercep'+_0x41ec60(0x179)][_0x41ec60(0x1a3)][_0x41ec60(0x154)](async _0x51318b=>{const _0x321882=_0x41ec60;if(_0x51318b['headers'][_0x1b5d8b[_0x321882(0x17f)]]=crypto[_0x321882(0x161)+'ID'](),this[_0x321882(0x13d)+_0x321882(0x175)]){let _0x35712c=_0x1e7235['getToken']();if(_0x35712c&&_0x1b5d8b['HdCqR'](x,_0x35712c))return a['isRedire'+_0x321882(0x17e)]||(a[_0x321882(0x165)+_0x321882(0x17e)]=!![],_0x1e7235['removeTo'+_0x321882(0x15c)](),_0x1b5d8b[_0x321882(0x14f)](_0x3f935b),_0x1b5d8b[_0x321882(0x121)](setTimeout,()=>{const _0x3b4c6b=_0x321882;a['isRedire'+_0x3b4c6b(0x17e)]=![];},-0x126c+0xfd1+0x683*0x1)),Promise['reject'](new Error(_0x1b5d8b[_0x321882(0x160)]));_0x35712c&&(_0x51318b[_0x321882(0x134)]['Authoriz'+'ation']=_0x321882(0x182)+_0x35712c);}if(_0x4d532e){let _0x2be478=_0x51318b[_0x321882(0x139)]??_0x1b5d8b[_0x321882(0x1a5)],_0x27e3a4=_0x51318b[_0x321882(0x163)]??'',_0x408609=_0x1b5d8b['HdCqR'](A,_0x51318b['params']),_0x38ac32=_0x1b5d8b['AoXGE'](_0x51318b[_0x321882(0x12b)],null)?JSON['stringif'+'y'](_0x51318b[_0x321882(0x12b)]):'';_0x51318b[_0x321882(0x134)]['X-Signat'+_0x321882(0x1a1)]=await b(_0x4d532e,_0x2be478,_0x27e3a4,_0x408609,_0x38ac32);}return _0x51318b;},_0x5c5db6=>Promise[_0x41ec60(0x14a)](_0x5c5db6)),this[_0x41ec60(0x144)+'t']['intercep'+'tors'][_0x41ec60(0x145)][_0x41ec60(0x154)](_0x1393af=>{const _0x369329=_0x41ec60;let _0x2f73a3=_0x1b5d8b[_0x369329(0x126)](String,_0x1393af[_0x369329(0x134)][_0x1b5d8b[_0x369329(0x181)]]??''),_0xfbe757=_0x1393af[_0x369329(0x187)]?.['response'+_0x369329(0x16f)]??'';if(_0x1393af[_0x369329(0x12b)]&&!v['has'](_0xfbe757)&&!_0x2f73a3[_0x369329(0x120)]('applicat'+_0x369329(0x19e)))return Promise[_0x369329(0x14a)](new Error(_0x369329(0x14e)+_0x369329(0x130)+_0x369329(0x18b)+_0x369329(0x12c)+'\x20('+_0x2f73a3+(_0x369329(0x14d)+'aba\x20appl'+_0x369329(0x16e)+'json.')));let _0x2e5421=_0x1393af[_0x369329(0x12b)];return _0x2e5421&&typeof _0x2e5421['success']==_0x1b5d8b[_0x369329(0x14c)]&&_0x1b5d8b['KWXQb'](_0x1b5d8b[_0x369329(0x12d)],_0x2e5421)&&(_0x1393af[_0x369329(0x12b)]=_0x2e5421[_0x369329(0x12b)]),_0x1393af;},async _0x16fcc8=>{const _0x1a7a72=_0x41ec60;_0x1b5d8b[_0x1a7a72(0x126)](w,_0x16fcc8);let _0x8a343=_0x16fcc8[_0x1a7a72(0x187)],_0x25130e=_0x16fcc8[_0x1a7a72(0x145)]?.[_0x1a7a72(0x194)],_0x23288b=(_0x8a343?.[_0x1a7a72(0x139)]??_0x1a7a72(0x17a))['toLowerC'+_0x1a7a72(0x140)](),_0x5cc66d=j[_0x1a7a72(0x150)](_0x23288b)&&(!_0x25130e||$[_0x1a7a72(0x150)](_0x25130e)),_0x4c1955=_0x8a343?.[_0x1a7a72(0x158)+_0x1a7a72(0x172)]??-0x2493+-0x1f97+0x442a;if(_0x1b5d8b[_0x1a7a72(0x1a6)](_0x8a343,_0x5cc66d)&&_0x1b5d8b[_0x1a7a72(0x128)](_0x4c1955,_0x149572)){_0x8a343[_0x1a7a72(0x158)+_0x1a7a72(0x172)]=_0x4c1955+(0xe*-0x2+0x14b*-0x1b+-0x1183*-0x2);let _0x2b9523=Math[_0x1a7a72(0x156)](-0x11c8+-0x285*-0x2+0xcc0,_0x8a343[_0x1a7a72(0x158)+_0x1a7a72(0x172)])*(-0x23bf+0x1b7*-0x13+0x4648);return await new Promise(_0x3b08b0=>setTimeout(_0x3b08b0,_0x2b9523)),this[_0x1a7a72(0x144)+'t'](_0x8a343);}return _0x25130e===HttpStatusCode[_0x1a7a72(0x155)+'ized']&&!a['isRedire'+_0x1a7a72(0x17e)]&&(a[_0x1a7a72(0x165)+_0x1a7a72(0x17e)]=!![],_0x1e7235[_0x1a7a72(0x16b)+_0x1a7a72(0x15c)](),_0x1b5d8b[_0x1a7a72(0x12f)](_0x3f935b),_0x1b5d8b[_0x1a7a72(0x121)](setTimeout,()=>{const _0x1f62e2=_0x1a7a72;a[_0x1f62e2(0x165)+_0x1f62e2(0x17e)]=![];},0x4*0x34a+0x8*-0x1cd+-0x528*-0x1)),Promise['reject'](_0x16fcc8);}));}[_0x161fc6(0x17c)+_0x161fc6(0x133)](_0x35270a,_0x2b6b5a){const _0x21e684=_0x161fc6,_0xe288a1={..._0x35270a?.['axiosCon'+_0x21e684(0x147)]};return _0xe288a1[_0x21e684(0x134)]={..._0x35270a?.[_0x21e684(0x127)+_0x21e684(0x147)]?.[_0x21e684(0x134)],..._0x2b6b5a?.['headers']},_0xe288a1[_0x21e684(0x142)]=_0x35270a?.[_0x21e684(0x142)],_0xe288a1['data']=_0x35270a?.['data'],_0xe288a1;}async[_0x161fc6(0x18d)](_0x4bd0e0,_0x30677c){const _0x51836e=_0x161fc6;return this[_0x51836e(0x144)+'t']['get'](_0x4bd0e0?.[_0x51836e(0x162)]??'',this[_0x51836e(0x17c)+'onfig'](_0x4bd0e0,_0x30677c));}async[_0x161fc6(0x159)](_0x3e26ff,_0x402d2a){const _0x3e53e6=_0x161fc6;let _0x4edd9f=this[_0x3e53e6(0x17c)+'onfig'](_0x3e26ff,_0x402d2a);return this['apiClien'+'t'][_0x3e53e6(0x1a2)](_0x3e26ff['path']??'',_0x4edd9f[_0x3e53e6(0x12b)],_0x4edd9f);}async[_0x161fc6(0x131)](_0x20ff29,_0x432f67){const _0x379bdd=_0x161fc6;let _0x25e513=this[_0x379bdd(0x17c)+_0x379bdd(0x133)](_0x20ff29,_0x432f67);return this[_0x379bdd(0x144)+'t'][_0x379bdd(0x138)](_0x20ff29[_0x379bdd(0x162)]??'',_0x25e513[_0x379bdd(0x12b)],_0x25e513);}async[_0x161fc6(0x19c)](_0x4f3ce2,_0x47bb31){const _0x2b54bb=_0x161fc6;let _0x4d0172=this[_0x2b54bb(0x17c)+_0x2b54bb(0x133)](_0x4f3ce2,_0x47bb31);return this['apiClien'+'t'][_0x2b54bb(0x11f)](_0x4f3ce2['path']??'',_0x4d0172[_0x2b54bb(0x12b)],_0x4d0172);}async[_0x161fc6(0x188)](_0x4cc2e4,_0x21f71b){const _0x1555c2=_0x161fc6;return this[_0x1555c2(0x144)+'t'][_0x1555c2(0x195)](_0x4cc2e4[_0x1555c2(0x162)]??'',this[_0x1555c2(0x17c)+_0x1555c2(0x133)](_0x4cc2e4,_0x21f71b));}};a['isRedire'+'cting']=![];var m=a,S=m,h=new Map();_0x28ed96(()=>h[_0x161fc6(0x177)]());function X(_0x15fe5a,_0x339874){const _0x43de34=_0x161fc6;let _0x33fd4a=_0x15fe5a+'|'+_0x339874,_0x353396=h[_0x43de34(0x17a)](_0x33fd4a);if(_0x353396)return _0x353396;let {baseURL:_0x414895,clientId:_0xc39d52,tokenStorage:_0x59910b,timeout:_0x4772b5,signingKey:_0x4e12f7,maxRetries:_0x2aa753,onUnauthorized:_0x2dc9ff}=d(),_0x4ff8fc=new S({'API_URL':''+_0x414895+_0x15fe5a,'useAuthorization':_0x339874,'clientId':_0xc39d52,'tokenStorage':_0x59910b,'timeout':_0x4772b5,'signingKey':_0x4e12f7,'maxRetries':_0x2aa753,'onUnauthorized':_0x2dc9ff});return h['set'](_0x33fd4a,_0x4ff8fc),_0x4ff8fc;}export{P as a,X as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x4364(){const _0x58852d=['zxmGzguGDxm','B3jUBYbKzsa','yxiGy3vHBhe','w0bHz3jVC2G','Aw5Ll2fNCY0','ysbJCMvHDgu','zvvstgaGysa','z2v0sxrLBq','CMvWBgfJzq','vKLurv9bueK','y2GU','igjHC2uUifa','sevSuvq','yxnHigbIyxm','AwCOksbHBNq','mtu2ndyYwM95s3vv','y3jLyxrLshq','y2NdS24GzMv0','kcKGBYbKzwy','mty4nte2mevMz1bLsq','xsboBYbZzsa','DxvPza','BMrqCfO','CvH6svK','nZKYmdm0nerluLD3uq','shr0CenVBMy','zw5JB250CSoZ','mLnTDNzzvW','ihvUysbvuKW','mtK5nJy0mvL0BKvgCW','Dg9Rzw5lzxK','mti1ody1mdLyCKjsyLq','tu9QyLi','DhuGyxbWlG','DwLLCIbMDw4','yMfZzvvsta','ywrK','mti4mde1nwjnDhn1Cq','n2XQCwLTza','Aw5Lifzjveu','CMfNzq','Dg9Rzw5tDg8','igvUigXHCYa','mtC3nZu5Eefvu3rg'];_0x4364=function(){return _0x58852d;};return _0x4364();}(function(_0x5a03be,_0x205d4e){const _0x466f55=_0x45d7,_0x20a579=_0x5a03be();while(!![]){try{const _0x28e261=parseInt(_0x466f55(0x21d))/(-0x12c1+-0x1*-0xff2+0x2d0)*(-parseInt(_0x466f55(0x20d))/(0x13*0x16+0x1ac3*0x1+0x1c63*-0x1))+parseInt(_0x466f55(0x20f))/(0x4*-0x4e7+0x9e2+0x33f*0x3)+-parseInt(_0x466f55(0x205))/(0x608+-0x2640+0x203c)+parseInt(_0x466f55(0x217))/(-0xed6+0x22*-0x94+0x2283)+-parseInt(_0x466f55(0x201))/(0x27a*0x1+-0x1125+0xeb1*0x1)+-parseInt(_0x466f55(0x218))/(0x14*-0xef+-0x20e5+0x1fc*0x1a)*(parseInt(_0x466f55(0x20a))/(0x1*-0x95b+0xa7c*-0x3+-0xd9d*-0x3))+parseInt(_0x466f55(0x211))/(0x26*-0x1+-0x123a+-0x623*-0x3);if(_0x28e261===_0x205d4e)break;else _0x20a579['push'](_0x20a579['shift']());}catch(_0x16fbbd){_0x20a579['push'](_0x20a579['shift']());}}}(_0x4364,-0x3dac*0xf+-0x50db2+0x4*0x4db15));function a(_0x1faf06){const _0x4c265d=_0x45d7,_0x4dd56c={};_0x4dd56c[_0x4c265d(0x209)]=function(_0x5234cd,_0x2375ec){return _0x5234cd>_0x2375ec;};const _0x42eaab=_0x4dd56c;return{'getToken'(){const _0x49d1db=_0x4c265d;if(typeof localStorage>'u')return null;let _0x38a2ac=localStorage[_0x49d1db(0x1f9)](_0x1faf06);return _0x38a2ac?_0x38a2ac[_0x49d1db(0x1fa)](/"/g,''):null;},'removeToken'(){const _0x15decb=_0x4c265d;_0x42eaab[_0x15decb(0x209)](typeof localStorage,'u')||localStorage['removeIt'+'em'](_0x1faf06);}};}var n=null,i=new Set();function f(_0x818e05){const _0x5491e9=_0x45d7;i[_0x5491e9(0x216)](_0x818e05);}function u(_0x41de29){n=_0x41de29,i['forEach'](_0x4e9a4=>_0x4e9a4());}function c(){const _0x2f7eda=_0x45d7,_0x50b36b={'CcclY':_0x2f7eda(0x1f5)+_0x2f7eda(0x1f6)+'web-http'+']\x20Llama\x20'+_0x2f7eda(0x1f7)+_0x2f7eda(0x20b)+_0x2f7eda(0x200)+_0x2f7eda(0x1f2)+_0x2f7eda(0x1f4)+_0x2f7eda(0x214)+_0x2f7eda(0x203)+_0x2f7eda(0x1fc),'HElQT':function(_0x32be60,_0x13fb3e){return _0x32be60<_0x13fb3e;},'MOjbR':'[@agrosh'+_0x2f7eda(0x1f6)+'web-http'+_0x2f7eda(0x206)+_0x2f7eda(0x20c)+_0x2f7eda(0x20e)+_0x2f7eda(0x1fd)+_0x2f7eda(0x1ff)+_0x2f7eda(0x1f8)+_0x2f7eda(0x202)+'tpConfig'+_0x2f7eda(0x204)+_0x2f7eda(0x219)+'_API_URL'+_0x2f7eda(0x21c)+'variable'+'s\x20de\x20ent'+_0x2f7eda(0x1f3)+_0x2f7eda(0x213),'ndPpZ':function(_0x2ef150,_0x101002){return _0x2ef150(_0x101002);}};if(!n)throw new Error(_0x50b36b['CcclY']);let _0x381df1=import.meta.env?.[_0x2f7eda(0x1fb)+'_URL'],_0x12aa41=_0x50b36b[_0x2f7eda(0x1fe)](typeof process,'u')?process.env?.VITE_API_URL:void(-0x2595+-0x1237*-0x2+0x127),_0x3f085f=n[_0x2f7eda(0x215)]||_0x381df1||_0x12aa41||'';if(!_0x3f085f)throw new Error(_0x50b36b[_0x2f7eda(0x212)]);let _0x1cb1d6=n[_0x2f7eda(0x210)]??_0x2f7eda(0x207);return{'onUnauthorized':()=>{},'signingKey':'','tokenKey':_0x1cb1d6,'timeout':0x3a98,'maxRetries':0x2,...n,'baseURL':_0x3f085f,'tokenStorage':n[_0x2f7eda(0x21b)+_0x2f7eda(0x21a)]??_0x50b36b[_0x2f7eda(0x208)](a,_0x1cb1d6)};}function _0x45d7(_0x48c04f,_0x3ede47){_0x48c04f=_0x48c04f-(0x2*0x1d+0x3*0x313+-0x781*0x1);const _0x21a6c6=_0x4364();let _0x3aeafa=_0x21a6c6[_0x48c04f];if(_0x45d7['KkdwQr']===undefined){var _0x5b89f2=function(_0x10d49a){const _0x4e8905='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2f20e2='',_0x3f3e8e='';for(let _0x533d93=0x66a+-0x16fe+0x1094,_0x18703a,_0x3c394c,_0x303a34=0x1b12+-0x200*0xb+0xb*-0x76;_0x3c394c=_0x10d49a['charAt'](_0x303a34++);~_0x3c394c&&(_0x18703a=_0x533d93%(-0x5dc+-0x740+0xd20)?_0x18703a*(0x12ef+0x5a6+-0x1855)+_0x3c394c:_0x3c394c,_0x533d93++%(-0x1137*-0x2+-0x1198+0x1*-0x10d2))?_0x2f20e2+=String['fromCharCode'](-0x1963+0x1*0x1231+0xe9*0x9&_0x18703a>>(-(-0x1*-0x10f+-0x16b0+-0x1*-0x15a3)*_0x533d93&-0xc05+-0x2503+0x1a*0x1e3)):-0x90a+0x2*-0x698+0x163a){_0x3c394c=_0x4e8905['indexOf'](_0x3c394c);}for(let _0x5e7cee=0x1292*-0x1+-0x1192+0x2424,_0x1f234c=_0x2f20e2['length'];_0x5e7cee<_0x1f234c;_0x5e7cee++){_0x3f3e8e+='%'+('00'+_0x2f20e2['charCodeAt'](_0x5e7cee)['toString'](0x8eb+-0x1*0x20c8+0x17ed))['slice'](-(0x267b*-0x1+0x2050+0x5d*0x11));}return decodeURIComponent(_0x3f3e8e);};_0x45d7['vuyrbb']=_0x5b89f2,_0x45d7['TgaJtg']={},_0x45d7['KkdwQr']=!![];}const _0x84166a=_0x21a6c6[-0x1b4c+0x1a2d+-0x1*-0x11f],_0x4ad7c1=_0x48c04f+_0x84166a,_0x30c029=_0x45d7['TgaJtg'][_0x4ad7c1];return!_0x30c029?(_0x3aeafa=_0x45d7['vuyrbb'](_0x3aeafa),_0x45d7['TgaJtg'][_0x4ad7c1]=_0x3aeafa):_0x3aeafa=_0x30c029,_0x3aeafa;}export{a,f as b,u as c,c as d};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface ICrop {
|
|
2
|
+
_id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
season: string;
|
|
7
|
+
growth_cycle: number;
|
|
8
|
+
optimal_soil_type: string;
|
|
9
|
+
water_requirements: number;
|
|
10
|
+
pest_susceptibility: string;
|
|
11
|
+
climate_requirements: string;
|
|
12
|
+
planting_density: number;
|
|
13
|
+
harvest_time: string;
|
|
14
|
+
market_value: number;
|
|
15
|
+
export_potential: boolean;
|
|
16
|
+
common_uses: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type { ICrop as I };
|