@africanies/angular-web-sdk 0.1.6 → 0.1.7

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 (87) hide show
  1. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/README.md +85 -0
  2. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +4634 -0
  3. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  4. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/package.json +31 -0
  5. package/.nx/cache/13466509747676776487/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +2743 -0
  6. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/README.md +68 -0
  7. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  8. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  9. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +5 -0
  10. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/assets/carriers/dhl.svg +7 -0
  11. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +19395 -0
  12. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  13. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/package.json +35 -0
  14. package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +5493 -0
  15. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/README.md +46 -0
  16. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +231 -0
  17. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  18. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/package.json +35 -0
  19. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/tailwind-preset.cjs +262 -0
  20. package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +174 -0
  21. package/.nx/cache/run.json +27 -27
  22. package/.nx/cache/terminalOutputs/13466509747676776487 +21 -0
  23. package/.nx/cache/terminalOutputs/1446890025183346611 +32 -0
  24. package/.nx/cache/terminalOutputs/14995846848874973576 +21 -0
  25. package/.nx/cache/terminalOutputs/6337357866566791975 +6 -0
  26. package/.nx/cache/terminalOutputs/6673686859704879504 +21 -0
  27. package/.nx/cache/terminalOutputs/8032148447904822353 +183 -0
  28. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  29. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  30. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  31. package/.nx/workspace-data/d/daemon.log +1609 -0
  32. package/.nx/workspace-data/d/server-process.json +2 -2
  33. package/.nx/workspace-data/file-map.json +3428 -3428
  34. package/.nx/workspace-data/nx_files.nxt +0 -0
  35. package/.nx/workspace-data/project-graph.json +2 -2
  36. package/apps/playground/src/app/pages/button-page.ts +5 -3
  37. package/apps/playground/src/app/pages/feedback-page.ts +1 -1
  38. package/apps/playground/src/app/pages/home-page.ts +1 -1
  39. package/apps/playground/src/app/pages/icons-page.ts +3 -3
  40. package/apps/playground/src/app/pages/lecture-page.ts +3 -3
  41. package/apps/playground/src/app/pages/models-page.ts +1 -1
  42. package/apps/playground/src/app/pages/overlay-demos.ts +1 -1
  43. package/apps/playground/src/app/pages/tokens-page.ts +17 -3
  44. package/apps/playground/src/app/pages/usecases/onboarding-login.page.ts +1 -1
  45. package/apps/playground/src/app/pages/usecases/onboarding-reset-password.page.ts +1 -1
  46. package/apps/playground/src/app/pages/usecases/shipment-detail.page.ts +1 -1
  47. package/apps/playground/src/app/pages/viewport-preview.component.ts +1 -1
  48. package/apps/playground/src/app/snippets/button.snippets.ts +4 -3
  49. package/apps/playground/src/index.html +6 -0
  50. package/apps/playground/src/styles.css +4 -5
  51. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +131 -8
  52. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  53. package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +8 -6
  54. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +12 -2
  55. package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
  56. package/dist/libs/africanies-theme/tailwind-preset.cjs +16 -7
  57. package/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +11 -3
  58. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +83 -63
  59. package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
  60. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +11 -8
  61. package/libs/africanies-core/src/index.ts +1 -0
  62. package/libs/africanies-core/src/lib/notification/index.ts +1 -1
  63. package/libs/africanies-core/src/lib/notification/notification-link.spec.ts +40 -7
  64. package/libs/africanies-core/src/lib/notification/notification-link.ts +143 -7
  65. package/libs/africanies-theme/src/lib/mode-color.safelist.ts +8 -2
  66. package/libs/africanies-theme/src/lib/mode-color.service.ts +16 -0
  67. package/libs/africanies-theme/tailwind-preset.cjs +16 -7
  68. package/libs/africanies-ui/src/lib/button/button.component.ts +5 -1
  69. package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +1 -1
  70. package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +1 -1
  71. package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +1 -1
  72. package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +4 -4
  73. package/libs/africanies-ui/src/lib/forms/form-field.classes.ts +2 -2
  74. package/libs/africanies-ui/src/lib/forms/select/select.component.ts +1 -1
  75. package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +1 -1
  76. package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +2 -2
  77. package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +2 -2
  78. package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.html +2 -2
  79. package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +10 -6
  80. package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +21 -8
  81. package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +1 -1
  82. package/libs/africanies-ui/src/lib/overlay/modal.service.ts +1 -1
  83. package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +3 -3
  84. package/libs/africanies-ui/src/lib/table/table.component.ts +5 -5
  85. package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -4
  86. package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +1 -1
  87. 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
+ ```