@africanies/angular-web-sdk 0.1.8 → 0.1.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.
Files changed (53) hide show
  1. package/.angular/cache/22.0.9/playground/.tsbuildinfo +1 -1
  2. package/.nx/cache/17289624717336768573/dist/libs/africanies-core/README.md +85 -0
  3. package/.nx/cache/17289624717336768573/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4639 -0
  4. package/.nx/cache/17289624717336768573/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  5. package/.nx/cache/17289624717336768573/dist/libs/africanies-core/package.json +31 -0
  6. package/.nx/cache/17289624717336768573/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2748 -0
  7. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/README.md +68 -0
  8. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  9. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  10. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  11. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  12. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19500 -0
  13. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  14. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/package.json +35 -0
  15. package/.nx/cache/3953970051755345887/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5521 -0
  16. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/README.md +46 -0
  17. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +243 -0
  18. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  19. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/package.json +35 -0
  20. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/tailwind-preset.cjs +330 -0
  21. package/.nx/cache/4225324930345532464/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +176 -0
  22. package/.nx/cache/run.json +25 -25
  23. package/.nx/cache/terminalOutputs/12565224028063674529 +37 -0
  24. package/.nx/cache/terminalOutputs/13478445034325959094 +176 -0
  25. package/.nx/cache/terminalOutputs/15835338512221847842 +184 -182
  26. package/.nx/cache/terminalOutputs/17289624717336768573 +21 -0
  27. package/.nx/cache/terminalOutputs/17571479482482478257 +35 -0
  28. package/.nx/cache/terminalOutputs/3088264223473143358 +8 -0
  29. package/.nx/cache/terminalOutputs/3953970051755345887 +21 -0
  30. package/.nx/cache/terminalOutputs/4225324930345532464 +21 -0
  31. package/.nx/cache/terminalOutputs/4363587767476846758 +176 -0
  32. package/.nx/cache/terminalOutputs/8193462679279018087 +39 -0
  33. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  34. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  35. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  36. package/.nx/workspace-data/d/daemon.log +4460 -0
  37. package/.nx/workspace-data/d/server-process.json +2 -2
  38. package/.nx/workspace-data/file-map.json +2998 -3006
  39. package/.nx/workspace-data/nx_files.nxt +0 -0
  40. package/.nx/workspace-data/project-graph.json +2 -2
  41. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +6 -1
  42. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  43. package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +6 -1
  44. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +30 -55
  45. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  46. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +14 -16
  47. package/libs/africanies-core/src/index.ts +1 -1
  48. package/libs/africanies-core/src/lib/notification/notification-link.ts +6 -1
  49. package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +9 -9
  50. package/libs/africanies-ui/src/lib/layout/header-greeting.util.ts +0 -2
  51. package/libs/africanies-ui/src/lib/layout/header-weather.spec.ts +11 -40
  52. package/libs/africanies-ui/src/lib/layout/header-weather.ts +22 -63
  53. package/package.json +1 -1
@@ -0,0 +1,85 @@
1
+ # @africanies/africanies-core
2
+
3
+ API and app-wiring layer for the AFRICANIES Web SDK: SDK config, HTTP client,
4
+ shipping mode, mode-region metadata, TanStack Query default helpers, and
5
+ route-driven overlay registration.
6
+
7
+ ## Install peers
8
+
9
+ ```bash
10
+ # Published on npm (@africanies scope)
11
+ npm install @africanies/africanies-core @africanies/africanies-models @africanies/africanies-storage
12
+ ```
13
+
14
+ Peer dependencies: `@angular/common`, `@angular/core`, `@angular/router`,
15
+ `rxjs`, `@africanies/africanies-models`, `@africanies/africanies-storage`.
16
+
17
+ ## Quick start
18
+
19
+ ```ts
20
+ import { ApplicationConfig } from '@angular/core';
21
+ import {
22
+ provideAfricaniesSdk,
23
+ provideAfricaniesHttpClient,
24
+ provideOverlayRoutes,
25
+ createAfricaniesQueryClientDefaults,
26
+ } from '@africanies/africanies-core';
27
+
28
+ export const appConfig: ApplicationConfig = {
29
+ providers: [
30
+ provideAfricaniesSdk({ baseUrl: 'https://api.example.com', timeout: 30_000 }),
31
+ provideAfricaniesHttpClient(),
32
+ // optional extras:
33
+ // provideAfricaniesHttpClient({ interceptors: [correlationInterceptor] }),
34
+ // optional: provideOverlayRoutes([{ paramKey: 'modal', routes: { ... } }]),
35
+ ],
36
+ };
37
+
38
+ // TanStack Query (app dependency — pin exact experimental version):
39
+ // new QueryClient({ defaultOptions: createAfricaniesQueryClientDefaults() })
40
+ ```
41
+
42
+ ## Modules
43
+
44
+ | Area | Exports |
45
+ |------|---------|
46
+ | Config | `provideAfricaniesSdk`, `AFRICANIES_SDK_CONFIG`, `httpToasts` (`'off'` \| `'errors'` \| `'all'`) |
47
+ | Auth | `AuthService` (`forgot`), `isValidEmail`, `AuthTokenService` (`set` / `clear` / `get`) |
48
+ | Shipping | `ShippingModeService` (tab-scoped via `sessionStorage`), `shipmentModeInterceptor`, per-request `ApiRequestOptions.shippingMode` / `withShippingMode` |
49
+ | HTTP | `provideAfricaniesHttpClient`, `ApiClient` (auto-tags `withToast` from config / `ApiRequestOptions.toast`; optional `shippingMode` per call; HTTP failures → `Error` with formatted `.message`), `withToast`, `withShippingMode`, `httpToastInterceptor`, `normalize` (lifts Laravel validation bags into `errors` + joined `message`), `formatApiErrorMessage` (used internally; rare for hosts), `fieldErrorsMap`, `authInterceptor` |
50
+ | Query | `createAfricaniesQueryClientDefaults`, `provideAfricaniesQueryDefaults`, `listFetchKind` (body loader on first load / STN↔SFN; keep rows on focus / Refresh / pager) |
51
+ | Mode | `ModeConfigService`, `provideModeConfig`, `MODE_CONFIG_PATH` |
52
+ | Country | `CountryService`, `countryFlagUrl` / `mapCountrySelectOptions` (flagcdn.com), `COUNTRY_READ_PATH`, mappers |
53
+ | Service | `ServiceService` (`readPage` / `readAll` / `readById`), `SERVICE_READ_PATH` (`/public/service/read`), mappers |
54
+ | Document | `DocumentService` (`readPage` / `readAll` / `readById`), `DOCUMENT_READ_PATH` (`/public/document/read`) — preview via `file_ref` on by-id |
55
+ | Plan | `PlanService` (`readPage` / `readAll` / `readById`), `PLAN_READ_PATH` (`/public/plan/read`), mappers |
56
+ | Currency | `CurrencyService` (`readPage` / `readAll` / `readById`, `create` / `update` / `remove`), `CURRENCY_*_PATH`, mappers |
57
+ | Payment method | `PaymentMethodService` (`readPage` / `readAll` / `readById`, `update`), `PAYMENT_METHOD_READ_PATH` / `PAYMENT_METHOD_UPDATE_PATH`, mappers |
58
+ | Shipment method | `ShipmentMethodService` (`readPage` / `readAll` / `readById`), `SHIPMENT_METHOD_READ_PATH`, mappers |
59
+ | Warehouse | `WarehouseService` (`readPage` / `readAll` / `readById`), `WAREHOUSE_READ_PATH`, mappers |
60
+ | Zone | `ZoneService` (`readPage` / `readAll` / `readById`), `ZONE_READ_PATH`, mappers |
61
+ | Product | `ProductService` (`readPage` / `readAll` / `readById`), `PRODUCT_READ_PATH`, mappers |
62
+ | User | `UserService` (`me`, `changePassword`, `logoutFromAllSessions`), `USER_PATH`, `mapUser` (bare `/user` body; needs `AuthTokenService.set`) |
63
+ | Notification | `NotificationService` (`readPage` / `readAll` / `readOne`), `NOTIFICATION_READ_PATH`, `mapNotification` / `mapNotificationInboxItem` |
64
+ | File | `FileService` (`read` / `readMultiple` → `POST /file/read`), `FILE_READ_PATH`, `mapFileRead` / `mapFileReadList` |
65
+ | Overlay | `provideOverlayRoutes`, `RouteOverlayService`, `MODAL_SERVICE`, `DRAWER_SERVICE` |
66
+ | Filters | `FilterOptionsResolver` (`resolveField` lazy in drawer), `mergeFilterOptionLists`, warehouse/method mappers |
67
+ | Browser | `copyToClipboard`, `downloadCsv` / `csvCell` (UTF-8 CSV download) |
68
+
69
+ List-style GETs follow `ResourceId`: `null` (paginated), `'all'` (full dump), `number` (single).
70
+
71
+ | Filter `optionsSource` | SDK resolver |
72
+ |------------------------|--------------|
73
+ | `warehouses` | Lazy `FilterOptionsResolver.resolveField` → `WarehouseService.readAll()` |
74
+ | `shipmentMethods` | Lazy `FilterOptionsResolver.resolveField` → `ShipmentMethodService.readAll()` |
75
+ | `shipmentManifests` | Host `optionLists` (no built-in service yet) |
76
+
77
+ `MODAL_SERVICE` / `DRAWER_SERVICE` are tokens only — implementations ship in
78
+ `@africanies/africanies-ui` to avoid circular dependencies.
79
+
80
+ ## Build / test
81
+
82
+ ```bash
83
+ npx nx build africanies-core
84
+ npx nx test africanies-core
85
+ ```