@africanies/angular-web-sdk 0.1.4 → 0.1.6

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 (101) hide show
  1. package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +456 -169
  2. package/.nx/cache/14876618240301288353/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +1 -0
  3. package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/package.json +5 -5
  4. package/.nx/cache/{5741611231803799383 → 14876618240301288353}/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +100 -20
  5. package/.nx/cache/{1275815545780424169 → 17626862048742598274}/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +6 -0
  6. package/.nx/cache/17626862048742598274/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +1 -0
  7. package/.nx/cache/{14153928176747262656 → 17626862048742598274}/dist/libs/africanies-theme/package.json +3 -3
  8. package/.nx/cache/{1275815545780424169 → 17626862048742598274}/dist/libs/africanies-theme/tailwind-preset.cjs +15 -7
  9. package/.nx/cache/{14153928176747262656 → 17626862048742598274}/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +10 -1
  10. package/.nx/cache/{13524438527920092277 → 9040451482998546630}/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +9 -44
  11. package/.nx/cache/9040451482998546630/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -0
  12. package/.nx/cache/{13524438527920092277 → 9040451482998546630}/dist/libs/africanies-core/package.json +3 -3
  13. package/.nx/cache/{13524438527920092277 → 9040451482998546630}/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +6 -5
  14. package/.nx/cache/run.json +19 -19
  15. package/.nx/cache/terminalOutputs/13555699813138069787 +6 -0
  16. package/.nx/cache/terminalOutputs/{12148417737220755248 → 14061940909886036014} +172 -174
  17. package/.nx/cache/terminalOutputs/{3064561615116090625 → 14876618240301288353} +7 -7
  18. package/.nx/cache/terminalOutputs/{1275815545780424169 → 17626862048742598274} +2 -2
  19. package/.nx/cache/terminalOutputs/7978448102466861029 +32 -0
  20. package/.nx/cache/terminalOutputs/{4011892767661954819 → 9040451482998546630} +1 -1
  21. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db +0 -0
  22. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-shm +0 -0
  23. package/.nx/workspace-data/0091ABA9-5C90-580D-953C-8C94E763ADB5-v3.db-wal +0 -0
  24. package/.nx/workspace-data/d/daemon.log +2370 -0
  25. package/.nx/workspace-data/d/server-process.json +2 -2
  26. package/.nx/workspace-data/file-map.json +3177 -3177
  27. package/.nx/workspace-data/nx_files.nxt +0 -0
  28. package/.nx/workspace-data/project-graph.json +2 -2
  29. package/apps/playground/src/app/app.routes.ts +15 -4
  30. package/apps/playground/src/app/app.ts +2 -2
  31. package/apps/playground/src/app/pages/home-page.ts +14 -14
  32. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +8 -43
  33. package/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +1 -1
  34. package/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +6 -5
  35. package/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +11 -11
  36. package/libs/africanies-core/src/lib/http/api-client.ts +4 -18
  37. package/libs/africanies-core/src/lib/http/is-retryable-get-error.ts +8 -4
  38. package/libs/africanies-core/src/lib/query/provide-africanies-query-defaults.ts +5 -6
  39. package/package.json +1 -1
  40. package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  41. package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/package.json +0 -36
  42. package/.nx/cache/1275815545780424169/dist/libs/africanies-theme/types/africanies-africanies-theme.d.ts +0 -157
  43. package/.nx/cache/13524438527920092277/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  44. package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/README.md +0 -46
  45. package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs +0 -215
  46. package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/fesm2022/africanies-africanies-theme.mjs.map +0 -1
  47. package/.nx/cache/14153928176747262656/dist/libs/africanies-theme/tailwind-preset.cjs +0 -245
  48. package/.nx/cache/18132311043100376919/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  49. package/.nx/cache/18132311043100376919/dist/libs/africanies-ui/types/africanies-africanies-ui.d.ts +0 -5410
  50. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/README.md +0 -69
  51. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/assets/icons.sprite.svg +0 -1844
  52. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs +0 -832
  53. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/fesm2022/africanies-africanies-icons.mjs.map +0 -1
  54. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/package.json +0 -31
  55. package/.nx/cache/2782605790118376385/dist/libs/africanies-icons/types/africanies-africanies-icons.d.ts +0 -108
  56. package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/README.md +0 -31
  57. package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs +0 -243
  58. package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/fesm2022/africanies-africanies-storage.mjs.map +0 -1
  59. package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/package.json +0 -27
  60. package/.nx/cache/3064561615116090625/dist/libs/africanies-storage/types/africanies-africanies-storage.d.ts +0 -210
  61. package/.nx/cache/4011892767661954819/dist/libs/africanies-core/README.md +0 -85
  62. package/.nx/cache/4011892767661954819/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs +0 -4546
  63. package/.nx/cache/4011892767661954819/dist/libs/africanies-core/fesm2022/africanies-africanies-core.mjs.map +0 -1
  64. package/.nx/cache/4011892767661954819/dist/libs/africanies-core/package.json +0 -32
  65. package/.nx/cache/4011892767661954819/dist/libs/africanies-core/types/africanies-africanies-core.d.ts +0 -2740
  66. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/README.md +0 -68
  67. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  68. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  69. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -5
  70. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -7
  71. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs +0 -19088
  72. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/fesm2022/africanies-africanies-ui.mjs.map +0 -1
  73. package/.nx/cache/5741611231803799383/dist/libs/africanies-ui/package.json +0 -36
  74. package/.nx/cache/6372470950255467653/dist/libs/africanies-models/README.md +0 -60
  75. package/.nx/cache/6372470950255467653/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs +0 -599
  76. package/.nx/cache/6372470950255467653/dist/libs/africanies-models/fesm2022/africanies-africanies-models.mjs.map +0 -1
  77. package/.nx/cache/6372470950255467653/dist/libs/africanies-models/package.json +0 -24
  78. package/.nx/cache/6372470950255467653/dist/libs/africanies-models/types/africanies-africanies-models.d.ts +0 -1452
  79. package/.nx/cache/terminalOutputs/11768036696192889608 +0 -8
  80. package/.nx/cache/terminalOutputs/1227201614544602906 +0 -23
  81. package/.nx/cache/terminalOutputs/12538607787148205787 +0 -19
  82. package/.nx/cache/terminalOutputs/13524438527920092277 +0 -196
  83. package/.nx/cache/terminalOutputs/14153928176747262656 +0 -45
  84. package/.nx/cache/terminalOutputs/17404566492103808557 +0 -8
  85. package/.nx/cache/terminalOutputs/18132311043100376919 +0 -315
  86. package/.nx/cache/terminalOutputs/2436781291243085315 +0 -8
  87. package/.nx/cache/terminalOutputs/2782605790118376385 +0 -21
  88. package/.nx/cache/terminalOutputs/3681975492957101833 +0 -8
  89. package/.nx/cache/terminalOutputs/5741611231803799383 +0 -21
  90. package/.nx/cache/terminalOutputs/6037166070823946880 +0 -8
  91. package/.nx/cache/terminalOutputs/6372470950255467653 +0 -21
  92. package/.nx/cache/terminalOutputs/665190206482526466 +0 -175
  93. package/.nx/cache/terminalOutputs/7756595539965457927 +0 -23
  94. package/.nx/cache/terminalOutputs/9200013119269230075 +0 -8
  95. /package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/README.md +0 -0
  96. /package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/assets/brand/africanies-logo-mini.png +0 -0
  97. /package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/assets/brand/africanies-logo.png +0 -0
  98. /package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/assets/brand/africanies-logo.svg +0 -0
  99. /package/.nx/cache/{18132311043100376919 → 14876618240301288353}/dist/libs/africanies-ui/assets/carriers/dhl.svg +0 -0
  100. /package/.nx/cache/{1275815545780424169 → 17626862048742598274}/dist/libs/africanies-theme/README.md +0 -0
  101. /package/.nx/cache/{13524438527920092277 → 9040451482998546630}/dist/libs/africanies-core/README.md +0 -0
@@ -1,1452 +0,0 @@
1
- /**
2
- * Deep JSON value with no `undefined` — every key/slot is present as
3
- * {@link ApiJsonValue} (use `null` for missing nested values).
4
- *
5
- * Used for opaque API blobs (partner, accounts, …) until dedicated *Model
6
- * types exist. Prefer typed models when the wire schema is stable.
7
- */
8
- /** JSON primitive including explicit `null`. */
9
- type ApiJsonPrimitive = string | number | boolean | null;
10
- /**
11
- * Plain object whose values are recursively {@link ApiJsonValue}
12
- * (never `undefined`).
13
- */
14
- interface ApiJsonObjectModel {
15
- readonly [key: string]: ApiJsonValue;
16
- }
17
- /**
18
- * Null-safe JSON tree for untyped API subtrees.
19
- */
20
- type ApiJsonValue = ApiJsonPrimitive | readonly ApiJsonValue[] | ApiJsonObjectModel;
21
-
22
- /**
23
- * Field-level validation or business-rule error returned inside an API envelope.
24
- *
25
- * Laravel-style bags (`{ name: ["…"], value: ["…"] }` in `errors` or failure
26
- * `data`) are normalized by the SDK into this array. Prefer `errors` for forms
27
- * (`fieldErrorsMap`) and joined `message` / `formatApiErrorMessage` for toasts —
28
- * the wire top-level `message` alone is often only the first field.
29
- */
30
- interface ApiErrorDetailModel {
31
- field: string | null;
32
- message: string;
33
- code: string | null;
34
- }
35
- /**
36
- * Pagination metadata accompanying list responses.
37
- *
38
- * Field names match the wire (snake_case).
39
- */
40
- interface PaginationMetaModel {
41
- current_page: number;
42
- per_page: number;
43
- total_items: number;
44
- total_pages: number;
45
- has_next_page: boolean;
46
- has_previous_page: boolean;
47
- }
48
- /**
49
- * Canonical API response envelope normalized by the SDK HTTP client.
50
- *
51
- * Every field is explicitly `| null` (never optional/undefined) so consumers
52
- * can rely on null-checks regardless of which subset the backend included.
53
- * Field names match the wire where the backend embeds them (`status_code`).
54
- *
55
- * @typeParam T - Shape of the successful payload in `data`.
56
- */
57
- interface ApiResponseModel<T> {
58
- success: boolean;
59
- message: string | null;
60
- data: T | null;
61
- errors: ApiErrorDetailModel[] | null;
62
- pagination: PaginationMetaModel | null;
63
- /** Application-level status when the body includes `status_code`. */
64
- status_code: number | null;
65
- }
66
-
67
- /**
68
- * Allowed page sizes for list pagination (`size` query param).
69
- */
70
- declare const PAGINATION_PAGE_SIZES: readonly [5, 15, 30];
71
- /** One of {@link PAGINATION_PAGE_SIZES}. */
72
- type PaginationPageSize = (typeof PAGINATION_PAGE_SIZES)[number];
73
- /** Default `size` on paginated resource GETs. */
74
- declare const DEFAULT_PAGE_SIZE: PaginationPageSize;
75
- /** Inbox / notification list page size. */
76
- declare const NOTIFICATION_PAGE_SIZE: PaginationPageSize;
77
-
78
- /**
79
- * Resource identifier convention for AFRICANIES list/detail GET endpoints
80
- * on paths shaped like `/{basePath}/{id?}`.
81
- *
82
- * Applies to **all** list-style GETs (built-in SDK services and custom
83
- * `ApiClient.getResource*` / `buildResourcePath` calls):
84
- *
85
- * | Value | Meaning | Path | Pagination |
86
- * |-------|---------|------|------------|
87
- * | `null` | Paginated page (SDK default {@link DEFAULT_PAGE_SIZE} `15` unless overridden) | `{basePath}` | `page` / `size` / `order` apply |
88
- * | `'all'` | Full dump, not paginated | `{basePath}/all` | ignored |
89
- * | `number` | Single matching record | `{basePath}/{id}` | ignored |
90
- *
91
- * Prefer typed helpers when calling custom endpoints:
92
- * `getResourcePage`, `getResourceAll`, `getResourceById`, or overloads on
93
- * `getResource(basePath, id, query?)`.
94
- *
95
- * @example
96
- * ```ts
97
- * const pageId: ResourceId = null; // GET /widgets?page=1
98
- * const allId: ResourceId = 'all'; // GET /widgets/all
99
- * const oneId: ResourceId = 42; // GET /widgets/42
100
- * ```
101
- */
102
- type ResourceId = number | 'all' | null;
103
- /**
104
- * Optional query parameters for paginated resource list requests.
105
- *
106
- * Fields are optional (not `| null`) because omitted query params mean
107
- * "use the backend default" — distinct from sending an explicit null body field.
108
- */
109
- interface PaginationQueryParamsModel {
110
- /**
111
- * 1-based page index to request.
112
- * Omitted when the caller accepts the backend's default page.
113
- */
114
- page?: number;
115
- /**
116
- * Page size override. SDK paginated calls default to
117
- * {@link DEFAULT_PAGE_SIZE} (`15`) when omitted. Allowed UI sizes:
118
- * {@link PAGINATION_PAGE_SIZES} (`5`, `15`, `30`).
119
- */
120
- size?: number;
121
- /**
122
- * Sort / order expression understood by the target endpoint.
123
- * Omitted when default ordering is acceptable.
124
- */
125
- order?: string;
126
- }
127
-
128
- /**
129
- * UI-facing async query snapshot for wrappers such as AsyncStateComponent.
130
- *
131
- * Mirrors the signals typically exposed by TanStack Query's `injectQuery()`
132
- * so apps can map query results into one object without coupling the UI
133
- * package to TanStack itself.
134
- *
135
- * @typeParam T - Successful data shape when a fetch has produced a value.
136
- *
137
- * @example
138
- * ```ts
139
- * // Map injectQuery() signals into AsyncQueryStateModel for <africanies-async-state>
140
- * const state: AsyncQueryStateModel<Widget[]> = {
141
- * data: query.data(),
142
- * isLoading: query.isLoading(),
143
- * isFetching: query.isFetching(),
144
- * isError: query.isError(),
145
- * error: query.error()?.message ?? null,
146
- * };
147
- * ```
148
- */
149
- interface AsyncQueryStateModel<T> {
150
- /**
151
- * Latest successful data, if any.
152
- * `undefined` before the first successful fetch (and often while `isLoading`).
153
- * Uses `undefined` (not `null`) to align with TanStack Query's empty-data sentinel.
154
- */
155
- data: T | undefined;
156
- /**
157
- * `true` only on the initial fetch before any data exists.
158
- * Distinguishes blocking first-load from background refetch (`isFetching`).
159
- */
160
- isLoading: boolean;
161
- /**
162
- * `true` whenever any fetch is in flight, including background refetches.
163
- * May be true while `data` is still present from a prior success.
164
- */
165
- isFetching: boolean;
166
- /**
167
- * `true` if the most recent fetch attempt failed.
168
- * Can be true with stale `data` still available after a background error.
169
- */
170
- isError: boolean;
171
- /**
172
- * Human-readable error message for the latest failure.
173
- * `null` when `isError` is false or no message is available.
174
- */
175
- error: string | null;
176
- }
177
-
178
- /**
179
- * Auth request shapes (`POST /auth/…`).
180
- *
181
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
182
- * Field names match the wire (snake_case).
183
- */
184
- /**
185
- * Request body for `POST /auth/forgot/password`.
186
- *
187
- * Email-only: the backend emails a reset link. This frontend does **not**
188
- * collect a new password for that link (no token in the route).
189
- *
190
- * Response `data` is typically an empty array — branch on `success` /
191
- * `message`. The same body is used from login *and* from admin user/partner
192
- * screens that send a reset for someone else's email.
193
- */
194
- interface ForgotPasswordRequestModel {
195
- /** Registered account email that should receive the reset link. */
196
- email: string;
197
- }
198
-
199
- /**
200
- * Country and subdivision shapes from public utility endpoints.
201
- *
202
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
203
- * Field names match the wire (snake_case). Mapping in `@africanies/africanies-core`
204
- * preserves those keys.
205
- */
206
- /**
207
- * State / province / region under a {@link CountryModel}.
208
- */
209
- interface CountryStateModel {
210
- /** Display name (e.g. `"Lagos"`, `"California"`). */
211
- name: string;
212
- /** Subdivision code (e.g. `"LA"`, `"CA"`). */
213
- state_code: string;
214
- }
215
- /**
216
- * Country record from `GET /public/country/read/{id|all}`.
217
- */
218
- interface CountryModel {
219
- /** Numeric country id from the API. */
220
- id: number;
221
- /** Official / display country name. */
222
- name: string;
223
- /** ISO 3166-1 alpha-3 code (e.g. `"NGA"`). */
224
- iso3: string;
225
- /** ISO 3166-1 alpha-2 code (e.g. `"NG"`). */
226
- iso2: string;
227
- /** Nested subdivisions; may be an empty array. */
228
- states: CountryStateModel[];
229
- }
230
-
231
- /**
232
- * Currency shapes from utility read endpoints.
233
- *
234
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
235
- * Field names match the wire (snake_case). Mapping in `@africanies/africanies-core`
236
- * preserves those keys.
237
- */
238
- /**
239
- * Pivot linking a currency to a payment method (either nested direction).
240
- */
241
- interface CurrencyPaymentMethodPivotModel {
242
- /** Currency id on the join. */
243
- currency_id: number;
244
- /** Payment method id on the join. */
245
- payment_method_id: number;
246
- }
247
- /**
248
- * Payment processor attached to a {@link CurrencyModel}.
249
- */
250
- interface CurrencyPaymentMethodModel {
251
- /** Numeric payment-method id. */
252
- id: number;
253
- /** Display name (e.g. `"Paystack"`, `"Stripe"`). */
254
- name: string;
255
- /** Backend model class path (e.g. `"App\\Models\\Stripe"`). */
256
- model: string;
257
- /** Whether the method is available. */
258
- active: boolean;
259
- deleted_at: string | null;
260
- created_at: string | null;
261
- updated_at: string | null;
262
- /** Join keys for this currency. */
263
- pivot: CurrencyPaymentMethodPivotModel;
264
- }
265
- /**
266
- * Currency record from `GET /currency/read/{id|all}`.
267
- *
268
- * `division_rate` / `multiplication_rate` stay strings as on the wire
269
- * (e.g. `"1"`, `"1400"`).
270
- */
271
- interface CurrencyModel {
272
- /** Numeric currency id from the API. */
273
- id: number;
274
- /** Display name (e.g. `"Naira"`, `"US Dollars"`). */
275
- name: string;
276
- /** ISO-style code (e.g. `"NGN"`, `"USD"`). */
277
- short_code: string;
278
- /** Wire rate string used when converting from this currency. */
279
- division_rate: string;
280
- /** Wire rate string used when converting to this currency. */
281
- multiplication_rate: string;
282
- /** Whether the local currency is greater than this unit (GET alias). */
283
- is_local_currency_greater: boolean;
284
- /**
285
- * Same flag as {@link CurrencyModel.is_local_currency_greater}.
286
- * App Settings create/update send this key (`"1"` / `"0"` on the wire).
287
- */
288
- is_naira_greater: boolean;
289
- /** Whether the currency is available for checkout. */
290
- active: boolean;
291
- deleted_at: string | null;
292
- created_at: string | null;
293
- updated_at: string | null;
294
- /** Processors that accept this currency. */
295
- payment_methods: CurrencyPaymentMethodModel[];
296
- }
297
- /** `"1"` / `"0"` flag as sent on currency create/update. */
298
- type CurrencyFlag01 = '0' | '1';
299
- /**
300
- * Request body for `POST /currency/create` (App Settings → Currencies).
301
- *
302
- * `name` / `short_code` come from the host’s local currency list, not GET.
303
- * The SDK serializes `active` / `is_naira_greater` to `"1"` / `"0"`.
304
- */
305
- interface CurrencyCreateRequestModel {
306
- name: string;
307
- short_code: string;
308
- multiplication_rate: string;
309
- division_rate: string;
310
- /** Boolean or wire `"1"` / `"0"`. */
311
- active: boolean | CurrencyFlag01;
312
- /** Boolean or wire `"1"` / `"0"`. */
313
- is_naira_greater: boolean | CurrencyFlag01;
314
- payment_method_ids: number[];
315
- }
316
- /**
317
- * Request body for `PUT /currency/update`. Name and short code are not sent.
318
- */
319
- interface CurrencyUpdateRequestModel {
320
- id: number;
321
- multiplication_rate: string;
322
- division_rate: string;
323
- active: boolean | CurrencyFlag01;
324
- is_naira_greater: boolean | CurrencyFlag01;
325
- payment_method_ids: number[];
326
- }
327
- /**
328
- * Identifier for `DELETE /currency/delete` (JSON body `{ id }`).
329
- */
330
- interface CurrencyDeleteRequestModel {
331
- id: number;
332
- }
333
-
334
- /**
335
- * Hardcoded inbound delivery vendor slugs — same values as legacy portal forms (no API).
336
- */
337
- declare const DELIVERY_VENDORS: readonly [{
338
- readonly id: "amazon";
339
- readonly name: "Amazon";
340
- }, {
341
- readonly id: "dhl";
342
- readonly name: "DHL";
343
- }, {
344
- readonly id: "fedex";
345
- readonly name: "FedEx";
346
- }, {
347
- readonly id: "usps";
348
- readonly name: "USPS";
349
- }, {
350
- readonly id: "ups";
351
- readonly name: "UPS";
352
- }, {
353
- readonly id: "others";
354
- readonly name: "Others";
355
- }];
356
- /**
357
- *
358
- */
359
- type DeliveryVendorId = (typeof DELIVERY_VENDORS)[number]['id'];
360
- /** Export box editor only — not used on inbound receive/edit forms. */
361
- declare const EXPORT_DELIVERY_VENDORS: readonly [{
362
- readonly id: "amazon";
363
- readonly name: "Amazon";
364
- }, {
365
- readonly id: "dhl";
366
- readonly name: "DHL";
367
- }, {
368
- readonly id: "fedex";
369
- readonly name: "FedEx";
370
- }, {
371
- readonly id: "usps";
372
- readonly name: "USPS";
373
- }, {
374
- readonly id: "ups";
375
- readonly name: "UPS";
376
- }, {
377
- readonly id: "others";
378
- readonly name: "Others";
379
- }, {
380
- readonly id: "walk-in";
381
- readonly name: "Walk-In";
382
- }];
383
- /**
384
- *
385
- */
386
- type ExportDeliveryVendorId = (typeof EXPORT_DELIVERY_VENDORS)[number]['id'];
387
- /** @deprecated Prefer {@link DELIVERY_VENDORS}. */
388
- declare const DELIVERY_VENDOR_OPTIONS: {
389
- value: "amazon" | "dhl" | "fedex" | "usps" | "ups" | "others";
390
- label: "Amazon" | "DHL" | "FedEx" | "USPS" | "UPS" | "Others";
391
- }[];
392
- /** @deprecated Prefer {@link EXPORT_DELIVERY_VENDORS}. */
393
- declare const BOX_DELIVERY_VENDORS: readonly [{
394
- readonly id: "amazon";
395
- readonly name: "Amazon";
396
- }, {
397
- readonly id: "dhl";
398
- readonly name: "DHL";
399
- }, {
400
- readonly id: "fedex";
401
- readonly name: "FedEx";
402
- }, {
403
- readonly id: "usps";
404
- readonly name: "USPS";
405
- }, {
406
- readonly id: "ups";
407
- readonly name: "UPS";
408
- }, {
409
- readonly id: "others";
410
- readonly name: "Others";
411
- }, {
412
- readonly id: "walk-in";
413
- readonly name: "Walk-In";
414
- }];
415
- /** @deprecated Prefer {@link ExportDeliveryVendorId}. */
416
- type BoxDeliveryVendorId = ExportDeliveryVendorId;
417
- /**
418
- *
419
- * @param value
420
- */
421
- declare function normalizeDeliveryVendor(value: string): string;
422
- /**
423
- *
424
- * @param value
425
- */
426
- declare function isKnownDeliveryVendor(value: string | null | undefined): boolean;
427
- /**
428
- * Lowercase known ids; keep raw string for legacy/custom stored values.
429
- * @param value
430
- */
431
- declare function normalizeDeliveryVendorForForm(value: string | null | undefined): string;
432
- /**
433
- *
434
- * @param value
435
- */
436
- declare function deliveryVendorLabel(value: string): string;
437
-
438
- /**
439
- * File read shapes from `POST /file/read`.
440
- *
441
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
442
- * Field names match the wire (snake_case).
443
- */
444
- /**
445
- * Request body for {@link FileReadModel} fetches.
446
- */
447
- interface FileReadRequestModel {
448
- /** Storage / document reference UUID. */
449
- ref: string;
450
- }
451
- /**
452
- * One file payload from `POST /file/read`.
453
- *
454
- * Response `data` is this object (not a list). Prefer {@link FileReadModel.url}
455
- * for downloads when the signed URL is present; `base_64` is typically a data
456
- * URI (`data:{mime};base64,…`).
457
- */
458
- interface FileReadModel {
459
- /** MIME type (e.g. `"application/pdf"`). */
460
- mime_type: string;
461
- /**
462
- * Inline file bytes as a data URI or raw base64 string.
463
- * Can be large — avoid logging or binding the full value in UI lists.
464
- */
465
- base_64: string;
466
- /** Time-limited signed URL for the object (when provided). */
467
- url: string;
468
- }
469
-
470
- /**
471
- * Document catalog shapes from public utility reads.
472
- *
473
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
474
- * Field names match the wire (snake_case).
475
- */
476
-
477
- /**
478
- * Document record from `GET /public/document/read/{id|all}`.
479
- *
480
- * List rows are usually metadata only. `readById(id)` for App Settings /
481
- * Products / Plans preview populates {@link DocumentModel.file_ref} with
482
- * `mime_type` and `base_64` (bind `file_ref.base_64` in an `<img>` or PDF viewer).
483
- *
484
- * For entities that store a raw `file_ref` string (shipments, KYC, waybills),
485
- * use {@link FileReadRequestModel} + `POST /file/read` instead.
486
- * Authenticated upload/delete use `api/document/*`.
487
- */
488
- interface DocumentModel {
489
- id: number;
490
- name: string;
491
- description: string | null;
492
- /** Document type / category label when present on the wire. */
493
- type: string | null;
494
- active: boolean;
495
- deleted_at: string | null;
496
- created_at: string | null;
497
- updated_at: string | null;
498
- /**
499
- * Nested preview payload on `readById` responses (`file_ref.base_64`).
500
- * Null on list rows and when the wire omits preview bytes.
501
- */
502
- file_ref: FileReadModel | null;
503
- }
504
-
505
- /**
506
- * Schema-driven list filter contracts for AFRICANIES modules.
507
- *
508
- * Modules declare a {@link ModuleFilterConfigModel}; the UI drawer renders from
509
- * it and {@link toFilterParams} / {@link fromFilterParams} speak to the API.
510
- */
511
- /**
512
- * Backend wire format for filter query serialization.
513
- *
514
- * Use {@link resolveFilterTransport} when reading `config.transport` — omit the
515
- * property on {@link ModuleFilterConfigModel} to default to legacy-parallel.
516
- */
517
- declare const FilterTransport: {
518
- /** Laravel-style `filterColumn` + `filterValue` CSV pairs (default). */
519
- readonly LegacyParallel: "legacy-parallel";
520
- /** Each {@link FilterFieldModel.key} is its own query param. */
521
- readonly Named: "named";
522
- };
523
- /** Union of {@link FilterTransport} literal values. */
524
- type FilterTransport = (typeof FilterTransport)[keyof typeof FilterTransport];
525
- /** Default when {@link ModuleFilterConfigModel.transport} is omitted. */
526
- declare const DEFAULT_FILTER_TRANSPORT: "legacy-parallel";
527
- /** How a filter field is rendered and validated in the drawer. */
528
- type FilterFieldType =
529
- /** Chip / single-select group — exclusive within the field by default. */
530
- 'enum'
531
- /** Free-text scalar (tracking number, etc.). */
532
- | 'text'
533
- /** Static or host-resolved option list (warehouse, carrier, …). */
534
- | 'select'
535
- /** Yes/no mapped to API scalars (often `'1'` / `'0'`). */
536
- | 'boolean';
537
- /**
538
- * Option row for enum / select / boolean fields.
539
- *
540
- * `color` is a UI hint only (chip styling) — never sent to the API.
541
- */
542
- interface FilterOptionModel {
543
- /** Canonical value written into filter state / query params. */
544
- value: string;
545
- /** Visible label. */
546
- label: string;
547
- /** Optional leading text/emoji (e.g. country flag emoji) in select rows. */
548
- prefixText?: string;
549
- /** Optional leading image URL (e.g. flag CDN from {@link countryFlagUrl}). */
550
- prefixImageUrl?: string;
551
- /** Optional chip / badge color (hex or CSS). */
552
- color?: string;
553
- }
554
- /**
555
- * Well-known async option catalogs resolved by the SDK or host app.
556
- *
557
- * Built-in wiring ({@link FilterOptionsResolver} in `@africanies/africanies-core`):
558
- * - `warehouses` → {@link WarehouseService.readAll} → field keys like `warehouse_id`
559
- * - `shipmentMethods` → {@link ShipmentMethodService.readAll} → e.g. `shipment_method_id`
560
- *
561
- * Pass host `optionLists` for sources without a built-in service (e.g. `shipmentManifests`).
562
- */
563
- type FilterOptionsSource = 'shipmentMethods' | 'warehouses' | 'shipmentManifests' | 'static';
564
- /**
565
- * One filterable API field inside a {@link ModuleFilterConfigModel}.
566
- */
567
- interface FilterFieldModel {
568
- /** API `filterColumn` name (e.g. `payment_status`). */
569
- key: string;
570
- /** Drawer section label. */
571
- label: string;
572
- /** Control kind. */
573
- type: FilterFieldType;
574
- /** Static options (enum / boolean / static select). */
575
- options?: FilterOptionModel[];
576
- /**
577
- * When true (default for `enum`), selecting a value replaces any prior value
578
- * for this key — chip groups are mutually exclusive per field.
579
- */
580
- exclusive?: boolean;
581
- /** Host-resolved option catalog name for `select` fields. */
582
- optionsSource?: FilterOptionsSource;
583
- /** Placeholder for text / select triggers. */
584
- placeholder?: string;
585
- }
586
- /**
587
- * Module-level filter schema — the only per-module difference for list filters.
588
- *
589
- * @example
590
- * ```ts
591
- * const trackShipmentsFilterConfig: ModuleFilterConfigModel = {
592
- * id: 'track-shipments',
593
- * // transport omitted → FilterTransport.LegacyParallel
594
- * fields: [
595
- * { key: 'payment_status', label: 'Payment Status', type: 'enum', options: […] },
596
- * ],
597
- * };
598
- * ```
599
- */
600
- interface ModuleFilterConfigModel {
601
- /** Stable module id (`track-shipments`, `users`, …). */
602
- id: string;
603
- /**
604
- * Optional portal route segments for docs / deep links
605
- * (e.g. `['portal', 'shipment', 'track-shipments']`).
606
- */
607
- route?: string[];
608
- /** Free-text search box. */
609
- search?: {
610
- param: 'search';
611
- label: string;
612
- placeholder?: string;
613
- };
614
- /** Date range + which date column the range applies to. */
615
- date?: {
616
- rangeParams: {
617
- from: 'from';
618
- to: 'to';
619
- };
620
- fieldParam: 'date';
621
- fields: FilterOptionModel[];
622
- };
623
- /** Sort direction control. */
624
- sort?: {
625
- param: 'order';
626
- options: FilterOptionModel[];
627
- };
628
- /** Pagination query param names (defaults when omitted at serialize time). */
629
- pagination?: {
630
- pageParam: 'page';
631
- sizeParam: 'size';
632
- };
633
- /** Filterable fields rendered in the drawer. */
634
- fields: FilterFieldModel[];
635
- /**
636
- * Backend wire format — see {@link FilterTransport}.
637
- * Defaults to {@link DEFAULT_FILTER_TRANSPORT} when omitted.
638
- */
639
- transport?: FilterTransport;
640
- }
641
- /**
642
- * Preferred UI / feature state for filters.
643
- *
644
- * Keep values as a map keyed by {@link FilterFieldModel.key}; only flatten to
645
- * parallel comma strings at the API / URL boundary.
646
- */
647
- interface FilterStateModel {
648
- search?: string;
649
- /** Inclusive range start (`YYYY-MM-DD`). */
650
- from?: string;
651
- /** Inclusive range end (`YYYY-MM-DD`). */
652
- to?: string;
653
- /** Which date column `from`/`to` apply to (`created_at`, …). */
654
- date?: string;
655
- order?: 'asc' | 'desc' | string;
656
- page?: number;
657
- size?: number;
658
- /**
659
- * Field values keyed by {@link FilterFieldModel.key}.
660
- * Omit or set `undefined` / `''` to exclude from serialization.
661
- */
662
- values: Record<string, string | undefined>;
663
- }
664
- /**
665
- * Flat query / API bag produced by {@link toFilterParams}.
666
- * Values are strings (or numbers for page/size) ready for HttpParams / router.
667
- */
668
- type FilterParamsModel = Record<string, string | number | undefined>;
669
- /**
670
- * Resolved transport for a module config (defaults to {@link DEFAULT_FILTER_TRANSPORT}).
671
- * @param config
672
- */
673
- declare function resolveFilterTransport(config: Pick<ModuleFilterConfigModel, 'transport'>): FilterTransport;
674
-
675
- /**
676
- * Track shipments — payment / shipment status chips + tracking number.
677
- * Transport: legacy `filterColumn` / `filterValue`.
678
- */
679
- declare const trackShipmentsFilterConfig: ModuleFilterConfigModel;
680
- /**
681
- * Update shipments — richest legacy filter set (enums + entity selects + booleans).
682
- */
683
- declare const updateShipmentsFilterConfig: ModuleFilterConfigModel;
684
- /**
685
- * Users (customer list) — performed_action chips + user type select.
686
- */
687
- declare const usersFilterConfig: ModuleFilterConfigModel;
688
- /**
689
- * Named-transport example — newer endpoints with direct query keys.
690
- */
691
- declare const shipmentTrackingItemFilterConfig: ModuleFilterConfigModel;
692
- /** Seed registry — look up config by module id. */
693
- declare const FILTER_CONFIGS: {
694
- readonly 'track-shipments': ModuleFilterConfigModel;
695
- readonly 'update-shipments': ModuleFilterConfigModel;
696
- readonly users: ModuleFilterConfigModel;
697
- readonly 'shipment-tracking-item-list': ModuleFilterConfigModel;
698
- };
699
- /** Module ids present in {@link FILTER_CONFIGS}. */
700
- type FilterConfigId = keyof typeof FILTER_CONFIGS;
701
-
702
- /** Router / HTTP query bag accepted by {@link fromFilterParams}. */
703
- type FilterQueryBag = Record<string, string | number | null | undefined | readonly string[]>;
704
- /**
705
- * Empty filter state — safe default before hydrate / after reset.
706
- *
707
- * Sort defaults to descending (`desc`) so list screens match the usual
708
- * “newest first” API contract without an explicit Apply.
709
- *
710
- * @returns A state with an empty `values` map and `order: 'desc'`.
711
- */
712
- declare function emptyFilterState(): FilterStateModel;
713
- /**
714
- * Clone state so drawer edits do not mutate the host until Apply.
715
- *
716
- * @param state - Current filter state (or undefined).
717
- * @returns A shallow copy safe to mutate in the drawer.
718
- */
719
- declare function cloneFilterState(state?: FilterStateModel | null): FilterStateModel;
720
- /**
721
- * Serialize {@link FilterStateModel} for URL query strings and list API calls.
722
- *
723
- * - `legacy-parallel`: emits `filterColumn` / `filterValue` as aligned CSV.
724
- * - `named`: each selected field key is its own query param.
725
- *
726
- * Empty strings and undefined field values are omitted.
727
- *
728
- * @param state - Current filter map state.
729
- * @param config - Module schema (controls transport + shared params).
730
- * @returns Flat query / API bag ready for HttpParams or the router.
731
- */
732
- declare function toFilterParams(state: FilterStateModel, config: ModuleFilterConfigModel): FilterParamsModel;
733
- /**
734
- * Hydrate {@link FilterStateModel} from a flat query / API bag.
735
- *
736
- * For `legacy-parallel`, zips `filterColumn` + `filterValue` CSV pairs.
737
- * Unknown column keys are still restored into `values` so round-trips survive
738
- * config drift.
739
- *
740
- * @param params - Router query params or API query object (stringish values).
741
- * @param config - Module schema.
742
- * @returns Hydrated {@link FilterStateModel}.
743
- */
744
- declare function fromFilterParams(params: FilterQueryBag, config: ModuleFilterConfigModel): FilterStateModel;
745
- /**
746
- * Query keys this config reads and writes (`search`, `page`, `size`, field
747
- * keys or `filterColumn` / `filterValue`, etc.).
748
- *
749
- * @param config - Module schema.
750
- * @returns Deduped list of query param names.
751
- */
752
- declare function filterQueryKeys(config: ModuleFilterConfigModel): string[];
753
- /**
754
- * True when the bag contains any list-filter / pagination key this config
755
- * understands. Used to decide whether to hydrate from the URL.
756
- *
757
- * @param params - Router query params or API query object.
758
- * @param config - Module schema.
759
- * @returns Whether at least one relevant non-empty param is present.
760
- */
761
- declare function hasFilterParams(params: FilterQueryBag, config: ModuleFilterConfigModel): boolean;
762
- /**
763
- * Drop one field value (column deselected / section clear).
764
- *
765
- * @param state - Mutable or immutable state to copy.
766
- * @param key - {@link FilterFieldModel.key} to clear.
767
- * @returns Cloned state without that field value.
768
- */
769
- declare function clearFilterField(state: FilterStateModel, key: string): FilterStateModel;
770
- /**
771
- * Reset to empty values while optionally keeping pagination.
772
- *
773
- * @param keepPagination - When true, preserve `page` / `size`.
774
- * @param state - Optional prior state for pagination retention.
775
- * @returns Empty filter state, optionally retaining pagination.
776
- */
777
- declare function resetFilterState(keepPagination?: boolean, state?: FilterStateModel | null): FilterStateModel;
778
-
779
- /**
780
- * Product surface / shipment mode for STN vs SFN experiences.
781
- *
782
- * Persisted per browser tab (`sessionStorage`) and attached to outbound
783
- * requests (e.g. `x-shipment-mode` header and `mode` query where required).
784
- *
785
- * - `'stn'` — Ship To Nigeria / international inbound flows
786
- * - `'sfn'` — Ship From Nigeria / outbound flows
787
- */
788
- type ShippingMode = 'stn' | 'sfn';
789
-
790
- /**
791
- * Linear dimension unit used when displaying or validating package sizes.
792
- */
793
- type ModeDimensionUnit = 'cm' | 'inches';
794
- /**
795
- * Mass unit used when displaying or validating package weight.
796
- */
797
- type ModeMassUnit = 'KG' | 'LBS';
798
- /**
799
- * Supported currency codes for mode/region pricing display.
800
- */
801
- type ModeCurrencyCode = 'NGN' | 'USD';
802
- /**
803
- * App-type selector when resolving region config.
804
- */
805
- type ModeAppType = ShippingMode;
806
- /**
807
- * Region-specific display units and currency for a shipping mode.
808
- *
809
- * Field names match the wire (snake_case).
810
- */
811
- interface ModeRegionConfigModel {
812
- dimension_unit: ModeDimensionUnit;
813
- mass_unit: ModeMassUnit;
814
- currency: ModeCurrencyCode;
815
- currency_symbol: string;
816
- }
817
- /**
818
- * Region map for Ship-From-Nigeria (`sfn`) mode.
819
- */
820
- interface ModeSfnConfigModel {
821
- default: ModeRegionConfigModel;
822
- ng: ModeRegionConfigModel;
823
- }
824
- /**
825
- * Region map for Ship-To-Nigeria (`stn`) mode.
826
- */
827
- interface ModeStnConfigModel {
828
- default: ModeRegionConfigModel;
829
- us: ModeRegionConfigModel;
830
- cn: ModeRegionConfigModel;
831
- gb: ModeRegionConfigModel;
832
- }
833
- /**
834
- * Full public mode-config payload from `/public/mode/config`.
835
- */
836
- interface ModeConfigDataModel {
837
- sfn: ModeSfnConfigModel;
838
- stn: ModeStnConfigModel;
839
- }
840
-
841
- /**
842
- * User notification records from authenticated inbox reads.
843
- *
844
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
845
- * Field names match the wire (snake_case).
846
- */
847
- /**
848
- * Parsed payload inside {@link NotificationModel.data}.
849
- *
850
- * The API stores this object as a JSON string on the wire; the SDK mapper
851
- * parses it once into this shape.
852
- */
853
- interface NotificationPayloadModel {
854
- /** Related user id when present on the payload. */
855
- user_id?: number | null;
856
- /** Primary inbox title. */
857
- title: string;
858
- /** Supporting copy. */
859
- body?: string | null;
860
- /** In-app or external navigation target when the user opens the item. */
861
- link?: string | null;
862
- /** Optional image URL. */
863
- image?: string | null;
864
- /** When true, {@link link} should open in a new browsing context. */
865
- external_link?: boolean | null;
866
- }
867
- /**
868
- * Database notification row from `GET /user/notifications/read/{id?}`.
869
- */
870
- interface NotificationModel {
871
- /** UUID primary key. */
872
- id: string;
873
- /** Laravel notification class name. */
874
- type: string;
875
- /** Polymorphic notifiable type (e.g. `App\\Models\\User`). */
876
- notifiable_type: string;
877
- /** Polymorphic notifiable id. */
878
- notifiable_id: number;
879
- /** Parsed notification payload. */
880
- data: NotificationPayloadModel;
881
- /** ISO timestamp when read; `null` when unread. */
882
- read_at: string | null;
883
- created_at: string | null;
884
- updated_at: string | null;
885
- }
886
- /**
887
- * Compact inbox item derived from {@link NotificationModel} for UI headers.
888
- *
889
- * Maps cleanly onto {@link AfricaniesNotification} in `@africanies/africanies-ui`.
890
- */
891
- interface NotificationInboxItemModel {
892
- id: string;
893
- title: string;
894
- body?: string;
895
- timestamp?: string;
896
- read?: boolean;
897
- link?: string;
898
- external_link?: boolean;
899
- image?: string | null;
900
- }
901
- /** Mark one notification read — `PUT /user/notifications/update`. */
902
- interface NotificationMarkReadSingleRequestModel {
903
- id: string;
904
- }
905
- /** Mark every notification read — `PUT /user/notifications/update` with `{}`. */
906
- type NotificationMarkAllReadRequestModel = Record<string, never>;
907
-
908
- /**
909
- * Payment-method shapes from utility read endpoints.
910
- *
911
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
912
- * Field names match the wire (snake_case). Mapping in `@africanies/africanies-core`
913
- * preserves those keys.
914
- */
915
- /**
916
- * Currency nested on {@link PaymentMethodModel} — currency fields plus the
917
- * join pivot (no nested `payment_methods`).
918
- */
919
- interface PaymentMethodCurrencyModel extends Omit<CurrencyModel, 'payment_methods'> {
920
- /** Join keys for this payment method. */
921
- pivot: CurrencyPaymentMethodPivotModel;
922
- }
923
- /**
924
- * Payment processor record from `GET /payment_method/read/{id|all}`.
925
- */
926
- interface PaymentMethodModel {
927
- /** Numeric payment-method id. */
928
- id: number;
929
- /** Display name (e.g. `"Squad"`, `"Stripe"`). */
930
- name: string;
931
- /** Backend model class path (e.g. `"App\\Models\\Stripe"`). */
932
- model: string;
933
- /** Whether the method is available. */
934
- active: boolean;
935
- deleted_at: string | null;
936
- created_at: string | null;
937
- updated_at: string | null;
938
- /** Currencies this processor accepts. */
939
- currencies: PaymentMethodCurrencyModel[];
940
- }
941
- /** `"1"` / `"0"` flag as sent on payment-method update. */
942
- type PaymentMethodFlag01 = '0' | '1';
943
- /**
944
- * Request body for `PUT /payment_method/update` (App Settings → Payment Methods).
945
- *
946
- * The status switch is the only write UI. `name` and `model` are resent from
947
- * the current row (not edited in a form). The SDK serializes `active` to
948
- * `"1"` / `"0"`.
949
- */
950
- interface PaymentMethodUpdateRequestModel {
951
- id: number;
952
- name: string;
953
- model: string;
954
- /** Boolean or wire `"1"` / `"0"`. */
955
- active: boolean | PaymentMethodFlag01;
956
- }
957
-
958
- /**
959
- * Subscription plan shapes from public utility reads.
960
- *
961
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
962
- * Field names match the wire (snake_case).
963
- */
964
- /**
965
- * Line item under a {@link PlanModel} (dimensions, discounts, pricing tiers).
966
- */
967
- interface PlanPackageModel {
968
- id: number;
969
- plan_id: number | null;
970
- company_service_id: number | null;
971
- name: string;
972
- metrics: string | null;
973
- volume: number | null;
974
- discount: string | null;
975
- model: string | null;
976
- monthly: string | null;
977
- quarterly: string | null;
978
- biannually: string | null;
979
- annually: string | null;
980
- active: boolean;
981
- deleted_at: string | null;
982
- created_at: string | null;
983
- updated_at: string | null;
984
- }
985
- /**
986
- * Plan catalog record from `GET /public/plan/read/{id|all}`.
987
- *
988
- * Used in App Settings for Plans and Plan Packages. Authenticated writes use
989
- * `api/plan/*`. Nested {@link PlanPackageModel} rows appear when the wire
990
- * includes `packages`.
991
- */
992
- interface PlanModel {
993
- id: number;
994
- name: string;
995
- active: boolean;
996
- deleted_at: string | null;
997
- created_at: string | null;
998
- updated_at: string | null;
999
- packages: PlanPackageModel[];
1000
- }
1001
-
1002
- /**
1003
- * Product shapes from utility read endpoints.
1004
- *
1005
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
1006
- * Field names match the wire (snake_case).
1007
- */
1008
- /**
1009
- * Product record from `GET /product/read/{id|all}`.
1010
- *
1011
- * Includes HS codes, document/ETW id lists, and human-readable document
1012
- * labels. `zone_product_required_documents` stays an opaque JSON list until
1013
- * a dedicated nested model is needed.
1014
- */
1015
- interface ProductModel {
1016
- id: number;
1017
- account_id: number | null;
1018
- product_category_id: number | null;
1019
- hs_code: string;
1020
- hs_code_10: string | null;
1021
- hs_code_8: string | null;
1022
- hs_code_6: string | null;
1023
- name: string;
1024
- value: number;
1025
- usage: number;
1026
- document_ids: number[] | null;
1027
- etw_ids: number[] | null;
1028
- active: boolean;
1029
- is_external: boolean;
1030
- deleted_at: string | null;
1031
- created_at: string | null;
1032
- updated_at: string | null;
1033
- /** Display labels for required documents (e.g. `"Fumigation Certificate"`). */
1034
- document_details: string[];
1035
- /** Display labels for ETW documents (e.g. `"FDA Certificate"`). */
1036
- etw_document_details: string[];
1037
- /**
1038
- * Zone-scoped required document payloads when present (null-safe JSON tree).
1039
- */
1040
- zone_product_required_documents: ApiJsonValue[];
1041
- }
1042
-
1043
- /**
1044
- * Subscription / add-on service shapes from public utility reads.
1045
- *
1046
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
1047
- * Field names match the wire (snake_case).
1048
- */
1049
- /**
1050
- * Service catalog record from `GET /public/service/read/{id|all}`.
1051
- *
1052
- * Used in App Settings for Services, Plans, and Plan Packages boards.
1053
- * Authenticated create/update/delete use `api/service/*`.
1054
- */
1055
- interface ServiceModel {
1056
- id: number;
1057
- name: string;
1058
- /** Optional marketing / admin description when the wire includes it. */
1059
- description: string | null;
1060
- /** Backend Eloquent class (e.g. `"App\\Models\\SomeService"`). */
1061
- model: string;
1062
- active: boolean;
1063
- deleted_at: string | null;
1064
- created_at: string | null;
1065
- updated_at: string | null;
1066
- }
1067
-
1068
- /**
1069
- * Shipment method (carrier) shapes from utility read endpoints.
1070
- *
1071
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
1072
- * Field names match the wire (snake_case), including nested `zone_values`.
1073
- */
1074
- /**
1075
- * Geographic zone nested under a method↔zone link.
1076
- */
1077
- interface ShipmentZoneModel {
1078
- id: number;
1079
- name: string;
1080
- type: string;
1081
- active: boolean;
1082
- }
1083
- /**
1084
- * Link row tying a shipment method to a {@link ShipmentZoneModel}.
1085
- */
1086
- interface ShipmentMethodZoneLinkModel {
1087
- id: number;
1088
- zone_id: number;
1089
- shipment_method_id: number;
1090
- active: boolean;
1091
- mode: ShippingMode;
1092
- zone: ShipmentZoneModel | null;
1093
- }
1094
- /**
1095
- * One Laravel-style page of zone links embedded on a method payload
1096
- * (`zone_values` on the wire).
1097
- */
1098
- interface ShipmentMethodZonePageModel {
1099
- /** Rows on this page (wire key `data`). */
1100
- data: ShipmentMethodZoneLinkModel[];
1101
- current_page: number;
1102
- per_page: number;
1103
- total: number;
1104
- last_page: number;
1105
- }
1106
- /**
1107
- * Carrier / shipment method from `GET /shipment_method/read/{id|all}`.
1108
- */
1109
- interface ShipmentMethodModel {
1110
- id: number;
1111
- name: string;
1112
- slug: string;
1113
- model: string;
1114
- min_delivery_business_day: number;
1115
- max_delivery_business_day: number;
1116
- notes: string;
1117
- blacklisted_words: string | null;
1118
- position: number;
1119
- min_weight: number;
1120
- max_weight: number;
1121
- max_length: number;
1122
- max_width: number;
1123
- max_height: number;
1124
- markup: number;
1125
- surcharge: number;
1126
- insurance_benchmark: number;
1127
- insurance: number;
1128
- clearing_handling: number;
1129
- destination: string;
1130
- /** Whether the method is sea-only (wire `"yes"` / `"no"`). */
1131
- sea_only: boolean;
1132
- currency: string;
1133
- type: string;
1134
- active: boolean;
1135
- multiple_rates: boolean;
1136
- first_shipment_discount: number;
1137
- discount_type: string;
1138
- discount_active: boolean;
1139
- mode: ShippingMode;
1140
- deleted_at: string | null;
1141
- created_at: string | null;
1142
- updated_at: string | null;
1143
- markdown: number;
1144
- zone_values: ShipmentMethodZonePageModel;
1145
- }
1146
-
1147
- /**
1148
- * Authenticated user shapes from `GET /user`.
1149
- *
1150
- * Field names match the wire (snake_case). Most properties are optional /
1151
- * nullable so Customer and Admin payloads can share one type safely.
1152
- *
1153
- * The wire body is a bare user object (no `{ success, data }` envelope).
1154
- * {@link ApiClient} still wraps it in {@link ApiResponseModel}; mapping in
1155
- * `@africanies/africanies-core` preserves snake_case and fills nested models.
1156
- */
1157
- /** Backend Eloquent class for the authenticated principal. */
1158
- type UserModelType = 'App\\Models\\Customer' | 'App\\Models\\Admin';
1159
- /** Account classification on the user / business account. */
1160
- type AccountType = 'business' | 'individual';
1161
- /** Preferred shipping flow. */
1162
- type ShippingType = 'instant' | 'consolidation';
1163
- /** Billing cadence on plans / subscriptions. */
1164
- type PlanType = 'monthly' | 'quarterly' | 'biannually' | 'annually';
1165
- /**
1166
- * Subdivision entry under {@link UserCountryModel.states}.
1167
- */
1168
- interface UserStateModel {
1169
- name?: string | null;
1170
- state_code?: string | null;
1171
- }
1172
- /**
1173
- * Country nested on the user profile (lighter than the public country utility).
1174
- */
1175
- interface UserCountryModel {
1176
- id?: number | null;
1177
- name?: string | null;
1178
- iso3?: string | null;
1179
- iso2?: string | null;
1180
- states?: UserStateModel[] | null;
1181
- }
1182
- /**
1183
- * Line item under a subscription {@link UserPlanModel} (dimensions, discounts,
1184
- * perks — values are often stringified numbers or descriptive text).
1185
- */
1186
- interface UserPlanPackageModel {
1187
- id?: number | null;
1188
- plan_id?: number | null;
1189
- company_service_id?: number | null;
1190
- name?: string | null;
1191
- metrics?: string | null;
1192
- volume?: number | null;
1193
- discount?: string | null;
1194
- model?: string | null;
1195
- monthly?: string | null;
1196
- quarterly?: string | null;
1197
- biannually?: string | null;
1198
- annually?: string | null;
1199
- active?: boolean | null;
1200
- deleted_at?: string | null;
1201
- created_at?: string | null;
1202
- updated_at?: string | null;
1203
- }
1204
- /**
1205
- * Subscription plan attached to a business account.
1206
- */
1207
- interface UserPlanModel {
1208
- id?: number | null;
1209
- name?: string | null;
1210
- active?: boolean | null;
1211
- deleted_at?: string | null;
1212
- created_at?: string | null;
1213
- updated_at?: string | null;
1214
- packages?: UserPlanPackageModel[] | null;
1215
- }
1216
- /**
1217
- * Payment gateway redirect payload (often nested under payment_payload JSON).
1218
- */
1219
- interface UserGatewayPayloadModel {
1220
- authorization_url?: string | null;
1221
- access_code?: string | null;
1222
- reference?: string | null;
1223
- redirect_url?: string | null;
1224
- }
1225
- /**
1226
- * Parsed payment redirect / checkout payload.
1227
- */
1228
- interface UserPaymentPayloadModel {
1229
- url?: string | null;
1230
- redirect_url?: string | null;
1231
- gateway_payload?: UserGatewayPayloadModel | null;
1232
- reference?: string | null;
1233
- }
1234
- /**
1235
- * Subscription row on a business account.
1236
- *
1237
- * `payment_payload` is a raw JSON string on the wire — parse with
1238
- * `JSON.parse` into {@link UserPaymentPayloadModel} when needed.
1239
- */
1240
- interface UserSubscriptionModel {
1241
- id?: number | null;
1242
- user_id?: number | null;
1243
- plan_id?: number | null;
1244
- account_id?: number | null;
1245
- reference?: string | null;
1246
- process_url?: string | null;
1247
- reference_salt?: string | null;
1248
- amount?: string | null;
1249
- /** e.g. `"NGN"`. */
1250
- currency?: string | null;
1251
- payment_amount?: string | null;
1252
- payment_currency?: string | null;
1253
- coupon_id?: number | null;
1254
- coupon_discount?: string | null;
1255
- coupon_amount?: string | null;
1256
- /** Raw JSON string — parse to {@link UserPaymentPayloadModel}. */
1257
- payment_payload?: string | null;
1258
- plan_type?: PlanType | null;
1259
- used?: boolean | null;
1260
- deleted_at?: string | null;
1261
- created_at?: string | null;
1262
- updated_at?: string | null;
1263
- }
1264
- /**
1265
- * Business account nested under the user when present.
1266
- */
1267
- interface UserBusinessAccountModel {
1268
- id?: number | null;
1269
- user_id?: number | null;
1270
- plan_id?: number | null;
1271
- name?: string | null;
1272
- account_email?: string | null;
1273
- plan_type?: PlanType | null;
1274
- first_payment?: boolean | null;
1275
- is_whitelisted?: boolean | null;
1276
- no_state_validation?: boolean | null;
1277
- show_waybill?: boolean | null;
1278
- notify_api_shipment?: boolean | null;
1279
- active?: boolean | null;
1280
- expires_at?: string | null;
1281
- deleted_at?: string | null;
1282
- created_at?: string | null;
1283
- updated_at?: string | null;
1284
- type?: AccountType | null;
1285
- days_left?: number | null;
1286
- plan?: UserPlanModel | null;
1287
- subscription?: UserSubscriptionModel | null;
1288
- }
1289
- /**
1290
- * Assigned account manager when present.
1291
- */
1292
- interface UserAccountManagerModel {
1293
- id?: number | null;
1294
- user_id?: number | null;
1295
- manager_id?: number | null;
1296
- account_id?: number | null;
1297
- name?: string | null;
1298
- email?: string | null;
1299
- phone?: string | null;
1300
- created_at?: string | null;
1301
- updated_at?: string | null;
1302
- deleted_at?: string | null;
1303
- }
1304
- /**
1305
- * Current user from `GET /user` (auth required).
1306
- *
1307
- * Covers Customer and Admin wire variants; omit or null fields as the API
1308
- * omits them.
1309
- */
1310
- interface UserModel {
1311
- id?: number | null;
1312
- central_id?: string | null;
1313
- name?: string | null;
1314
- first_name?: string | null;
1315
- middle_name?: string | null;
1316
- last_name?: string | null;
1317
- email?: string | null;
1318
- phone?: string | null;
1319
- unit_number?: string | null;
1320
- referral_code?: string | null;
1321
- old_unit_number?: string | null;
1322
- account_email?: string | null;
1323
- two_factor?: boolean | null;
1324
- default_pin?: boolean | null;
1325
- model?: UserModelType | null;
1326
- country?: UserCountryModel | null;
1327
- /** Selected state label when the API returns a string. */
1328
- state?: string | null;
1329
- email_verified_at?: string | null;
1330
- phone_verified_at?: string | null;
1331
- kyc_verified_at?: string | null;
1332
- passport_verified_at?: string | null;
1333
- suspended_at?: string | null;
1334
- deactivated_at?: string | null;
1335
- active?: boolean | null;
1336
- /**
1337
- * When true after login, send the user to `/onboarding/reset-password`
1338
- * (change current → new via `POST /user/change/password`). Not the
1339
- * email-link forgot-password flow.
1340
- */
1341
- default_password?: boolean | null;
1342
- type?: AccountType | null;
1343
- deleted_at?: string | null;
1344
- created_at?: string | null;
1345
- updated_at?: string | null;
1346
- last_login_at?: string | null;
1347
- socialite_signup?: 0 | 1 | null;
1348
- form_signup?: 0 | 1 | null;
1349
- /** e.g. `"ng"`. */
1350
- main_region?: string | null;
1351
- shipping_type?: ShippingType | null;
1352
- /** Shape TBD when the API populates this list. */
1353
- accounts?: unknown[] | null;
1354
- business_account?: UserBusinessAccountModel | null;
1355
- account_manager?: UserAccountManagerModel | null;
1356
- }
1357
- /**
1358
- * Request body for `POST /user/change/password`.
1359
- *
1360
- * First login with a default password (`user.default_password`) — not the
1361
- * email-link forgot-password flow. Host apps typically land on
1362
- * `/onboarding/reset-password`, then the dashboard.
1363
- */
1364
- interface ChangePasswordRequestModel {
1365
- /** Password the user signed in with (the default / current password). */
1366
- current_password: string;
1367
- /** Replacement password. */
1368
- password: string;
1369
- /** Must match {@link ChangePasswordRequestModel.password}. */
1370
- password_confirmation: string;
1371
- }
1372
-
1373
- /**
1374
- * Warehouse shapes from utility read endpoints.
1375
- *
1376
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
1377
- * Field names match the wire (snake_case).
1378
- */
1379
- /**
1380
- * Subdivision attached to a warehouse (includes country name/code).
1381
- */
1382
- interface WarehouseStateModel {
1383
- /** State id from the API. */
1384
- id: number;
1385
- /** Display name (e.g. `"Guangdong"`). */
1386
- name: string;
1387
- /** Subdivision code. */
1388
- state_code: string;
1389
- /** Country display name on the wire (e.g. `"China"`). */
1390
- country: string;
1391
- /** ISO 3166-1 alpha-2. */
1392
- country_code: string;
1393
- }
1394
- /**
1395
- * Warehouse record from `GET /warehouse/read/{id|all}`.
1396
- */
1397
- interface WarehouseModel {
1398
- id: number;
1399
- partner_id: number | null;
1400
- name: string;
1401
- phone: string;
1402
- email: string;
1403
- country: CountryModel | null;
1404
- /** Whether API integrations are enabled (wire `"0"` / `"1"`). */
1405
- api_enabled: boolean;
1406
- state: WarehouseStateModel | null;
1407
- city: string;
1408
- address: string;
1409
- longitude: number;
1410
- latitude: number;
1411
- zip_code: string;
1412
- usage: number;
1413
- active: boolean;
1414
- deleted_at: string | null;
1415
- created_at: string | null;
1416
- updated_at: string | null;
1417
- storage_charge: number;
1418
- storage_period: number;
1419
- delivery_charge: number;
1420
- delivery_count: number;
1421
- currency: string;
1422
- etw_shipment_available: boolean;
1423
- local: boolean;
1424
- no_shippo: boolean;
1425
- /**
1426
- * Nested partner payload when present (null-safe JSON tree).
1427
- */
1428
- partner: ApiJsonValue | null;
1429
- }
1430
-
1431
- /**
1432
- * Zone shapes from utility read endpoints.
1433
- *
1434
- * Domain interfaces in `@africanies/africanies-models` use a `*Model` suffix.
1435
- * Field names match the wire (snake_case).
1436
- */
1437
- /**
1438
- * Zone record from `GET /zone/read/records/{id|all}`.
1439
- */
1440
- interface ZoneModel {
1441
- id: number;
1442
- name: string;
1443
- /** Zone type from the API (e.g. `"standard"`, `"default"`). */
1444
- type: string;
1445
- active: boolean;
1446
- deleted_at: string | null;
1447
- created_at: string | null;
1448
- updated_at: string | null;
1449
- }
1450
-
1451
- export { BOX_DELIVERY_VENDORS, DEFAULT_FILTER_TRANSPORT, DEFAULT_PAGE_SIZE, DELIVERY_VENDORS, DELIVERY_VENDOR_OPTIONS, EXPORT_DELIVERY_VENDORS, FILTER_CONFIGS, FilterTransport, NOTIFICATION_PAGE_SIZE, PAGINATION_PAGE_SIZES, clearFilterField, cloneFilterState, deliveryVendorLabel, emptyFilterState, filterQueryKeys, fromFilterParams, hasFilterParams, isKnownDeliveryVendor, normalizeDeliveryVendor, normalizeDeliveryVendorForForm, resetFilterState, resolveFilterTransport, shipmentTrackingItemFilterConfig, toFilterParams, trackShipmentsFilterConfig, updateShipmentsFilterConfig, usersFilterConfig };
1452
- export type { AccountType, ApiErrorDetailModel, ApiJsonObjectModel, ApiJsonPrimitive, ApiJsonValue, ApiResponseModel, AsyncQueryStateModel, BoxDeliveryVendorId, ChangePasswordRequestModel, CountryModel, CountryStateModel, CurrencyCreateRequestModel, CurrencyDeleteRequestModel, CurrencyFlag01, CurrencyModel, CurrencyPaymentMethodModel, CurrencyPaymentMethodPivotModel, CurrencyUpdateRequestModel, DeliveryVendorId, DocumentModel, ExportDeliveryVendorId, FileReadModel, FileReadRequestModel, FilterConfigId, FilterFieldModel, FilterFieldType, FilterOptionModel, FilterOptionsSource, FilterParamsModel, FilterQueryBag, FilterStateModel, ForgotPasswordRequestModel, ModeAppType, ModeConfigDataModel, ModeCurrencyCode, ModeDimensionUnit, ModeMassUnit, ModeRegionConfigModel, ModeSfnConfigModel, ModeStnConfigModel, ModuleFilterConfigModel, NotificationInboxItemModel, NotificationMarkAllReadRequestModel, NotificationMarkReadSingleRequestModel, NotificationModel, NotificationPayloadModel, PaginationMetaModel, PaginationPageSize, PaginationQueryParamsModel, PaymentMethodCurrencyModel, PaymentMethodFlag01, PaymentMethodModel, PaymentMethodUpdateRequestModel, PlanModel, PlanPackageModel, PlanType, ProductModel, ResourceId, ServiceModel, ShipmentMethodModel, ShipmentMethodZoneLinkModel, ShipmentMethodZonePageModel, ShipmentZoneModel, ShippingMode, ShippingType, UserAccountManagerModel, UserBusinessAccountModel, UserCountryModel, UserGatewayPayloadModel, UserModel, UserModelType, UserPaymentPayloadModel, UserPlanModel, UserPlanPackageModel, UserStateModel, UserSubscriptionModel, WarehouseModel, WarehouseStateModel, ZoneModel };