@africanies/angular-web-sdk 0.1.5 → 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.
- package/.nx/cache/{13524438527920092277 → 13466509747676776487}/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +140 -52
- package/.nx/cache/13466509747676776487/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
- package/.nx/cache/{13524438527920092277 → 13466509747676776487}/dist/libs/africanies-core/package.json +3 -3
- package/.nx/cache/{13524438527920092277 → 13466509747676776487}/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +14 -11
- package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +539 -232
- package/.nx/cache/14995846848874973576/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
- package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/package.json +5 -5
- package/.nx/cache/{5741611231803799383 → 14995846848874973576}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +111 -28
- package/.nx/cache/{1275815545780424169 → 6673686859704879504}/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +16 -0
- package/.nx/cache/6673686859704879504/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
- package/.nx/cache/{14153928176747262656 → 6673686859704879504}/dist/libs/africanies-theme/package.json +3 -3
- package/.nx/cache/{1275815545780424169 → 6673686859704879504}/dist/libs/africanies-theme/tailwind-preset.cjs +31 -14
- package/.nx/cache/{14153928176747262656 → 6673686859704879504}/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +18 -1
- package/.nx/cache/run.json +18 -18
- package/.nx/cache/terminalOutputs/{4011892767661954819 → 13466509747676776487} +1 -1
- package/.nx/cache/terminalOutputs/1446890025183346611 +32 -0
- package/.nx/cache/terminalOutputs/{3064561615116090625 → 14995846848874973576} +7 -7
- package/.nx/cache/terminalOutputs/6337357866566791975 +6 -0
- package/.nx/cache/terminalOutputs/{1275815545780424169 → 6673686859704879504} +1 -1
- package/.nx/cache/terminalOutputs/{12148417737220755248 → 8032148447904822353} +182 -174
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
- package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
- package/.nx/workspace-data/d/daemon.log +2461 -0
- package/.nx/workspace-data/d/server-process.json +2 -2
- package/.nx/workspace-data/file-map.json +2747 -2747
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/project-graph.json +2 -2
- package/apps/playground/src/app/pages/button-page.ts +5 -3
- package/apps/playground/src/app/pages/feedback-page.ts +1 -1
- package/apps/playground/src/app/pages/home-page.ts +1 -1
- package/apps/playground/src/app/pages/icons-page.ts +3 -3
- package/apps/playground/src/app/pages/lecture-page.ts +3 -3
- package/apps/playground/src/app/pages/models-page.ts +1 -1
- package/apps/playground/src/app/pages/overlay-demos.ts +1 -1
- package/apps/playground/src/app/pages/tokens-page.ts +17 -3
- package/apps/playground/src/app/pages/usecases/onboarding-login.page.ts +1 -1
- package/apps/playground/src/app/pages/usecases/onboarding-reset-password.page.ts +1 -1
- package/apps/playground/src/app/pages/usecases/shipment-detail.page.ts +1 -1
- package/apps/playground/src/app/pages/viewport-preview.component.ts +1 -1
- package/apps/playground/src/app/snippets/button.snippets.ts +4 -3
- package/apps/playground/src/index.html +6 -0
- package/apps/playground/src/styles.css +4 -5
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +131 -8
- package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
- package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +8 -6
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +12 -2
- package/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -1
- package/dist/libs/africanies-theme/tailwind-preset.cjs +16 -7
- package/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +11 -3
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +83 -63
- package/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -1
- package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +11 -8
- package/libs/africanies-core/src/index.ts +1 -0
- package/libs/africanies-core/src/lib/notification/index.ts +1 -1
- package/libs/africanies-core/src/lib/notification/notification-link.spec.ts +40 -7
- package/libs/africanies-core/src/lib/notification/notification-link.ts +143 -7
- package/libs/africanies-theme/src/lib/mode-color.safelist.ts +8 -2
- package/libs/africanies-theme/src/lib/mode-color.service.ts +16 -0
- package/libs/africanies-theme/tailwind-preset.cjs +16 -7
- package/libs/africanies-ui/src/lib/button/button.component.ts +5 -1
- package/libs/africanies-ui/src/lib/feedback/empty-state.component.ts +1 -1
- package/libs/africanies-ui/src/lib/feedback/error-state.component.ts +1 -1
- package/libs/africanies-ui/src/lib/forms/file-upload/file-preview.dialog.ts +1 -1
- package/libs/africanies-ui/src/lib/forms/file-upload/file-upload.component.ts +4 -4
- package/libs/africanies-ui/src/lib/forms/form-field.classes.ts +2 -2
- package/libs/africanies-ui/src/lib/forms/select/select.component.ts +1 -1
- package/libs/africanies-ui/src/lib/layout/app-shell-header.component.ts +1 -1
- package/libs/africanies-ui/src/lib/layout/app-shell.component.ts +2 -2
- package/libs/africanies-ui/src/lib/navigation/shipping-mode-switch/shipping-mode-switch.component.ts +2 -2
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.html +2 -2
- package/libs/africanies-ui/src/lib/navigation/side-nav/africanies-side-nav.component.ts +10 -6
- package/libs/africanies-ui/src/lib/notifications/notification-drawer.panel.ts +21 -8
- package/libs/africanies-ui/src/lib/overlay/drawer.service.ts +1 -1
- package/libs/africanies-ui/src/lib/overlay/modal.service.ts +1 -1
- package/libs/africanies-ui/src/lib/pagination/pagination.component.ts +3 -3
- package/libs/africanies-ui/src/lib/table/table.component.ts +5 -5
- package/libs/africanies-ui/src/lib/toast/toast-host.component.ts +4 -4
- package/libs/africanies-ui/src/lib/toast/toast-item.component.ts +1 -1
- package/package.json +1 -1
- package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/package.json +0 -36
- package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -157
- package/.nx/cache/13524438527920092277/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
- package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/README.md +0 -46
- package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -215
- package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
- package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/tailwind-preset.cjs +0 -245
- package/.nx/cache/18132311043100376919/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/18132311043100376919/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +0 -5410
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/README.md +0 -69
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/assets/icons.sprite.svg +0 -1844
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +0 -832
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +0 -1
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/package.json +0 -31
- package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +0 -108
- package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/README.md +0 -31
- package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +0 -243
- package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +0 -1
- package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/package.json +0 -27
- package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/types/africanies-africanies-storage.d.ts +0 -210
- package/.nx/cache/4011892767661954819/dist/libs/africanies-core/README.md +0 -85
- package/.nx/cache/4011892767661954819/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4546
- package/.nx/cache/4011892767661954819/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
- package/.nx/cache/4011892767661954819/dist/libs/africanies-core/package.json +0 -32
- package/.nx/cache/4011892767661954819/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2740
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/README.md +0 -68
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -5
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -7
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +0 -19088
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
- package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/package.json +0 -36
- package/.nx/cache/6372470950255467653/dist/libs/africanies-models/README.md +0 -60
- package/.nx/cache/6372470950255467653/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +0 -599
- package/.nx/cache/6372470950255467653/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +0 -1
- package/.nx/cache/6372470950255467653/dist/libs/africanies-models/package.json +0 -24
- package/.nx/cache/6372470950255467653/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +0 -1452
- package/.nx/cache/terminalOutputs/11768036696192889608 +0 -8
- package/.nx/cache/terminalOutputs/1227201614544602906 +0 -23
- package/.nx/cache/terminalOutputs/12538607787148205787 +0 -19
- package/.nx/cache/terminalOutputs/13524438527920092277 +0 -196
- package/.nx/cache/terminalOutputs/14153928176747262656 +0 -45
- package/.nx/cache/terminalOutputs/17404566492103808557 +0 -8
- package/.nx/cache/terminalOutputs/18132311043100376919 +0 -315
- package/.nx/cache/terminalOutputs/2436781291243085315 +0 -8
- package/.nx/cache/terminalOutputs/2782605790118376385 +0 -21
- package/.nx/cache/terminalOutputs/3681975492957101833 +0 -8
- package/.nx/cache/terminalOutputs/5741611231803799383 +0 -21
- package/.nx/cache/terminalOutputs/6037166070823946880 +0 -8
- package/.nx/cache/terminalOutputs/6372470950255467653 +0 -21
- package/.nx/cache/terminalOutputs/665190206482526466 +0 -175
- package/.nx/cache/terminalOutputs/7756595539965457927 +0 -23
- package/.nx/cache/terminalOutputs/9200013119269230075 +0 -8
- /package/.nx/cache/{13524438527920092277 → 13466509747676776487}/dist/libs/africanies-core/README.md +0 -0
- /package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/README.md +0 -0
- /package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
- /package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
- /package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
- /package/.nx/cache/{18132311043100376919 → 14995846848874973576}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
- /package/.nx/cache/{1275815545780424169 → 6673686859704879504}/dist/libs/africanies-theme/README.md +0 -0
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Browser key-value persistence abstraction used by theme, shipping mode,
|
|
6
|
-
* and auth token flows.
|
|
7
|
-
*
|
|
8
|
-
* Implementations JSON-serialize values so callers work with typed objects
|
|
9
|
-
* rather than raw strings. Prefer injecting via {@link STORAGE_TOKEN} so
|
|
10
|
-
* tests can swap in an in-memory fake.
|
|
11
|
-
*/
|
|
12
|
-
declare abstract class StorageService {
|
|
13
|
-
/**
|
|
14
|
-
* Reads and deserializes a previously stored value.
|
|
15
|
-
*
|
|
16
|
-
* @typeParam T - Expected value type after JSON parse.
|
|
17
|
-
* @param key - Storage key.
|
|
18
|
-
* @returns The parsed value, or `null` when the key is missing or empty.
|
|
19
|
-
* @throws {DOMException} When storage is inaccessible (e.g. private browsing
|
|
20
|
-
* with storage disabled) or when reading fails for security reasons.
|
|
21
|
-
* @throws {SyntaxError} When stored content is not valid JSON.
|
|
22
|
-
*/
|
|
23
|
-
abstract get<T>(key: string): T | null;
|
|
24
|
-
/**
|
|
25
|
-
* Serializes and writes a value under `key`.
|
|
26
|
-
*
|
|
27
|
-
* @typeParam T - Value type to persist (must be JSON-serializable).
|
|
28
|
-
* @param key - Storage key.
|
|
29
|
-
* @param value - Value to serialize with `JSON.stringify`.
|
|
30
|
-
* @throws {DOMException} `QuotaExceededError` when the storage quota is
|
|
31
|
-
* exceeded, or when storage is disabled (private browsing).
|
|
32
|
-
* @throws {TypeError} When `value` cannot be serialized to JSON
|
|
33
|
-
* (e.g. circular structures).
|
|
34
|
-
*/
|
|
35
|
-
abstract set<T>(key: string, value: T): void;
|
|
36
|
-
/**
|
|
37
|
-
* Removes a single key if present.
|
|
38
|
-
*
|
|
39
|
-
* @param key - Storage key to delete.
|
|
40
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
41
|
-
*/
|
|
42
|
-
abstract remove(key: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* Removes all keys in this storage partition.
|
|
45
|
-
*
|
|
46
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
47
|
-
*/
|
|
48
|
-
abstract clear(): void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* `localStorage`-backed {@link StorageService}.
|
|
53
|
-
*
|
|
54
|
-
* Default root implementation behind {@link STORAGE_TOKEN}. Values survive
|
|
55
|
-
* browser restarts for the origin.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```ts
|
|
59
|
-
* const storage = inject(LocalStorageService);
|
|
60
|
-
* try {
|
|
61
|
-
* storage.set('user', { id: 1 });
|
|
62
|
-
* } catch (err) {
|
|
63
|
-
* // QuotaExceededError or private-browsing denial
|
|
64
|
-
* console.warn('persist failed', err);
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
declare class LocalStorageService extends StorageService {
|
|
69
|
-
/**
|
|
70
|
-
* @inheritdoc
|
|
71
|
-
* @throws {DOMException} Quota exceeded or storage disabled in private browsing.
|
|
72
|
-
* @throws {SyntaxError} Stored value is not valid JSON.
|
|
73
|
-
*/
|
|
74
|
-
get<T>(key: string): T | null;
|
|
75
|
-
/**
|
|
76
|
-
* @inheritdoc
|
|
77
|
-
* @throws {DOMException} Quota exceeded or storage disabled in private browsing.
|
|
78
|
-
* @throws {TypeError} Value is not JSON-serializable.
|
|
79
|
-
*/
|
|
80
|
-
set<T>(key: string, value: T): void;
|
|
81
|
-
/**
|
|
82
|
-
* @inheritdoc
|
|
83
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
84
|
-
*/
|
|
85
|
-
remove(key: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* @inheritdoc
|
|
88
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
89
|
-
*/
|
|
90
|
-
clear(): void;
|
|
91
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
|
|
92
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageService>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Explicitly binds {@link STORAGE_TOKEN} to {@link LocalStorageService}.
|
|
97
|
-
*
|
|
98
|
-
* Redundant with the token's root factory, but useful when an app previously
|
|
99
|
-
* registered session storage and needs to switch back, or for clarity in
|
|
100
|
-
* `app.config.ts`.
|
|
101
|
-
*
|
|
102
|
-
* @returns Environment providers wiring `STORAGE_TOKEN` → localStorage.
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```ts
|
|
106
|
-
* bootstrapApplication(App, {
|
|
107
|
-
* providers: [provideLocalStorage()],
|
|
108
|
-
* });
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
declare function provideLocalStorage(): EnvironmentProviders;
|
|
112
|
-
/**
|
|
113
|
-
* Binds {@link STORAGE_TOKEN} to {@link SessionStorageService}.
|
|
114
|
-
*
|
|
115
|
-
* Prefer this when SDK consumers (theme, auth token) should persist only
|
|
116
|
-
* for the current tab rather than across sessions.
|
|
117
|
-
*
|
|
118
|
-
* Shipping mode always uses {@link SessionStorageService} directly and is
|
|
119
|
-
* unaffected by this override.
|
|
120
|
-
*
|
|
121
|
-
* @returns Environment providers wiring `STORAGE_TOKEN` → sessionStorage.
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* ```ts
|
|
125
|
-
* bootstrapApplication(App, {
|
|
126
|
-
* providers: [provideSessionStorage()],
|
|
127
|
-
* });
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
declare function provideSessionStorage(): EnvironmentProviders;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* `sessionStorage`-backed {@link StorageService}.
|
|
134
|
-
*
|
|
135
|
-
* Scope is limited to the current tab/window lifetime — use when values must
|
|
136
|
-
* not outlive the session (e.g. ephemeral UI flags). Register via
|
|
137
|
-
* {@link provideSessionStorage} to bind {@link STORAGE_TOKEN} to this class.
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```ts
|
|
141
|
-
* // app.config.ts
|
|
142
|
-
* providers: [provideSessionStorage()]
|
|
143
|
-
*
|
|
144
|
-
* // elsewhere
|
|
145
|
-
* const storage = inject(STORAGE_TOKEN);
|
|
146
|
-
* try {
|
|
147
|
-
* storage.set('wizard.step', 2);
|
|
148
|
-
* } catch (err) {
|
|
149
|
-
* // QuotaExceededError or private-browsing denial
|
|
150
|
-
* }
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
declare class SessionStorageService extends StorageService {
|
|
154
|
-
/**
|
|
155
|
-
* @inheritdoc
|
|
156
|
-
* @throws {DOMException} Quota exceeded or storage disabled in private browsing.
|
|
157
|
-
* @throws {SyntaxError} Stored value is not valid JSON.
|
|
158
|
-
*/
|
|
159
|
-
get<T>(key: string): T | null;
|
|
160
|
-
/**
|
|
161
|
-
* @inheritdoc
|
|
162
|
-
* @throws {DOMException} Quota exceeded or storage disabled in private browsing.
|
|
163
|
-
* @throws {TypeError} Value is not JSON-serializable.
|
|
164
|
-
*/
|
|
165
|
-
set<T>(key: string, value: T): void;
|
|
166
|
-
/**
|
|
167
|
-
* @inheritdoc
|
|
168
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
169
|
-
*/
|
|
170
|
-
remove(key: string): void;
|
|
171
|
-
/**
|
|
172
|
-
* @inheritdoc
|
|
173
|
-
* @throws {DOMException} When storage is inaccessible.
|
|
174
|
-
*/
|
|
175
|
-
clear(): void;
|
|
176
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SessionStorageService, never>;
|
|
177
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SessionStorageService>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Well-known local/session storage keys used across AFRICANIES SDK packages.
|
|
182
|
-
*
|
|
183
|
-
* Centralizing these avoids typos between theme, shipping-mode, and
|
|
184
|
-
* auth persistence layers that all go through {@link StorageService}.
|
|
185
|
-
*/
|
|
186
|
-
/** Persisted UI theme preference (`'light' | 'dark'` or equivalent). */
|
|
187
|
-
declare const AFRICANIES_THEME_KEY = "africanies.theme";
|
|
188
|
-
/** Tab-scoped shipping mode (`'stn' | 'sfn'`) — {@link SessionStorageService}. */
|
|
189
|
-
declare const AFRICANIES_SHIPPING_MODE_KEY = "africanies.shippingMode";
|
|
190
|
-
/** Cached public mode-config payload (mapped {@link ModeConfigDataModel}). */
|
|
191
|
-
declare const AFRICANIES_MODE_CONFIG_KEY = "africanies.modeConfig";
|
|
192
|
-
/** Persisted bearer access token for authenticated SDK HTTP calls. */
|
|
193
|
-
declare const AFRICANIES_ACCESS_TOKEN_KEY = "africanies.accessToken";
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* DI token for the active {@link StorageService} implementation.
|
|
197
|
-
*
|
|
198
|
-
* Defaults to {@link LocalStorageService} via `providedIn: 'root'`. Override
|
|
199
|
-
* in tests or at bootstrap with {@link provideSessionStorage} /
|
|
200
|
-
* {@link provideLocalStorage}.
|
|
201
|
-
*
|
|
202
|
-
* @example
|
|
203
|
-
* ```ts
|
|
204
|
-
* const storage = inject(STORAGE_TOKEN);
|
|
205
|
-
* storage.set('prefs', { dense: true });
|
|
206
|
-
* ```
|
|
207
|
-
*/
|
|
208
|
-
declare const STORAGE_TOKEN: InjectionToken<StorageService>;
|
|
209
|
-
|
|
210
|
-
export { AFRICANIES_ACCESS_TOKEN_KEY, AFRICANIES_MODE_CONFIG_KEY, AFRICANIES_SHIPPING_MODE_KEY, AFRICANIES_THEME_KEY, LocalStorageService, STORAGE_TOKEN, SessionStorageService, StorageService, provideLocalStorage, provideSessionStorage };
|
|
@@ -1,85 +0,0 @@
|
|
|
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 from GitHub Packages (@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
|
-
```
|