@webx-ui/module-delivery 0.0.0-stage → 0.1.0

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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -2
  3. package/dist/BindingsPage-pjTbDDWA.js +280 -0
  4. package/dist/BindingsPage-pjTbDDWA.js.map +1 -0
  5. package/dist/BindingsPage.d.ts +2 -0
  6. package/dist/CarrierDialog.d.ts +26 -0
  7. package/dist/CarriersPage-Dpre8dbl.js +650 -0
  8. package/dist/CarriersPage-Dpre8dbl.js.map +1 -0
  9. package/dist/CarriersPage.d.ts +2 -0
  10. package/dist/GeographyPage-IBg0JnNH.js +750 -0
  11. package/dist/GeographyPage-IBg0JnNH.js.map +1 -0
  12. package/dist/GeographyPage.d.ts +2 -0
  13. package/dist/LocalityDialog.d.ts +39 -0
  14. package/dist/LocalitySearch.d.ts +33 -0
  15. package/dist/MethodPane.d.ts +29 -0
  16. package/dist/MethodsPage-Bpzsa_6v.js +414 -0
  17. package/dist/MethodsPage-Bpzsa_6v.js.map +1 -0
  18. package/dist/MethodsPage.d.ts +2 -0
  19. package/dist/OrderChangeDialog.d.ts +7 -0
  20. package/dist/OrderDeliveryNode.d.ts +2 -0
  21. package/dist/PointDialog.d.ts +22 -0
  22. package/dist/PointsPage-CzYIM86R.js +336 -0
  23. package/dist/PointsPage-CzYIM86R.js.map +1 -0
  24. package/dist/PointsPage.d.ts +2 -0
  25. package/dist/PopularPage-CSrvVg4o.js +141 -0
  26. package/dist/PopularPage-CSrvVg4o.js.map +1 -0
  27. package/dist/PopularPage.d.ts +2 -0
  28. package/dist/RegionDialog.d.ts +11 -0
  29. package/dist/WaybillDialog.d.ts +8 -0
  30. package/dist/api.d.ts +151 -0
  31. package/dist/fields/CountryField.d.ts +14 -0
  32. package/dist/fields/LocalitiesField.d.ts +14 -0
  33. package/dist/fields/LocalityField.d.ts +16 -0
  34. package/dist/fields/PointKindField.d.ts +20 -0
  35. package/dist/fields/RegionField.d.ts +19 -0
  36. package/dist/fields/ScheduleField.d.ts +24 -0
  37. package/dist/i18n.d.ts +5 -0
  38. package/dist/index-5nt0M0In.js +2539 -0
  39. package/dist/index-5nt0M0In.js.map +1 -0
  40. package/dist/index.d.ts +6 -0
  41. package/dist/index.js +9 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/messages.d.ts +7 -0
  44. package/dist/module.d.ts +19 -0
  45. package/dist/style.css +1 -0
  46. package/dist/types.d.ts +467 -0
  47. package/package.json +64 -3
@@ -0,0 +1,467 @@
1
+ import { ScreenModel } from '@webx-ui/schema';
2
+ /** A page of a list, as Laravel's `->paginate()` answers. */
3
+ export interface Page<T> {
4
+ data: T[];
5
+ current_page: number;
6
+ last_page: number;
7
+ per_page: number;
8
+ total: number;
9
+ from: number | null;
10
+ to: number | null;
11
+ }
12
+ export interface Option {
13
+ value: string;
14
+ label: string;
15
+ }
16
+ /** The short line of a locality: a picker's suggestion, a popular town, a candidate. */
17
+ export interface LocalityBrief {
18
+ id: number;
19
+ name: string;
20
+ /** «Town A, District C, Region B» — what tells namesakes apart. */
21
+ label: string;
22
+ kind: string;
23
+ /** «Town», «Village»: the type in the panel's language. */
24
+ kind_label: string;
25
+ country: string;
26
+ active: boolean;
27
+ }
28
+ export interface MethodType {
29
+ key: string;
30
+ title: string;
31
+ /** One line of what the type is, under its title in «What kind of method?». */
32
+ description: string;
33
+ carrier: string;
34
+ carrier_title: string;
35
+ asks: 'nothing' | 'address' | 'point';
36
+ }
37
+ export interface MethodRow {
38
+ id: number;
39
+ key: string;
40
+ type: string;
41
+ type_title: string;
42
+ carrier: string | null;
43
+ carrier_title: string | null;
44
+ /** The type is not installed any more: the method stays and is never offered. */
45
+ missing: boolean;
46
+ title: string;
47
+ price: number | null;
48
+ price_text: string | null;
49
+ countries: string[];
50
+ enabled: boolean;
51
+ position: number;
52
+ }
53
+ export interface MethodDetail {
54
+ method: MethodRow;
55
+ values: ScreenModel;
56
+ /** Node ids of the form this type has no use for. */
57
+ hidden: string[];
58
+ point_kinds: Option[];
59
+ }
60
+ export interface MethodBlank {
61
+ hidden: string[];
62
+ point_kinds: Option[];
63
+ type_title: string;
64
+ }
65
+ export interface PointRow {
66
+ id: number;
67
+ kind: string;
68
+ kind_label: string;
69
+ title: string;
70
+ address: string;
71
+ locality: LocalityBrief | null;
72
+ phone: string | null;
73
+ active: boolean;
74
+ today: string | null;
75
+ }
76
+ export interface PointDetail {
77
+ point: PointRow;
78
+ values: ScreenModel;
79
+ }
80
+ export interface PointsPage extends Page<PointRow> {
81
+ filters: {
82
+ kinds: Option[];
83
+ };
84
+ }
85
+ export interface SyncRun {
86
+ id: number;
87
+ directory: string;
88
+ status: 'running' | 'succeeded' | 'failed' | 'held';
89
+ trigger: string;
90
+ pages: number;
91
+ seen: number;
92
+ created: number;
93
+ updated: number;
94
+ removed: number;
95
+ queued: number;
96
+ held: number | null;
97
+ error: string | null;
98
+ started_at: string | null;
99
+ finished_at: string | null;
100
+ }
101
+ export interface CarrierDirectory {
102
+ directory: 'localities' | 'points' | 'streets';
103
+ cron: string | null;
104
+ last_success: string | null;
105
+ latest: SyncRun | null;
106
+ running: boolean;
107
+ held: number | null;
108
+ stale: boolean;
109
+ records: number;
110
+ /** `label` — the server's words, a satellite's own reasons among them; older servers send none. */
111
+ remarks: {
112
+ key: string;
113
+ count: number;
114
+ label?: string;
115
+ }[];
116
+ }
117
+ export interface CarrierRow {
118
+ key: string;
119
+ title: string;
120
+ icon: string | null;
121
+ enabled: boolean;
122
+ countries: string[];
123
+ syncs: boolean;
124
+ directories: CarrierDirectory[];
125
+ queue: number;
126
+ /** Labels of chosen settings the carrier's account no longer has, from the options last asked for. */
127
+ missing: string[];
128
+ }
129
+ /**
130
+ * A field a carrier asks for (§13.2): the name it is stored by and how to draw it. `options:
131
+ * 'carrier'` — its options come from the carrier's account (`ProvidesSettingOptions`), `depends`
132
+ * — the fields they depend on, `search` — they are searched by what is typed, not listed.
133
+ */
134
+ export interface CarrierField {
135
+ name: string;
136
+ type?: string;
137
+ label?: string | Record<string, string>;
138
+ options?: Option[] | 'carrier';
139
+ depends?: string[];
140
+ search?: boolean;
141
+ default?: unknown;
142
+ required?: boolean;
143
+ min?: number;
144
+ max?: number;
145
+ /** A number's step and decimal places: a weight of 0.5 kg needs 0.1, not the default 1. */
146
+ step?: number;
147
+ precision?: number;
148
+ [key: string]: unknown;
149
+ }
150
+ /** One option of a field from the carrier's account. */
151
+ export interface SettingOption {
152
+ value: string;
153
+ label: string;
154
+ hint: string | null;
155
+ }
156
+ export interface CarrierDetail extends CarrierRow {
157
+ settings: {
158
+ fields: CarrierField[];
159
+ /** The stored values, with `_labels` — field → label of the chosen option. */
160
+ values: Record<string, unknown>;
161
+ /** Chosen values the carrier's account no longer has: field → label. */
162
+ missing: Record<string, string>;
163
+ };
164
+ /** The keys: whether each is set, never what it is. */
165
+ credentials: (CarrierField & {
166
+ set: boolean;
167
+ })[];
168
+ runs: SyncRun[];
169
+ }
170
+ export interface CountryRow {
171
+ code: string;
172
+ name: string;
173
+ active: boolean;
174
+ position: number;
175
+ regions: number;
176
+ localities: number;
177
+ leader: string | null;
178
+ /** The config names the leader: the panel cannot change it. */
179
+ leader_fixed: boolean;
180
+ }
181
+ export interface Countries {
182
+ countries: CountryRow[];
183
+ choices: {
184
+ code: string;
185
+ name: string;
186
+ }[];
187
+ /** The carriers that may lead a country, by their titles. */
188
+ carriers: Option[];
189
+ }
190
+ export interface RegionRow {
191
+ id: number;
192
+ name: string;
193
+ names: Record<string, string>;
194
+ code: string | null;
195
+ country: string;
196
+ /** Where it stands in the country's own order; alphabetical breaks a tie. */
197
+ position: number;
198
+ localities: number;
199
+ }
200
+ export interface LocalityRow extends LocalityBrief {
201
+ region: {
202
+ id: number;
203
+ name: string;
204
+ } | null;
205
+ district: string | null;
206
+ weight: number;
207
+ created_by: string;
208
+ source: 'manual' | 'import' | 'carrier';
209
+ bindings: {
210
+ carrier: string;
211
+ carrier_title: string;
212
+ external_id: string;
213
+ status: string;
214
+ }[];
215
+ }
216
+ /**
217
+ * A page of the geography's list. Empty, it says where the same search and filters do find
218
+ * localities: other countries, on or off.
219
+ */
220
+ export interface LocalityPage extends Page<LocalityRow> {
221
+ elsewhere?: {
222
+ code: string;
223
+ name: string;
224
+ active: boolean;
225
+ }[];
226
+ }
227
+ export interface LocalityDetail {
228
+ locality: LocalityBrief & {
229
+ source: LocalityRow['source'];
230
+ created_by: string;
231
+ manual_fields: string[];
232
+ held_by: string[];
233
+ };
234
+ values: ScreenModel;
235
+ }
236
+ /** The answer to a locality like one that exists (409): the ones to pick instead. */
237
+ export interface DuplicateAnswer {
238
+ message: string;
239
+ similar: (LocalityBrief & {
240
+ source: LocalityRow['source'];
241
+ })[];
242
+ }
243
+ export interface BindingRow {
244
+ id: number;
245
+ carrier: string;
246
+ carrier_title: string;
247
+ external_id: string;
248
+ reason: string | null;
249
+ record: {
250
+ name: string;
251
+ region: string | null;
252
+ district: string | null;
253
+ kind: string | null;
254
+ country: string | null;
255
+ lat: number | null;
256
+ lng: number | null;
257
+ };
258
+ candidates: (LocalityBrief & {
259
+ distance_km: number | null;
260
+ })[];
261
+ }
262
+ export interface BindingsPage extends Page<BindingRow> {
263
+ filters: {
264
+ carriers: {
265
+ value: string;
266
+ label: string;
267
+ count: number;
268
+ }[];
269
+ reasons: {
270
+ value: string;
271
+ count: number;
272
+ }[];
273
+ };
274
+ }
275
+ export interface BatchResult {
276
+ done: number;
277
+ failed: {
278
+ id: number;
279
+ message: string;
280
+ }[];
281
+ left: number;
282
+ }
283
+ /** The snapshot of the order's delivery in the panel's language (§11.1), read from the copy alone. */
284
+ export interface OrderDeliveryView {
285
+ method: string;
286
+ method_key: string | null;
287
+ carrier: string;
288
+ carrier_title: string;
289
+ locality: string;
290
+ point: {
291
+ title: string;
292
+ number: string | null;
293
+ address: string | null;
294
+ schedule: string | null;
295
+ } | null;
296
+ address: string | null;
297
+ note: string | null;
298
+ price: string | null;
299
+ was: string | null;
300
+ estimate: string | null;
301
+ paid_by_store: boolean;
302
+ payer: 'sender' | 'recipient' | null;
303
+ waybill: string | null;
304
+ }
305
+ export type ShipmentStatus = 'created' | 'in_transit' | 'at_point' | 'out_for_delivery' | 'received' | 'refused' | 'returning' | 'returned' | 'cancelled';
306
+ export interface ShipmentEvent {
307
+ status: ShipmentStatus;
308
+ label: string;
309
+ at: string;
310
+ text: string | null;
311
+ }
312
+ /** A parcel of the order (§11.2–§11.3). */
313
+ export interface ShipmentRow {
314
+ id: number;
315
+ number: string | null;
316
+ carrier: string;
317
+ method: string;
318
+ payer: 'sender' | 'recipient';
319
+ cost: number | null;
320
+ cost_formatted: string | null;
321
+ status: ShipmentStatus;
322
+ status_label: string;
323
+ status_at: string | null;
324
+ final: boolean;
325
+ next_check_at: string | null;
326
+ cancellable: boolean;
327
+ label: boolean;
328
+ events: ShipmentEvent[];
329
+ created_at: string | null;
330
+ }
331
+ /** What the carrier would get (§11.2): the dialog shows it and lets the manager change a few lines. */
332
+ export interface WaybillDraft {
333
+ order_id: number;
334
+ order_number: string | null;
335
+ carrier: string;
336
+ type: string;
337
+ method: string | null;
338
+ recipient: {
339
+ first_name: string;
340
+ last_name: string;
341
+ name: string;
342
+ phone: string | null;
343
+ email: string | null;
344
+ };
345
+ sender: Record<string, unknown>;
346
+ lines: {
347
+ name: string;
348
+ sku: string | null;
349
+ qty: number;
350
+ price: number;
351
+ }[];
352
+ declared_value: number;
353
+ currency: string;
354
+ payer: 'sender' | 'recipient';
355
+ cod: number | null;
356
+ carrier_locality: string | null;
357
+ /** The carrier's own fields of the waybill, by name. */
358
+ extra: Record<string, unknown>;
359
+ /** What the dialog draws besides the base's lines: the type's own fields and whether cash on delivery is asked. */
360
+ form?: {
361
+ fields: CarrierField[];
362
+ cod: boolean;
363
+ };
364
+ }
365
+ /** The tab «Delivery» of the order's card. */
366
+ export interface OrderDelivery {
367
+ order_id: number;
368
+ currency: string;
369
+ exponent: number;
370
+ delivery: OrderDeliveryView | null;
371
+ waybills: boolean;
372
+ can_ship: boolean;
373
+ draft: WaybillDraft | null;
374
+ active: number | null;
375
+ /** «Change delivery» for whoever edits the order (orders.manage); null — not theirs. */
376
+ change: OrderDeliveryChangeState | null;
377
+ shipments: ShipmentRow[];
378
+ }
379
+ /** What the dialog of «Change delivery» starts from: the choice as the order has it. */
380
+ export interface OrderDeliveryChangeState {
381
+ /** Why it cannot be changed now — a waybill stands; null — it can. */
382
+ refusal: string | null;
383
+ locality: {
384
+ id: number;
385
+ label: string;
386
+ } | null;
387
+ /** The method's key. */
388
+ method: string | null;
389
+ point: number | null;
390
+ address: Record<string, string | null> | null;
391
+ country: string | null;
392
+ }
393
+ /** A town of the dialog's search and of its popular buttons. */
394
+ export interface ChangeTown {
395
+ id: number;
396
+ name: string;
397
+ label: string;
398
+ region: string | null;
399
+ }
400
+ /** A method of the town, priced for the order's lines — the checkout's row. */
401
+ export interface ChangeMethod {
402
+ id: number;
403
+ key: string;
404
+ title: string;
405
+ description: string | null;
406
+ asks: 'nothing' | 'point' | 'address' | null;
407
+ carrier: string;
408
+ points: number | null;
409
+ disabled: boolean;
410
+ hint: string | null;
411
+ price: {
412
+ kind: string;
413
+ text: string;
414
+ was: string | null;
415
+ estimate: string | null;
416
+ } | null;
417
+ }
418
+ export interface ChangeOption {
419
+ value: string;
420
+ label: string;
421
+ hint?: string | null;
422
+ }
423
+ /** The input of «Change delivery». */
424
+ export interface ChangeInput {
425
+ locality: number;
426
+ method: number;
427
+ point?: number | null;
428
+ address?: {
429
+ street?: string | null;
430
+ street_id?: string | null;
431
+ house?: string | null;
432
+ apartment?: string | null;
433
+ note?: string | null;
434
+ } | null;
435
+ reason?: string | null;
436
+ dry_run?: boolean;
437
+ }
438
+ /** «Was → will be» of the sum, in the order's money. */
439
+ export interface ChangeOutcome {
440
+ summary_from: string | null;
441
+ summary_to: string | null;
442
+ amount_from: string;
443
+ amount_to: string;
444
+ total_from: string;
445
+ total_to: string;
446
+ total_changes: boolean;
447
+ balance: {
448
+ kind: 'topup' | 'over';
449
+ amount: string;
450
+ } | null;
451
+ dry_run: boolean;
452
+ }
453
+ export interface WaybillChanges {
454
+ recipient_first_name?: string | null;
455
+ recipient_last_name?: string | null;
456
+ recipient_phone?: string | null;
457
+ declared_value?: number | null;
458
+ cod?: number | null;
459
+ extra?: Record<string, unknown>;
460
+ dry_run?: boolean;
461
+ }
462
+ export type ShipmentLabel = {
463
+ url: string;
464
+ } | {
465
+ pdf: string;
466
+ filename: string;
467
+ };
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@webx-ui/module-delivery",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Delivery for the WebX UI admin panel: methods in the checkout order, the shop's own points, carriers with their directories and keys, the shared geography by hand, the popular towns and the binding queue.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "*.css"
9
+ ],
10
+ "keywords": [
11
+ "webx-ui",
12
+ "vue",
13
+ "admin",
14
+ "cms",
15
+ "e-commerce",
16
+ "delivery",
17
+ "shipping"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/webx-ui/webx-ui.git",
22
+ "directory": "packages/module-delivery"
23
+ },
24
+ "homepage": "https://github.com/webx-ui/webx-ui/tree/main/packages/module-delivery",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.js",
33
+ "types": "./dist/index.d.ts",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./dist/index.d.ts",
37
+ "import": "./dist/index.js"
38
+ },
39
+ "./style.css": "./dist/style.css",
40
+ "./dist/style.css": "./dist/style.css",
41
+ "./package.json": "./package.json"
42
+ },
43
+ "peerDependencies": {
44
+ "vue": "^3.5.0",
45
+ "vue-router": "^4.5.0"
46
+ },
47
+ "dependencies": {
48
+ "@webx-ui/core": "^0.46.1",
49
+ "@webx-ui/module-admin": "^0.35.0",
50
+ "@webx-ui/schema": "^0.11.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^24.10.1",
54
+ "@vitejs/plugin-vue": "^6.0.1",
55
+ "typescript": "^5.9.3",
56
+ "vite": "^7.1.14",
57
+ "vite-plugin-dts": "^4.5.4",
58
+ "vue": "^3.5.24",
59
+ "vue-router": "^4.5.1",
60
+ "vue-tsc": "^3.1.3"
61
+ },
62
+ "scripts": {
63
+ "build": "vite build",
64
+ "dev": "vite build --watch",
65
+ "typecheck": "vue-tsc -p tsconfig.json --noEmit"
66
+ }
6
67
  }