@pelygo/janus 0.1.1 → 0.2.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.
- package/dist/index.d.ts +2496 -56
- package/dist/index.js +786 -144
- package/package.json +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,137 @@ export declare interface AddReturnStatusRequest {
|
|
|
53
53
|
*/
|
|
54
54
|
export declare type ApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Asn Entity
|
|
58
|
+
*
|
|
59
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
60
|
+
*
|
|
61
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/asn.entity.ts
|
|
62
|
+
*/
|
|
63
|
+
export declare interface Asn extends BaseEntity_2 {
|
|
64
|
+
clientId: number;
|
|
65
|
+
asn_status: 'draft' | 'awaiting_arrival' | 'arrived' | 'processing' | 'receipted' | 'receipted_with_discrepancies' | 'temporarily_receipted' | 'quarantined' | 'cancelled';
|
|
66
|
+
expected_arrival_date?: string;
|
|
67
|
+
total_expected_units?: number;
|
|
68
|
+
/** OneToMany relationship to AsnLine */
|
|
69
|
+
asnLines: AsnLine[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* AsnLine Entity
|
|
74
|
+
*
|
|
75
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
76
|
+
*
|
|
77
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/line.entity.ts
|
|
78
|
+
*/
|
|
79
|
+
export declare interface AsnLine extends BaseEntity_2 {
|
|
80
|
+
asn_id: number;
|
|
81
|
+
product_id?: number;
|
|
82
|
+
sku_code: string;
|
|
83
|
+
expected_quantity: number;
|
|
84
|
+
received_quantity?: number;
|
|
85
|
+
/** ManyToOne relationship to Asn */
|
|
86
|
+
asn: Asn;
|
|
87
|
+
/** OneToMany relationship to AsnReceipt */
|
|
88
|
+
asnReceipts: AsnReceipt[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* AsnReceipt Entity
|
|
93
|
+
*
|
|
94
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
95
|
+
*
|
|
96
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/receipt.entity.ts
|
|
97
|
+
*/
|
|
98
|
+
export declare interface AsnReceipt extends BaseEntity_2 {
|
|
99
|
+
asn_id: number;
|
|
100
|
+
asn_line_id: number;
|
|
101
|
+
received_quantity: number;
|
|
102
|
+
stock_status: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
103
|
+
/** ManyToOne relationship to AsnLine */
|
|
104
|
+
asnLine: AsnLine;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* ASNs resource interface
|
|
109
|
+
*/
|
|
110
|
+
export declare interface AsnsResource {
|
|
111
|
+
/** Get all ASNs with optional filters */
|
|
112
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Asn>>;
|
|
113
|
+
/** Get an ASN by ID */
|
|
114
|
+
getById(id: number): Promise<Asn>;
|
|
115
|
+
/** Create a new ASN */
|
|
116
|
+
create(data: CreateAsnRequest): Promise<Asn>;
|
|
117
|
+
/** Update an ASN */
|
|
118
|
+
update(id: number, data: Partial<CreateAsnRequest>): Promise<Asn>;
|
|
119
|
+
/** Delete an ASN */
|
|
120
|
+
delete(id: number): Promise<void>;
|
|
121
|
+
/** Get all lines for an ASN */
|
|
122
|
+
getLines(asnId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<AsnLine>>;
|
|
123
|
+
/** Get a specific ASN line */
|
|
124
|
+
getLineById(asnId: number, lineId: number): Promise<AsnLine>;
|
|
125
|
+
/** Create a new ASN line */
|
|
126
|
+
createLine(asnId: number, data: CreateAsnLineRequest): Promise<unknown>;
|
|
127
|
+
/** Update an ASN line */
|
|
128
|
+
updateLine(asnId: number, lineId: number, data: UpdateAsnLineRequest): Promise<AsnLine>;
|
|
129
|
+
/** Delete an ASN line */
|
|
130
|
+
deleteLine(asnId: number, lineId: number): Promise<void>;
|
|
131
|
+
/** Get all receipts for an ASN line */
|
|
132
|
+
getReceipts(asnId: number, lineId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<AsnReceipt>>;
|
|
133
|
+
/** Get a specific ASN receipt */
|
|
134
|
+
getReceiptById(asnId: number, lineId: number, receiptId: number): Promise<AsnReceipt>;
|
|
135
|
+
/** Create a new ASN receipt */
|
|
136
|
+
createReceipt(asnId: number, lineId: number, data: CreateAsnReceiptRequest): Promise<AsnReceipt>;
|
|
137
|
+
/** Update an ASN receipt */
|
|
138
|
+
updateReceipt(asnId: number, lineId: number, receiptId: number, data: UpdateAsnReceiptRequest): Promise<AsnReceipt>;
|
|
139
|
+
/** Delete an ASN receipt */
|
|
140
|
+
deleteReceipt(asnId: number, lineId: number, receiptId: number): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Audit Entity
|
|
145
|
+
*
|
|
146
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
147
|
+
*
|
|
148
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/audit/audit.entity.ts
|
|
149
|
+
*/
|
|
150
|
+
export declare interface Audit extends BaseEntity_2 {
|
|
151
|
+
/** Foreign key to the client this audit entry belongs to. */
|
|
152
|
+
clientId: number;
|
|
153
|
+
/** Name of the resource/entity that was changed (e.g. "stock", "order", "product"). */
|
|
154
|
+
resource: string;
|
|
155
|
+
/** Primary key of the specific resource record that was changed. */
|
|
156
|
+
resource_id: number;
|
|
157
|
+
/** Type of mutation that triggered this audit entry. */
|
|
158
|
+
action: 'create' | 'update' | 'delete';
|
|
159
|
+
/** Snapshot of the resource's field values before the change. Keys are field names, values are the previous values. Empty object for "create" actions. */
|
|
160
|
+
old_value: Record<string, unknown>;
|
|
161
|
+
/** Snapshot of the resource's field values after the change. Keys are field names, values are the new values. Empty object for "delete" actions. */
|
|
162
|
+
new_value: Record<string, unknown>;
|
|
163
|
+
/** Free-text notes providing additional context for the change. */
|
|
164
|
+
notes?: string;
|
|
165
|
+
/** Foreign key to the user who performed the change. */
|
|
166
|
+
createdById: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Filters for audits
|
|
171
|
+
*/
|
|
172
|
+
export declare interface AuditsFilters extends ClientScopedPaginatedQueryFilters {
|
|
173
|
+
/** Additional filter */
|
|
174
|
+
filter?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Audits resource interface (read-only)
|
|
179
|
+
*/
|
|
180
|
+
export declare interface AuditsResource {
|
|
181
|
+
/** Get all audit records with optional filters */
|
|
182
|
+
getAll(filters?: AuditsFilters): Promise<PaginatedListResponse<Audit>>;
|
|
183
|
+
/** Get an audit record by ID */
|
|
184
|
+
getById(id: number): Promise<Audit>;
|
|
185
|
+
}
|
|
186
|
+
|
|
56
187
|
/**
|
|
57
188
|
* Base Entity Interface
|
|
58
189
|
*
|
|
@@ -73,6 +204,27 @@ export declare interface BaseEntity {
|
|
|
73
204
|
partition_id?: number;
|
|
74
205
|
}
|
|
75
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Base Entity Interface
|
|
209
|
+
*
|
|
210
|
+
* All JANUS entities extend from this base type.
|
|
211
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
212
|
+
*/
|
|
213
|
+
declare interface BaseEntity_2 {
|
|
214
|
+
/** Unique identifier */
|
|
215
|
+
id: number;
|
|
216
|
+
/** User ID who created this record */
|
|
217
|
+
created_by?: number;
|
|
218
|
+
/** User ID who last updated this record */
|
|
219
|
+
updated_by?: number;
|
|
220
|
+
/** Creation timestamp */
|
|
221
|
+
created_ts?: string;
|
|
222
|
+
/** Last update timestamp */
|
|
223
|
+
updated_ts?: string;
|
|
224
|
+
/** Partition ID for multi-tenancy */
|
|
225
|
+
partition_id?: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
76
228
|
/**
|
|
77
229
|
* Filter Types for API Queries
|
|
78
230
|
* @module types/filters
|
|
@@ -87,6 +239,38 @@ export declare interface BaseFilters {
|
|
|
87
239
|
pageSize?: number;
|
|
88
240
|
}
|
|
89
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Build a paginated URL for endpoints that require a clientId.
|
|
244
|
+
*
|
|
245
|
+
* Throws early for JS consumers if `clientId` is missing instead of sending
|
|
246
|
+
* a request that v2 will reject with a 400.
|
|
247
|
+
*
|
|
248
|
+
* @param basePath - Base URL path
|
|
249
|
+
* @param filters - Filter object with required clientId
|
|
250
|
+
* @returns Full URL with snake_case query parameters
|
|
251
|
+
*/
|
|
252
|
+
export declare function buildClientScopedPaginatedUrl(basePath: string, filters: FilterObject & {
|
|
253
|
+
clientId: number;
|
|
254
|
+
}): string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Build a URL with paginated query parameters, converting camelCase keys to snake_case.
|
|
258
|
+
*
|
|
259
|
+
* Use this for v2 endpoints that expect snake_case query params
|
|
260
|
+
* (e.g. `client_id`, `page_size`, `page_number`).
|
|
261
|
+
*
|
|
262
|
+
* @param basePath - Base URL path
|
|
263
|
+
* @param filters - Filter object with camelCase keys
|
|
264
|
+
* @returns Full URL with snake_case query parameters
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* const url = buildPaginatedUrl('/products', { clientId: 5, pageSize: 25 });
|
|
269
|
+
* // Returns: "/products?client_id=5&page_size=25"
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
export declare function buildPaginatedUrl(basePath: string, filters?: FilterObject): string;
|
|
273
|
+
|
|
90
274
|
/**
|
|
91
275
|
* Build a query string from a filter object.
|
|
92
276
|
*
|
|
@@ -119,6 +303,16 @@ export declare function buildQueryString(filters: FilterObject): string;
|
|
|
119
303
|
*/
|
|
120
304
|
export declare function buildUrl(baseUrl: string, filters?: FilterObject): string;
|
|
121
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Data for changing a user's password
|
|
308
|
+
*/
|
|
309
|
+
export declare interface ChangePasswordRequest {
|
|
310
|
+
/** Username */
|
|
311
|
+
username: string;
|
|
312
|
+
/** Client ID */
|
|
313
|
+
client_id: number;
|
|
314
|
+
}
|
|
315
|
+
|
|
122
316
|
/**
|
|
123
317
|
* Client Entity
|
|
124
318
|
*
|
|
@@ -143,6 +337,22 @@ export declare interface Client extends BaseEntity {
|
|
|
143
337
|
default_courier_service_id?: number;
|
|
144
338
|
/** Whether client is active */
|
|
145
339
|
active?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Legacy vdepot customer ID.
|
|
342
|
+
*
|
|
343
|
+
* This is NOT the same as `id` (Janus internal ID).
|
|
344
|
+
* Use this value when querying legacy endpoints that filter by `products.customer_id`.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* // Correct: use remote_client_id for legacy product queries
|
|
348
|
+
* janus.legacy.queryProducts({
|
|
349
|
+
* query: [{ query_name: 'products.customer_id', query_type: '=', query_value: client.remote_client_id }],
|
|
350
|
+
* });
|
|
351
|
+
*
|
|
352
|
+
* // WRONG: do not use client.id for legacy queries
|
|
353
|
+
* // client.id is the Janus internal ID, not the legacy customer ID
|
|
354
|
+
*/
|
|
355
|
+
remote_client_id?: number;
|
|
146
356
|
}
|
|
147
357
|
|
|
148
358
|
/**
|
|
@@ -170,6 +380,16 @@ export declare interface ClientCourierService extends BaseEntity {
|
|
|
170
380
|
*/
|
|
171
381
|
export declare type ClientOperationalStatus = 'active' | 'inactive' | 'onboarding' | 'offboarding';
|
|
172
382
|
|
|
383
|
+
/**
|
|
384
|
+
* Base filters for client-scoped v2 paginated list endpoints.
|
|
385
|
+
*
|
|
386
|
+
* These endpoints require `clientId` and will reject requests without it.
|
|
387
|
+
*/
|
|
388
|
+
export declare interface ClientScopedPaginatedQueryFilters extends PaginatedQueryFilters {
|
|
389
|
+
/** Filter by client ID (required for client-scoped endpoints) */
|
|
390
|
+
clientId: number;
|
|
391
|
+
}
|
|
392
|
+
|
|
173
393
|
/**
|
|
174
394
|
* Client settings structure
|
|
175
395
|
*/
|
|
@@ -208,24 +428,130 @@ export declare interface ClientSettingsPublicResponse {
|
|
|
208
428
|
export declare interface ClientsResource {
|
|
209
429
|
/** Get all clients accessible to the current user */
|
|
210
430
|
getAll(): Promise<Client[]>;
|
|
431
|
+
/** Get all clients with active integrations */
|
|
432
|
+
getWithActiveIntegrations(): Promise<Client[]>;
|
|
433
|
+
/** Preview a notification template */
|
|
434
|
+
previewNotification(type: string, clientId: number): Promise<string>;
|
|
211
435
|
/** Get a client by ID */
|
|
212
436
|
getById(id: number): Promise<Client>;
|
|
213
|
-
/**
|
|
437
|
+
/** Get a client by ID with minimal data */
|
|
438
|
+
getByIdMinimal(id: number): Promise<Client>;
|
|
439
|
+
/** Create a new client */
|
|
440
|
+
create(data: CreateClientRequest): Promise<Client>;
|
|
441
|
+
/** Full update a client (PUT) */
|
|
442
|
+
replace(id: number, data: Client): Promise<Client>;
|
|
443
|
+
/** Partial update a client (PATCH) */
|
|
214
444
|
update(id: number, data: UpdateClientRequest): Promise<Client>;
|
|
445
|
+
/** Get return reasons for a client */
|
|
446
|
+
getReturnReasons(clientId: number): Promise<unknown[]>;
|
|
447
|
+
/** Add a return reason to a client */
|
|
448
|
+
addReturnReason(clientId: number, returnReasonId: number): Promise<unknown>;
|
|
449
|
+
/** Update return reasons for a client */
|
|
450
|
+
updateReturnReasons(clientId: number, data: unknown): Promise<unknown>;
|
|
451
|
+
/** Remove a return reason from a client */
|
|
452
|
+
removeReturnReason(clientId: number, returnReasonId: number): Promise<void>;
|
|
215
453
|
/** Get courier services for a client */
|
|
216
454
|
getCourierServices(clientId: number): Promise<ClientCourierService[]>;
|
|
217
455
|
/** Get a specific courier service for a client */
|
|
218
456
|
getCourierServiceById(clientId: number, serviceId: number): Promise<ClientCourierService>;
|
|
457
|
+
/** Add a courier service for a client */
|
|
458
|
+
addCourierService(clientId: number, data: Partial<ClientCourierService>): Promise<ClientCourierService>;
|
|
219
459
|
/** Update a courier service for a client */
|
|
220
460
|
updateCourierService(clientId: number, service: Partial<ClientCourierService>): Promise<ClientCourierService>;
|
|
461
|
+
/** Delete a courier service from a client */
|
|
462
|
+
deleteCourierService(clientId: number, serviceId: number): Promise<boolean>;
|
|
463
|
+
/** Create an integration for a client */
|
|
464
|
+
createIntegration(clientId: number, data: CreateClientIntegrationRequest): Promise<unknown>;
|
|
221
465
|
/** Get order by reference for a client */
|
|
222
466
|
getOrderByRef(clientId: number, orderRef: string): Promise<unknown>;
|
|
223
|
-
/**
|
|
224
|
-
|
|
225
|
-
/** Remove a return reason from a client */
|
|
226
|
-
removeReturnReason(clientId: number, returnReasonId: number): Promise<void>;
|
|
467
|
+
/** Get files for a client */
|
|
468
|
+
getFiles(clientId: number): Promise<unknown>;
|
|
227
469
|
/** Upload a file for a client */
|
|
228
470
|
uploadFile(clientId: number, filename: string, data: UploadFileRequest): Promise<UploadFileResponse>;
|
|
471
|
+
/** Delete a file for a client */
|
|
472
|
+
deleteFile(clientId: number, filename: string): Promise<boolean>;
|
|
473
|
+
/** Get settings for a client */
|
|
474
|
+
getSettings(clientId: number): Promise<unknown>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Consignment Entity
|
|
479
|
+
*
|
|
480
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
481
|
+
*
|
|
482
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Consignment.ts
|
|
483
|
+
*/
|
|
484
|
+
export declare interface Consignment {
|
|
485
|
+
/** Primary key identifier for the consignment record. */
|
|
486
|
+
id: number;
|
|
487
|
+
/** Foreign key to the warehouse packer who processed this consignment. */
|
|
488
|
+
packerId?: number;
|
|
489
|
+
/** Foreign key to the parent dispatch this consignment belongs to. */
|
|
490
|
+
dispatchId?: number;
|
|
491
|
+
/** Foreign key to the shipping service used for this consignment. */
|
|
492
|
+
serviceId?: number;
|
|
493
|
+
/** Foreign key to the courier/carrier handling delivery. */
|
|
494
|
+
courierId?: number;
|
|
495
|
+
/** Client-facing reference code for the consignment. */
|
|
496
|
+
reference?: string;
|
|
497
|
+
/** Carrier tracking code for parcel tracking. */
|
|
498
|
+
trackingCode?: string;
|
|
499
|
+
/** Unique reference generated by the carrier for this consignment. */
|
|
500
|
+
uniqueReference?: string;
|
|
501
|
+
/** Raw consignment data or label reference returned by the carrier API. */
|
|
502
|
+
consignment?: string;
|
|
503
|
+
/** Cost centre code for internal accounting allocation. */
|
|
504
|
+
costCentre?: string;
|
|
505
|
+
/** Additional weight added to the consignment (e.g. packaging weight) in grams or kilograms. */
|
|
506
|
+
weightAdded?: number;
|
|
507
|
+
/** ISO 8601 date string when the consignment was dispatched. */
|
|
508
|
+
dispatchDate?: string;
|
|
509
|
+
/** Description of the consignment contents (used on customs labels). */
|
|
510
|
+
description?: string;
|
|
511
|
+
/** Internal notes or comments about the consignment. */
|
|
512
|
+
notes?: string;
|
|
513
|
+
/** Raw JSON string of the carrier API request payload used to create the consignment. */
|
|
514
|
+
request?: string;
|
|
515
|
+
/** Declared value of the consignment contents for customs/insurance purposes. */
|
|
516
|
+
value?: number;
|
|
517
|
+
/** Liability/insurance coverage amount for the consignment. */
|
|
518
|
+
liability?: number;
|
|
519
|
+
/** ISO 8601 date string when packing started. */
|
|
520
|
+
packStart?: string;
|
|
521
|
+
/** ISO 8601 date string when packing was completed. */
|
|
522
|
+
packEnd?: string;
|
|
523
|
+
/** Structured collection booking details (e.g. collection date, time window, depot address). */
|
|
524
|
+
collection?: Record<string, unknown>;
|
|
525
|
+
/** Reason for export as required on customs declarations (e.g. "sale", "gift", "sample", "return"). */
|
|
526
|
+
reasonForExport?: string;
|
|
527
|
+
/** ISO 8601 date string when the consignment record was created. */
|
|
528
|
+
created?: string;
|
|
529
|
+
/** ISO 8601 date string when the consignment record was last modified. */
|
|
530
|
+
modified?: string;
|
|
531
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
532
|
+
status?: number;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Consignment entity (legacy dispatch relationship)
|
|
537
|
+
*/
|
|
538
|
+
declare interface Consignment_2 {
|
|
539
|
+
id: number;
|
|
540
|
+
[key: string]: unknown;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Consignments resource interface
|
|
545
|
+
*/
|
|
546
|
+
export declare interface ConsignmentsResource {
|
|
547
|
+
/** Get consignments by dispatch ID (not paginated) */
|
|
548
|
+
getByDispatchId(dispatchId: number): Promise<Consignment[]>;
|
|
549
|
+
/** Create a new consignment */
|
|
550
|
+
create(data: CreateConsignmentRequest): Promise<Consignment>;
|
|
551
|
+
/** Update a consignment */
|
|
552
|
+
update(id: number, data: Partial<CreateConsignmentRequest>): Promise<Consignment>;
|
|
553
|
+
/** Delete a consignment */
|
|
554
|
+
delete(id: number): Promise<void>;
|
|
229
555
|
}
|
|
230
556
|
|
|
231
557
|
/**
|
|
@@ -242,6 +568,18 @@ export declare interface Courier extends BaseEntity {
|
|
|
242
568
|
active?: boolean;
|
|
243
569
|
}
|
|
244
570
|
|
|
571
|
+
/** Courier entity from the API */
|
|
572
|
+
export declare interface CourierEntity {
|
|
573
|
+
id: number;
|
|
574
|
+
name: string;
|
|
575
|
+
logo_url?: string;
|
|
576
|
+
location_url?: string;
|
|
577
|
+
status?: boolean;
|
|
578
|
+
courier_services?: CourierServiceEntity[];
|
|
579
|
+
created_ts?: string;
|
|
580
|
+
updated_ts?: string;
|
|
581
|
+
}
|
|
582
|
+
|
|
245
583
|
/**
|
|
246
584
|
* Courier Service Entity
|
|
247
585
|
*
|
|
@@ -264,6 +602,354 @@ export declare interface CourierService extends BaseEntity {
|
|
|
264
602
|
price?: number;
|
|
265
603
|
}
|
|
266
604
|
|
|
605
|
+
/** Courier service entity from the API */
|
|
606
|
+
export declare interface CourierServiceEntity {
|
|
607
|
+
id: number;
|
|
608
|
+
name: string;
|
|
609
|
+
courier_integration_name?: string;
|
|
610
|
+
courier_service_code?: string;
|
|
611
|
+
weight_min?: number;
|
|
612
|
+
weight_max?: number;
|
|
613
|
+
status?: boolean;
|
|
614
|
+
courier?: CourierEntity;
|
|
615
|
+
created_ts?: string;
|
|
616
|
+
updated_ts?: string;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Couriers resource interface
|
|
621
|
+
*/
|
|
622
|
+
export declare interface CouriersResource {
|
|
623
|
+
/** Get all couriers */
|
|
624
|
+
getAll(): Promise<CourierEntity[]>;
|
|
625
|
+
/** Get a courier by ID */
|
|
626
|
+
getById(id: number): Promise<CourierEntity>;
|
|
627
|
+
/** Create a new courier */
|
|
628
|
+
create(data: CreateCourierRequest): Promise<CourierEntity>;
|
|
629
|
+
/** Update a courier */
|
|
630
|
+
update(id: number, data: Partial<CreateCourierRequest>): Promise<CourierEntity>;
|
|
631
|
+
/** Get all services for a courier */
|
|
632
|
+
getServices(courierId: number): Promise<CourierServiceEntity[]>;
|
|
633
|
+
/** Get a specific service for a courier */
|
|
634
|
+
getServiceById(courierId: number, serviceId: number): Promise<CourierServiceEntity>;
|
|
635
|
+
/** Create a new service for a courier */
|
|
636
|
+
createService(courierId: number, data: CreateCourierServiceRequest): Promise<CourierServiceEntity>;
|
|
637
|
+
/** Update a courier service */
|
|
638
|
+
updateService(courierId: number, serviceId: number, data: Partial<CreateCourierServiceRequest>): Promise<CourierServiceEntity>;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Data for creating/updating an ASN line
|
|
643
|
+
*/
|
|
644
|
+
export declare interface CreateAsnLineRequest {
|
|
645
|
+
/** Client ID */
|
|
646
|
+
client_id: number;
|
|
647
|
+
/** ASN ID */
|
|
648
|
+
asn_id?: number;
|
|
649
|
+
/** Product ID */
|
|
650
|
+
product_id?: number;
|
|
651
|
+
/** SKU code */
|
|
652
|
+
sku_code: string;
|
|
653
|
+
/** Expected quantity */
|
|
654
|
+
expected_quantity: number;
|
|
655
|
+
/** Received quantity */
|
|
656
|
+
received_quantity?: number;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Data for bulk creating ASN lines
|
|
661
|
+
*/
|
|
662
|
+
export declare interface CreateAsnLinesBulkRequest {
|
|
663
|
+
/** Client ID */
|
|
664
|
+
client_id: number;
|
|
665
|
+
/** ASN ID */
|
|
666
|
+
asn_id: number;
|
|
667
|
+
/** Array of ASN lines to create */
|
|
668
|
+
asn_lines: Array<Omit<CreateAsnLineRequest, 'client_id' | 'asn_id'>>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Data for creating/updating an ASN receipt
|
|
673
|
+
*/
|
|
674
|
+
export declare interface CreateAsnReceiptRequest {
|
|
675
|
+
/** Client ID */
|
|
676
|
+
client_id: number;
|
|
677
|
+
/** ASN ID */
|
|
678
|
+
asn_id: number;
|
|
679
|
+
/** ASN line ID */
|
|
680
|
+
asn_line_id: number;
|
|
681
|
+
/** Received quantity */
|
|
682
|
+
received_quantity: number;
|
|
683
|
+
/** Stock status */
|
|
684
|
+
stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Data for creating/updating an ASN
|
|
689
|
+
*/
|
|
690
|
+
export declare interface CreateAsnRequest {
|
|
691
|
+
/** Client ID */
|
|
692
|
+
client_id: number;
|
|
693
|
+
/** ASN status */
|
|
694
|
+
asn_status?: 'draft' | 'awaiting_arrival' | 'arrived' | 'processing' | 'receipted' | 'receipted_with_discrepancies' | 'temporarily_receipted' | 'quarantined' | 'cancelled';
|
|
695
|
+
/** Expected arrival date (ISO string) */
|
|
696
|
+
expected_arrival_date?: string;
|
|
697
|
+
/** Total expected units */
|
|
698
|
+
total_expected_units?: number;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Data for client integration creation
|
|
703
|
+
*/
|
|
704
|
+
export declare interface CreateClientIntegrationRequest {
|
|
705
|
+
/** Client ID */
|
|
706
|
+
client_id: number;
|
|
707
|
+
/** Integration name */
|
|
708
|
+
integration_name: string;
|
|
709
|
+
/** Store ID */
|
|
710
|
+
store_id?: string;
|
|
711
|
+
/** Whether integration is active */
|
|
712
|
+
active?: boolean;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Data for creating a client
|
|
717
|
+
*/
|
|
718
|
+
export declare interface CreateClientRequest {
|
|
719
|
+
/** Client name */
|
|
720
|
+
name: string;
|
|
721
|
+
/** Short name */
|
|
722
|
+
short_name?: string;
|
|
723
|
+
/** Email */
|
|
724
|
+
email?: string;
|
|
725
|
+
/** Phone */
|
|
726
|
+
phone?: string;
|
|
727
|
+
/** Operational status */
|
|
728
|
+
operational_status?: string;
|
|
729
|
+
/** Settings object */
|
|
730
|
+
settings?: Record<string, unknown>;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Data for creating/updating a consignment
|
|
735
|
+
*/
|
|
736
|
+
export declare interface CreateConsignmentRequest {
|
|
737
|
+
/** Client ID */
|
|
738
|
+
client_id: number;
|
|
739
|
+
/** Dispatch ID */
|
|
740
|
+
dispatch_id: number;
|
|
741
|
+
/** Packer ID */
|
|
742
|
+
packer_id?: number;
|
|
743
|
+
/** Post service ID */
|
|
744
|
+
post_service_id?: number;
|
|
745
|
+
/** Courier ID */
|
|
746
|
+
courier_id?: number;
|
|
747
|
+
/** Reference */
|
|
748
|
+
reference?: string;
|
|
749
|
+
/** Tracking number */
|
|
750
|
+
tracking_number?: string;
|
|
751
|
+
/** Dispatch date (ISO string) */
|
|
752
|
+
dispatch_date?: string;
|
|
753
|
+
/** Description */
|
|
754
|
+
description?: string;
|
|
755
|
+
/** Notes */
|
|
756
|
+
notes?: string;
|
|
757
|
+
/** Request details */
|
|
758
|
+
request?: string;
|
|
759
|
+
/** Pack start time (ISO string) */
|
|
760
|
+
pack_start?: string;
|
|
761
|
+
/** Pack end time (ISO string) */
|
|
762
|
+
pack_end?: string;
|
|
763
|
+
/** Reason for export */
|
|
764
|
+
reason_for_export?: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Data for creating/updating a courier
|
|
769
|
+
*/
|
|
770
|
+
export declare interface CreateCourierRequest {
|
|
771
|
+
/** Courier name */
|
|
772
|
+
name: string;
|
|
773
|
+
/** Logo URL */
|
|
774
|
+
logo_url?: string;
|
|
775
|
+
/** Location URL */
|
|
776
|
+
location_url?: string;
|
|
777
|
+
/** Whether courier is active */
|
|
778
|
+
status?: boolean;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Data for creating/updating a courier service
|
|
783
|
+
*/
|
|
784
|
+
export declare interface CreateCourierServiceRequest {
|
|
785
|
+
/** Service name */
|
|
786
|
+
name: string;
|
|
787
|
+
/** Courier integration name */
|
|
788
|
+
courier_integration_name?: string;
|
|
789
|
+
/** Service code */
|
|
790
|
+
courier_service_code?: string;
|
|
791
|
+
/** Minimum weight */
|
|
792
|
+
weight_min?: number;
|
|
793
|
+
/** Maximum weight */
|
|
794
|
+
weight_max?: number;
|
|
795
|
+
/** Whether service is active */
|
|
796
|
+
status?: boolean;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Data for creating/updating a dispatch
|
|
801
|
+
*/
|
|
802
|
+
export declare interface CreateDispatchRequest {
|
|
803
|
+
/** Client ID */
|
|
804
|
+
client_id: number;
|
|
805
|
+
/** Order ID */
|
|
806
|
+
order_id: number;
|
|
807
|
+
/** Dispatch reference */
|
|
808
|
+
reference?: string;
|
|
809
|
+
/** Address ID */
|
|
810
|
+
address_id?: number;
|
|
811
|
+
/** Dispatch date (ISO string) */
|
|
812
|
+
dispatch_date?: string;
|
|
813
|
+
/** Post service ID */
|
|
814
|
+
post_service_id?: number;
|
|
815
|
+
/** Dispatch status */
|
|
816
|
+
dispatch_status?: number;
|
|
817
|
+
/** Release date */
|
|
818
|
+
release_date?: string;
|
|
819
|
+
/** Whether dispatch is on hold */
|
|
820
|
+
hold?: number;
|
|
821
|
+
/** Whether dispatch is draft */
|
|
822
|
+
draft?: number;
|
|
823
|
+
/** Dispatch issue flag */
|
|
824
|
+
dispatch_issue?: number;
|
|
825
|
+
/** Stock status */
|
|
826
|
+
stock_status?: number;
|
|
827
|
+
/** Reason for export */
|
|
828
|
+
reason_for_export?: string;
|
|
829
|
+
/** Notes */
|
|
830
|
+
notes?: string;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Data for creating/updating an integration
|
|
835
|
+
*/
|
|
836
|
+
export declare interface CreateIntegrationRequest {
|
|
837
|
+
/** Integration name */
|
|
838
|
+
name: string;
|
|
839
|
+
/** Display name */
|
|
840
|
+
display_name?: string;
|
|
841
|
+
/** Store ID */
|
|
842
|
+
store_id?: string;
|
|
843
|
+
/** Whether integration is active */
|
|
844
|
+
active?: boolean;
|
|
845
|
+
/** Client object with ID */
|
|
846
|
+
client?: {
|
|
847
|
+
id: number;
|
|
848
|
+
};
|
|
849
|
+
/** Country accept list */
|
|
850
|
+
country_accept?: string;
|
|
851
|
+
/** Country reject list */
|
|
852
|
+
country_reject?: string;
|
|
853
|
+
/** Order status sync */
|
|
854
|
+
order_status_sync?: boolean;
|
|
855
|
+
/** Product status sync */
|
|
856
|
+
product_status_sync?: boolean;
|
|
857
|
+
/** Returns active */
|
|
858
|
+
returns_active?: boolean;
|
|
859
|
+
/** Default warehouse ID */
|
|
860
|
+
default_warehouse_id?: string;
|
|
861
|
+
/** Sources */
|
|
862
|
+
sources?: string;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Data for creating/updating an invoice line
|
|
867
|
+
*/
|
|
868
|
+
export declare interface CreateInvoiceLineRequest {
|
|
869
|
+
/** Client ID */
|
|
870
|
+
client_id: number;
|
|
871
|
+
/** Invoice ID */
|
|
872
|
+
invoice_id?: number;
|
|
873
|
+
/** Class ID */
|
|
874
|
+
class_id?: number;
|
|
875
|
+
/** Object ID */
|
|
876
|
+
object_id?: number;
|
|
877
|
+
/** Reference */
|
|
878
|
+
reference: string;
|
|
879
|
+
/** Description */
|
|
880
|
+
description?: string;
|
|
881
|
+
/** Dispatch date (ISO string) */
|
|
882
|
+
dispatch_date?: string;
|
|
883
|
+
/** Service name */
|
|
884
|
+
service_name?: string;
|
|
885
|
+
/** Service fee ID */
|
|
886
|
+
service_fee_id?: number;
|
|
887
|
+
/** Price */
|
|
888
|
+
price?: number;
|
|
889
|
+
/** Discount rate */
|
|
890
|
+
discount_rate?: number;
|
|
891
|
+
/** Postcode */
|
|
892
|
+
postcode?: string;
|
|
893
|
+
/** Country code */
|
|
894
|
+
country_code?: string;
|
|
895
|
+
/** Tax class */
|
|
896
|
+
tax_class?: number;
|
|
897
|
+
/** Consignment price */
|
|
898
|
+
consignment_price?: number;
|
|
899
|
+
/** Fuel charge */
|
|
900
|
+
fuel?: number;
|
|
901
|
+
/** Packaging price */
|
|
902
|
+
packaging_price?: number;
|
|
903
|
+
/** Discount amount */
|
|
904
|
+
discount?: number;
|
|
905
|
+
/** Number of lines */
|
|
906
|
+
lines?: number;
|
|
907
|
+
/** Number of picks */
|
|
908
|
+
picks?: number;
|
|
909
|
+
/** Weight */
|
|
910
|
+
weight?: number;
|
|
911
|
+
/** Margin charged */
|
|
912
|
+
margin_charged?: number;
|
|
913
|
+
/** Total override */
|
|
914
|
+
total_override?: number;
|
|
915
|
+
/** Status */
|
|
916
|
+
status?: number;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Data for bulk creating invoice lines
|
|
921
|
+
*/
|
|
922
|
+
export declare interface CreateInvoiceLinesBulkRequest {
|
|
923
|
+
/** Client ID */
|
|
924
|
+
client_id: number;
|
|
925
|
+
/** Invoice ID */
|
|
926
|
+
invoice_id: number;
|
|
927
|
+
/** Array of invoice lines to create */
|
|
928
|
+
invoice_lines: Array<Omit<CreateInvoiceLineRequest, 'client_id' | 'invoice_id'>>;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Data for creating/updating an invoice
|
|
933
|
+
*/
|
|
934
|
+
export declare interface CreateInvoiceRequest {
|
|
935
|
+
/** Client ID */
|
|
936
|
+
client_id: number;
|
|
937
|
+
/** Invoice date (ISO string) */
|
|
938
|
+
invoice_date: string;
|
|
939
|
+
/** Xero reference */
|
|
940
|
+
xero_reference?: string;
|
|
941
|
+
/** Total amount */
|
|
942
|
+
total?: number;
|
|
943
|
+
/** Whether invoice has been emailed */
|
|
944
|
+
emailed?: number;
|
|
945
|
+
/** Whether invoice has been paid */
|
|
946
|
+
paid?: number;
|
|
947
|
+
/** Fuel mode */
|
|
948
|
+
fuel_mode?: number;
|
|
949
|
+
/** Status */
|
|
950
|
+
status?: number;
|
|
951
|
+
}
|
|
952
|
+
|
|
267
953
|
/**
|
|
268
954
|
* Create a JANUS API client.
|
|
269
955
|
*
|
|
@@ -307,6 +993,186 @@ export declare interface CourierService extends BaseEntity {
|
|
|
307
993
|
*/
|
|
308
994
|
export declare function createJanusApi(options?: JanusApiOptions): JanusApi;
|
|
309
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Data for creating/updating a location
|
|
998
|
+
*/
|
|
999
|
+
export declare interface CreateLocationRequest {
|
|
1000
|
+
/** Client ID */
|
|
1001
|
+
client_id: number;
|
|
1002
|
+
/** Location code */
|
|
1003
|
+
location_code: string;
|
|
1004
|
+
/** Location type */
|
|
1005
|
+
location_type?: 'pick' | 'bulk' | 'staging' | 'receiving' | 'shipping' | 'quarantine' | 'returns';
|
|
1006
|
+
/** Zone */
|
|
1007
|
+
zone?: string;
|
|
1008
|
+
/** Aisle */
|
|
1009
|
+
aisle?: string;
|
|
1010
|
+
/** Bay */
|
|
1011
|
+
bay?: string;
|
|
1012
|
+
/** Level */
|
|
1013
|
+
level?: string;
|
|
1014
|
+
/** Position */
|
|
1015
|
+
position?: string;
|
|
1016
|
+
/** Fulfilment location ID */
|
|
1017
|
+
fulfilment_location_id?: number;
|
|
1018
|
+
/** Fulfilment location name */
|
|
1019
|
+
fulfilment_location_name?: string;
|
|
1020
|
+
/** Current units stored */
|
|
1021
|
+
current_units?: number;
|
|
1022
|
+
/** Maximum unit capacity */
|
|
1023
|
+
max_capacity_units?: number;
|
|
1024
|
+
/** Maximum weight capacity in kg */
|
|
1025
|
+
max_capacity_weight_kg?: number;
|
|
1026
|
+
/** Whether mixed SKUs are allowed */
|
|
1027
|
+
is_mixed_sku_allowed?: number;
|
|
1028
|
+
/** Whether location is active */
|
|
1029
|
+
is_active?: number;
|
|
1030
|
+
/** Whether location is pickable */
|
|
1031
|
+
is_pickable?: number;
|
|
1032
|
+
/** Whether location can receive stock */
|
|
1033
|
+
is_receivable?: number;
|
|
1034
|
+
/** Temperature zone */
|
|
1035
|
+
temperature_zone?: 'ambient' | 'chilled' | 'frozen';
|
|
1036
|
+
/** Notes */
|
|
1037
|
+
notes?: string;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Data for creating an order
|
|
1042
|
+
*/
|
|
1043
|
+
export declare interface CreateOrderRequest {
|
|
1044
|
+
/** Client ID */
|
|
1045
|
+
client_id: number;
|
|
1046
|
+
/** External order reference */
|
|
1047
|
+
reference?: string;
|
|
1048
|
+
/** External order ID */
|
|
1049
|
+
external_order_id?: string;
|
|
1050
|
+
/** Channel order ID */
|
|
1051
|
+
channel_order_id?: string;
|
|
1052
|
+
/** Transaction type */
|
|
1053
|
+
transaction_type: string;
|
|
1054
|
+
/** Sales channel */
|
|
1055
|
+
channel?: string;
|
|
1056
|
+
/** Delivery address ID */
|
|
1057
|
+
delivery_address_id?: number;
|
|
1058
|
+
/** Billing address ID */
|
|
1059
|
+
billing_address_id?: number;
|
|
1060
|
+
/** Order date (ISO string) */
|
|
1061
|
+
order_date?: string;
|
|
1062
|
+
/** Release date */
|
|
1063
|
+
release_date?: string;
|
|
1064
|
+
/** Post service ID */
|
|
1065
|
+
post_service_id?: number;
|
|
1066
|
+
/** Order status */
|
|
1067
|
+
order_status?: number;
|
|
1068
|
+
/** Notes */
|
|
1069
|
+
notes?: string;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Data for creating/updating a product category
|
|
1074
|
+
*/
|
|
1075
|
+
export declare interface CreateProductCategoryRequest {
|
|
1076
|
+
/** Client ID */
|
|
1077
|
+
client_id: number;
|
|
1078
|
+
/** Category name */
|
|
1079
|
+
category_name: string;
|
|
1080
|
+
/** Description */
|
|
1081
|
+
description?: string;
|
|
1082
|
+
/** Parent category ID */
|
|
1083
|
+
parent_category_id?: number;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Data for creating/updating a product via the v2 `/products` endpoint
|
|
1088
|
+
*/
|
|
1089
|
+
export declare interface CreateProductRequest {
|
|
1090
|
+
/** Client ID (Janus internal ID) */
|
|
1091
|
+
client_id: number;
|
|
1092
|
+
/** Product SKU code */
|
|
1093
|
+
sku_code: string;
|
|
1094
|
+
/** Product name */
|
|
1095
|
+
product_name: string;
|
|
1096
|
+
/** Product description */
|
|
1097
|
+
description: string;
|
|
1098
|
+
/** Additional SKU codes */
|
|
1099
|
+
additional_skus?: string;
|
|
1100
|
+
/** Amazon ASINs */
|
|
1101
|
+
asins?: string;
|
|
1102
|
+
/** Custom fields */
|
|
1103
|
+
custom_fields?: Record<string, unknown>;
|
|
1104
|
+
/** HS/commodity code */
|
|
1105
|
+
hs_code?: string;
|
|
1106
|
+
/** Unit of measure */
|
|
1107
|
+
unit_of_measure?: string;
|
|
1108
|
+
/** Eaches per pack */
|
|
1109
|
+
eaches_per_pack?: number;
|
|
1110
|
+
/** Case pack SKU code */
|
|
1111
|
+
case_pack_sku_code?: string;
|
|
1112
|
+
/** Weight in grams */
|
|
1113
|
+
weight_grams?: number;
|
|
1114
|
+
/** Barcode */
|
|
1115
|
+
barcode?: string;
|
|
1116
|
+
/** Case pack barcode */
|
|
1117
|
+
case_pack_barcode?: string;
|
|
1118
|
+
/** Product category ID */
|
|
1119
|
+
product_category_id?: number;
|
|
1120
|
+
/** Product type */
|
|
1121
|
+
product_type?: 'sellable_unit' | 'packaging' | 'component' | 'consumables';
|
|
1122
|
+
/** Sellable format */
|
|
1123
|
+
sellable_format?: 'single' | 'case_pack' | 'bundle';
|
|
1124
|
+
/** Commodity description */
|
|
1125
|
+
commodity_description?: string;
|
|
1126
|
+
/** Price/value */
|
|
1127
|
+
price?: number;
|
|
1128
|
+
/** Currency code */
|
|
1129
|
+
currency?: string;
|
|
1130
|
+
/** Quantity */
|
|
1131
|
+
quantity?: number;
|
|
1132
|
+
/** Country of origin (2-letter code) */
|
|
1133
|
+
country_of_origin?: string;
|
|
1134
|
+
/** Primary material */
|
|
1135
|
+
primary_material?: string;
|
|
1136
|
+
/** Secondary material */
|
|
1137
|
+
secondary_material?: string;
|
|
1138
|
+
/** Dangerous goods classification */
|
|
1139
|
+
dangerous_goods?: string;
|
|
1140
|
+
/** Export control classification */
|
|
1141
|
+
eccn?: string;
|
|
1142
|
+
/** Bundle components */
|
|
1143
|
+
bundle_components?: string;
|
|
1144
|
+
/** Whether product is composite */
|
|
1145
|
+
composite?: number;
|
|
1146
|
+
/** Image URL */
|
|
1147
|
+
image_url?: string;
|
|
1148
|
+
/** Low stock threshold */
|
|
1149
|
+
low_stock_threshold?: number;
|
|
1150
|
+
/** Requires batch tracking */
|
|
1151
|
+
requires_batch_tracking?: number;
|
|
1152
|
+
/** Requires serial tracking */
|
|
1153
|
+
requires_serial_tracking?: number;
|
|
1154
|
+
/** Requires best-before tracking */
|
|
1155
|
+
requires_bbe_tracking?: number;
|
|
1156
|
+
/** FEFO/FIFO override */
|
|
1157
|
+
fefo_fifo_override?: number;
|
|
1158
|
+
/** Whether product is a bundle */
|
|
1159
|
+
is_bundle?: number;
|
|
1160
|
+
/** Default stock status */
|
|
1161
|
+
default_stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged';
|
|
1162
|
+
/** Product status */
|
|
1163
|
+
product_status?: 'active' | 'pre_active' | 'discontinued' | 'inactive' | 'archived';
|
|
1164
|
+
/** Record status */
|
|
1165
|
+
status?: number;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Data for creating/updating a return category
|
|
1170
|
+
*/
|
|
1171
|
+
export declare interface CreateReturnCategoryRequest {
|
|
1172
|
+
/** Category name */
|
|
1173
|
+
category_name: string;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
310
1176
|
/**
|
|
311
1177
|
* Data for a return item in create request
|
|
312
1178
|
*/
|
|
@@ -325,6 +1191,18 @@ export declare interface CreateReturnItemRequest {
|
|
|
325
1191
|
price_paid?: number;
|
|
326
1192
|
}
|
|
327
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* Data for creating/updating a return reason
|
|
1196
|
+
*/
|
|
1197
|
+
export declare interface CreateReturnReasonRequest {
|
|
1198
|
+
/** Reason name */
|
|
1199
|
+
name: string;
|
|
1200
|
+
/** Category ID */
|
|
1201
|
+
category_id?: number;
|
|
1202
|
+
/** Whether reason is active */
|
|
1203
|
+
active?: boolean;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
328
1206
|
/**
|
|
329
1207
|
* Request Types for API Operations
|
|
330
1208
|
* @module types/requests
|
|
@@ -367,6 +1245,144 @@ export declare interface CreateReturnRequest {
|
|
|
367
1245
|
items?: CreateReturnItemRequest[];
|
|
368
1246
|
}
|
|
369
1247
|
|
|
1248
|
+
/**
|
|
1249
|
+
* Data for creating/updating a return source
|
|
1250
|
+
*/
|
|
1251
|
+
export declare interface CreateReturnSourceRequest {
|
|
1252
|
+
/** Source alias */
|
|
1253
|
+
alias: string;
|
|
1254
|
+
/** Whether source is active */
|
|
1255
|
+
status?: boolean;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Data for creating/updating a return status
|
|
1260
|
+
*/
|
|
1261
|
+
export declare interface CreateReturnStatusRequest {
|
|
1262
|
+
/** Status name */
|
|
1263
|
+
name: string;
|
|
1264
|
+
/** Display color */
|
|
1265
|
+
color?: string;
|
|
1266
|
+
/** Sort order */
|
|
1267
|
+
sort_order?: number;
|
|
1268
|
+
/** Whether this is a final status */
|
|
1269
|
+
is_final?: boolean;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Data for creating/updating a stock allocation
|
|
1274
|
+
*/
|
|
1275
|
+
export declare interface CreateStockAllocationRequest {
|
|
1276
|
+
/** Client ID */
|
|
1277
|
+
client_id: number;
|
|
1278
|
+
/** Order ID */
|
|
1279
|
+
order_id: number;
|
|
1280
|
+
/** SKU code */
|
|
1281
|
+
sku_code?: string;
|
|
1282
|
+
/** Total quantity to allocate */
|
|
1283
|
+
total_quantity: number;
|
|
1284
|
+
/** Allocated stock details */
|
|
1285
|
+
allocated_stock?: Record<string, unknown>;
|
|
1286
|
+
/** Reserve until date (ISO string) */
|
|
1287
|
+
reserved_until?: string;
|
|
1288
|
+
/** Nominated release date (ISO string) */
|
|
1289
|
+
nominated_release_date?: string;
|
|
1290
|
+
/** Allocation type */
|
|
1291
|
+
allocation_type?: 'immediate' | 'future';
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Data for creating/updating a stock record
|
|
1296
|
+
*/
|
|
1297
|
+
export declare interface CreateStockRequest {
|
|
1298
|
+
/** Client ID */
|
|
1299
|
+
client_id: number;
|
|
1300
|
+
/** SKU code */
|
|
1301
|
+
sku_code: string;
|
|
1302
|
+
/** Storage location */
|
|
1303
|
+
location?: string;
|
|
1304
|
+
/** Quantity */
|
|
1305
|
+
quantity: number;
|
|
1306
|
+
/** Batch number */
|
|
1307
|
+
batch_number?: string;
|
|
1308
|
+
/** Serial number */
|
|
1309
|
+
serial_number?: string;
|
|
1310
|
+
/** Best before date (ISO string) */
|
|
1311
|
+
best_before_date?: string;
|
|
1312
|
+
/** Received date (ISO string) */
|
|
1313
|
+
received_date?: string;
|
|
1314
|
+
/** Stock status */
|
|
1315
|
+
stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
1316
|
+
/** Fulfilment location ID */
|
|
1317
|
+
fulfilment_location_id?: number;
|
|
1318
|
+
/** Fulfilment location name */
|
|
1319
|
+
fulfilment_location_name?: string;
|
|
1320
|
+
/** Fulfilment location country */
|
|
1321
|
+
fulfilment_location_country?: string;
|
|
1322
|
+
/** Notes */
|
|
1323
|
+
notes?: string;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Data for creating/updating a stock transaction
|
|
1328
|
+
*/
|
|
1329
|
+
export declare interface CreateStockTransactionRequest {
|
|
1330
|
+
/** Client ID */
|
|
1331
|
+
client_id: number;
|
|
1332
|
+
/** Transaction type */
|
|
1333
|
+
transaction_type: 'goods_in' | 'goods_out' | 'adjustment' | 'transfer' | 'return' | 'damage' | 'expiry';
|
|
1334
|
+
/** Stock record ID */
|
|
1335
|
+
stock_id: number;
|
|
1336
|
+
/** SKU code */
|
|
1337
|
+
sku_code?: string;
|
|
1338
|
+
/** Quantity */
|
|
1339
|
+
quantity: number;
|
|
1340
|
+
/** Quantity before transaction */
|
|
1341
|
+
quantity_before?: number;
|
|
1342
|
+
/** Quantity after transaction */
|
|
1343
|
+
quantity_after?: number;
|
|
1344
|
+
/** Location moved from */
|
|
1345
|
+
location_from?: string;
|
|
1346
|
+
/** Location moved to */
|
|
1347
|
+
location_to?: string;
|
|
1348
|
+
/** Batch number */
|
|
1349
|
+
batch_number?: string;
|
|
1350
|
+
/** Serial number */
|
|
1351
|
+
serial_number?: string;
|
|
1352
|
+
/** Reason code */
|
|
1353
|
+
reason_code?: string;
|
|
1354
|
+
/** Reason description */
|
|
1355
|
+
reason_description?: string;
|
|
1356
|
+
/** External reference number */
|
|
1357
|
+
reference_number?: string;
|
|
1358
|
+
/** Price in GBP */
|
|
1359
|
+
price_gbp?: number;
|
|
1360
|
+
/** IMS validation ID */
|
|
1361
|
+
ims_validation_id?: number;
|
|
1362
|
+
/** Source system */
|
|
1363
|
+
source_system?: 'ims_ui' | 'ims_api' | 'mobile_app' | 'asn' | 'oms' | 'cycle_count';
|
|
1364
|
+
/** User who performed the transaction */
|
|
1365
|
+
performed_by?: number;
|
|
1366
|
+
/** Notes */
|
|
1367
|
+
notes?: string;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* Data for creating a user
|
|
1372
|
+
*/
|
|
1373
|
+
export declare interface CreateUserRequest {
|
|
1374
|
+
/** Username */
|
|
1375
|
+
username: string;
|
|
1376
|
+
/** Password */
|
|
1377
|
+
password: string;
|
|
1378
|
+
/** First name */
|
|
1379
|
+
firstname?: string;
|
|
1380
|
+
/** Last name */
|
|
1381
|
+
lastname?: string;
|
|
1382
|
+
/** Partition ID */
|
|
1383
|
+
partition_id?: number;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
370
1386
|
/**
|
|
371
1387
|
* Customer login response
|
|
372
1388
|
*/
|
|
@@ -383,6 +1399,32 @@ export declare interface CustomerLoginResponse {
|
|
|
383
1399
|
error?: string;
|
|
384
1400
|
}
|
|
385
1401
|
|
|
1402
|
+
/**
|
|
1403
|
+
* Customer resource interface (no auth required)
|
|
1404
|
+
*/
|
|
1405
|
+
export declare interface CustomerResource {
|
|
1406
|
+
/** Login and track an order by ref, postcode, and client ID */
|
|
1407
|
+
tracking(orderRef: string, postcode: string, clientId: number): Promise<unknown>;
|
|
1408
|
+
/** Track an order by reference */
|
|
1409
|
+
track(ref: string): Promise<unknown>;
|
|
1410
|
+
/** Customer login */
|
|
1411
|
+
login(data: CustomerTrackingLoginRequest): Promise<CustomerLoginResponse>;
|
|
1412
|
+
/** View email notification by reference */
|
|
1413
|
+
viewEmail(ref: string): Promise<string>;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Customer tracking login request
|
|
1418
|
+
*/
|
|
1419
|
+
export declare interface CustomerTrackingLoginRequest {
|
|
1420
|
+
/** Order reference */
|
|
1421
|
+
order_ref: string;
|
|
1422
|
+
/** Postcode */
|
|
1423
|
+
postcode: string;
|
|
1424
|
+
/** Client ID */
|
|
1425
|
+
client_id: number;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
386
1428
|
/**
|
|
387
1429
|
* Date range filter
|
|
388
1430
|
*/
|
|
@@ -398,6 +1440,30 @@ export declare interface DateRangeFilter {
|
|
|
398
1440
|
*/
|
|
399
1441
|
export declare const DEFAULT_JANUS_URL = "https://api.janus.pelygo.com";
|
|
400
1442
|
|
|
1443
|
+
/**
|
|
1444
|
+
* Filters for dispatches
|
|
1445
|
+
*/
|
|
1446
|
+
export declare interface DispatchesFilters extends ClientScopedPaginatedQueryFilters {
|
|
1447
|
+
/** Filter by order ID */
|
|
1448
|
+
orderId?: number;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Dispatches resource interface
|
|
1453
|
+
*/
|
|
1454
|
+
export declare interface DispatchesResource {
|
|
1455
|
+
/** Get all dispatches with optional filters */
|
|
1456
|
+
getAll(filters?: DispatchesFilters): Promise<PaginatedListResponse<LegacyDispatch>>;
|
|
1457
|
+
/** Get a dispatch by ID */
|
|
1458
|
+
getById(id: number): Promise<LegacyDispatch>;
|
|
1459
|
+
/** Create a new dispatch */
|
|
1460
|
+
create(data: CreateDispatchRequest): Promise<LegacyDispatch>;
|
|
1461
|
+
/** Update a dispatch */
|
|
1462
|
+
update(id: number, data: Partial<CreateDispatchRequest>): Promise<LegacyDispatch>;
|
|
1463
|
+
/** Delete a dispatch */
|
|
1464
|
+
delete(id: number): Promise<void>;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
401
1467
|
/**
|
|
402
1468
|
* Generic filter object type
|
|
403
1469
|
*/
|
|
@@ -443,6 +1509,94 @@ export declare class ForbiddenError extends JanusApiError {
|
|
|
443
1509
|
constructor(message?: string, response?: unknown);
|
|
444
1510
|
}
|
|
445
1511
|
|
|
1512
|
+
/**
|
|
1513
|
+
* FormattedProduct — response shape from the `GET /products` endpoint.
|
|
1514
|
+
*
|
|
1515
|
+
* The v2 products endpoint returns formatted field names that differ
|
|
1516
|
+
* from the raw `LegacyProduct` entity (e.g. `sku_code` instead of `sku`,
|
|
1517
|
+
* `product_name` instead of `name`, `price` instead of `value`).
|
|
1518
|
+
*/
|
|
1519
|
+
export declare interface FormattedProduct {
|
|
1520
|
+
/** Primary key identifier for the product. */
|
|
1521
|
+
product_id: number;
|
|
1522
|
+
/** Foreign key to the client that owns this product. */
|
|
1523
|
+
client_id: number;
|
|
1524
|
+
/** Stock Keeping Unit code — unique product identifier within the client. */
|
|
1525
|
+
sku_code?: string;
|
|
1526
|
+
/** Human-readable product name. */
|
|
1527
|
+
product_name?: string;
|
|
1528
|
+
/** Extended product description. */
|
|
1529
|
+
description?: string;
|
|
1530
|
+
/** Comma-separated list of alternative SKU codes for this product. */
|
|
1531
|
+
additional_skus?: string;
|
|
1532
|
+
/** Amazon Standard Identification Numbers associated with this product. */
|
|
1533
|
+
asins?: string;
|
|
1534
|
+
/** Client-defined custom fields as key-value pairs. */
|
|
1535
|
+
custom_fields?: Record<string, unknown>;
|
|
1536
|
+
/** Harmonized System code for customs classification (e.g. "6204.62"). */
|
|
1537
|
+
hs_code?: string;
|
|
1538
|
+
/** Unit of measure for the product (e.g. "each", "kg", "litre"). */
|
|
1539
|
+
unit_of_measure?: string;
|
|
1540
|
+
/** Number of individual units (eaches) contained in one case pack. */
|
|
1541
|
+
eaches_per_pack?: number;
|
|
1542
|
+
/** SKU code of the case pack product that contains this item. */
|
|
1543
|
+
case_pack_sku_code?: string;
|
|
1544
|
+
/** Weight of a single unit in grams. */
|
|
1545
|
+
weight_grams?: number;
|
|
1546
|
+
/** Primary barcode (EAN/UPC) for the product. */
|
|
1547
|
+
barcode?: string;
|
|
1548
|
+
/** Barcode for the case pack version of this product. */
|
|
1549
|
+
case_pack_barcode?: string;
|
|
1550
|
+
/** Foreign key to the product category for grouping/reporting. */
|
|
1551
|
+
product_category_id?: number;
|
|
1552
|
+
/** Product type classification (e.g. "physical", "digital", "service"). */
|
|
1553
|
+
product_type?: string;
|
|
1554
|
+
/** How the product is sold (e.g. "single", "pack", "case"). */
|
|
1555
|
+
sellable_format?: string;
|
|
1556
|
+
/** Description of the commodity for customs declarations. */
|
|
1557
|
+
commodity_description?: string;
|
|
1558
|
+
/** Unit sale price in the client's default currency. */
|
|
1559
|
+
price?: number;
|
|
1560
|
+
/** ISO 4217 currency code for the price (e.g. "GBP", "USD"). */
|
|
1561
|
+
currency?: string;
|
|
1562
|
+
/** ISO 3166-1 alpha-2 country of origin code for customs (e.g. "CN", "GB"). */
|
|
1563
|
+
country_of_origin?: string;
|
|
1564
|
+
/** Primary material composition of the product (e.g. "cotton", "polyester"). */
|
|
1565
|
+
primary_material?: string;
|
|
1566
|
+
/** Secondary material composition of the product. */
|
|
1567
|
+
secondary_material?: string;
|
|
1568
|
+
/** Dangerous goods classification code (e.g. UN number, hazmat class). Null if not hazardous. */
|
|
1569
|
+
dangerous_goods?: string;
|
|
1570
|
+
/** Export Control Classification Number for trade compliance. */
|
|
1571
|
+
eccn?: string;
|
|
1572
|
+
/** JSON or delimited string describing the component SKUs and quantities in a bundle. */
|
|
1573
|
+
bundle_components?: string;
|
|
1574
|
+
/** URL to the product image. */
|
|
1575
|
+
image_url?: string;
|
|
1576
|
+
/** Stock quantity threshold that triggers a low-stock alert. */
|
|
1577
|
+
low_stock_threshold?: number;
|
|
1578
|
+
/** Whether batch/lot tracking is required. 0 = disabled, 1 = enabled. */
|
|
1579
|
+
requires_batch_tracking?: number;
|
|
1580
|
+
/** Whether serial number tracking is required. 0 = disabled, 1 = enabled. */
|
|
1581
|
+
requires_serial_tracking?: number;
|
|
1582
|
+
/** Whether best-before/expiry date tracking is required. 0 = disabled, 1 = enabled. */
|
|
1583
|
+
requires_bbe_tracking?: number;
|
|
1584
|
+
/** Override for FEFO/FIFO stock rotation rules. 0 = use default (FEFO), 1 = override to FIFO. */
|
|
1585
|
+
fefo_fifo_override?: number;
|
|
1586
|
+
/** Whether this product is a bundle of other products. 0 = standalone product, 1 = bundle. */
|
|
1587
|
+
is_bundle?: number;
|
|
1588
|
+
/** Default status assigned to stock when received (e.g. "available", "quarantined"). */
|
|
1589
|
+
default_stock_status?: string;
|
|
1590
|
+
/** Current product lifecycle status (e.g. "active", "discontinued", "pending_setup"). */
|
|
1591
|
+
product_status?: string;
|
|
1592
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1593
|
+
status?: number;
|
|
1594
|
+
/** ISO 8601 date string when the product was created. */
|
|
1595
|
+
created_date?: string;
|
|
1596
|
+
/** ISO 8601 date string when the product was last updated. */
|
|
1597
|
+
updated_date?: string;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
446
1600
|
/**
|
|
447
1601
|
* Helpers resource interface (no auth required)
|
|
448
1602
|
*/
|
|
@@ -456,64 +1610,758 @@ export declare interface HelpersResource {
|
|
|
456
1610
|
}
|
|
457
1611
|
|
|
458
1612
|
/**
|
|
459
|
-
*
|
|
1613
|
+
* HTTP query for legacy endpoints (products, orders, etc.).
|
|
1614
|
+
*
|
|
1615
|
+
* **Important — Client ID mapping:**
|
|
1616
|
+
* Legacy tables use `customer_id`, which is the `Client.remote_client_id` value —
|
|
1617
|
+
* NOT `Client.id` (the Janus internal ID). For admin users (`partition_id = 0`),
|
|
1618
|
+
* the server does not auto-filter by client, so you must include a filter like:
|
|
1619
|
+
*
|
|
1620
|
+
* ```ts
|
|
1621
|
+
* { query_name: 'products.customer_id', query_type: '=', query_value: client.remote_client_id }
|
|
1622
|
+
* ```
|
|
1623
|
+
*
|
|
1624
|
+
* For non-admin users the server adds this filter automatically.
|
|
1625
|
+
*/
|
|
1626
|
+
export declare interface HttpQueryRequest {
|
|
1627
|
+
/** Query conditions */
|
|
1628
|
+
query: Array<{
|
|
1629
|
+
query_name: string;
|
|
1630
|
+
query_type: string | number;
|
|
1631
|
+
query_value: string | number;
|
|
1632
|
+
}>;
|
|
1633
|
+
/** Result limit */
|
|
1634
|
+
limit?: number;
|
|
1635
|
+
/** Result offset */
|
|
1636
|
+
offset?: number;
|
|
1637
|
+
/** Include child records */
|
|
1638
|
+
include_children?: boolean;
|
|
1639
|
+
/** Short results */
|
|
1640
|
+
short_results?: boolean;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
/** Integration entity from the API (uses generated IntegrationStandard) */
|
|
1644
|
+
export declare interface IntegrationEntity {
|
|
1645
|
+
id: number;
|
|
1646
|
+
name: string;
|
|
1647
|
+
display_name?: string;
|
|
1648
|
+
store_id?: string;
|
|
1649
|
+
active?: boolean;
|
|
1650
|
+
client?: {
|
|
1651
|
+
id: number;
|
|
1652
|
+
name?: string;
|
|
1653
|
+
};
|
|
1654
|
+
country_accept?: string;
|
|
1655
|
+
country_reject?: string;
|
|
1656
|
+
order_status_sync?: boolean;
|
|
1657
|
+
product_status_sync?: boolean;
|
|
1658
|
+
returns_active?: boolean;
|
|
1659
|
+
default_warehouse_id?: string;
|
|
1660
|
+
sources?: string;
|
|
1661
|
+
last_run?: number;
|
|
1662
|
+
created_ts?: string;
|
|
1663
|
+
updated_ts?: string;
|
|
1664
|
+
[key: string]: unknown;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* Integrations resource interface
|
|
1669
|
+
*/
|
|
1670
|
+
export declare interface IntegrationsResource {
|
|
1671
|
+
/** Get all integrations */
|
|
1672
|
+
getAll(): Promise<IntegrationEntity[]>;
|
|
1673
|
+
/** Get integrations by client ID */
|
|
1674
|
+
getByClientId(clientId: number): Promise<IntegrationEntity[]>;
|
|
1675
|
+
/** Get a specific integration by customer ID and name */
|
|
1676
|
+
getByCustomerAndName(customerId: number, integrationName: string): Promise<IntegrationEntity>;
|
|
1677
|
+
/** Get all active integrations */
|
|
1678
|
+
getActive(): Promise<IntegrationEntity[]>;
|
|
1679
|
+
/** Get active integration names only */
|
|
1680
|
+
getNamesOnly(): Promise<string[]>;
|
|
1681
|
+
/** Create a new integration */
|
|
1682
|
+
create(data: CreateIntegrationRequest): Promise<IntegrationEntity>;
|
|
1683
|
+
/** Update an integration */
|
|
1684
|
+
update(id: number, data: Partial<CreateIntegrationRequest>): Promise<IntegrationEntity>;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Invoice Entity
|
|
1689
|
+
*
|
|
1690
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1691
|
+
*
|
|
1692
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/invoices/invoice.entity.ts
|
|
1693
|
+
*/
|
|
1694
|
+
export declare interface Invoice extends BaseEntity_2 {
|
|
1695
|
+
/** Foreign key to the client this invoice belongs to. */
|
|
1696
|
+
clientId?: number;
|
|
1697
|
+
/** ISO 8601 date string for the invoice issue date. */
|
|
1698
|
+
invoice_date: string;
|
|
1699
|
+
/** External reference ID from Xero accounting integration. */
|
|
1700
|
+
xero_reference?: string;
|
|
1701
|
+
/** Total invoice amount in the billing currency. */
|
|
1702
|
+
total?: number;
|
|
1703
|
+
/** Whether the invoice has been emailed to the client. 0 = not emailed, 1 = emailed. */
|
|
1704
|
+
emailed?: number;
|
|
1705
|
+
/** Whether the invoice has been marked as paid. 0 = unpaid, 1 = paid. */
|
|
1706
|
+
paid?: number;
|
|
1707
|
+
/** Fuel surcharge calculation mode. 0 = flat rate, 1 = percentage-based. */
|
|
1708
|
+
fuel_mode?: number;
|
|
1709
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1710
|
+
status?: number;
|
|
1711
|
+
/** OneToMany relationship to InvoiceLine */
|
|
1712
|
+
invoiceLines?: InvoiceLine[];
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* InvoiceLine Entity
|
|
1717
|
+
*
|
|
1718
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1719
|
+
*
|
|
1720
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/invoices/line.entity.ts
|
|
1721
|
+
*/
|
|
1722
|
+
export declare interface InvoiceLine extends BaseEntity_2 {
|
|
1723
|
+
/** Foreign key to the parent invoice this line belongs to. */
|
|
1724
|
+
invoice_id?: number;
|
|
1725
|
+
/** Classification ID grouping this line item (e.g. storage, fulfilment, shipping). */
|
|
1726
|
+
class_id?: number;
|
|
1727
|
+
/** Foreign key to the billable object (e.g. dispatch ID, storage record ID) this line references. */
|
|
1728
|
+
object_id?: number;
|
|
1729
|
+
/** Client-facing reference string for the line item (e.g. order number, dispatch reference). */
|
|
1730
|
+
reference: string;
|
|
1731
|
+
/** Human-readable description of the charge. */
|
|
1732
|
+
description?: string;
|
|
1733
|
+
/** ISO 8601 date string of the dispatch associated with this charge. */
|
|
1734
|
+
dispatch_date?: string;
|
|
1735
|
+
/** Name of the shipping service used (e.g. "Royal Mail Tracked 24"). */
|
|
1736
|
+
service_name?: string;
|
|
1737
|
+
/** Foreign key to the service fee schedule applied for pricing. */
|
|
1738
|
+
service_fee_id?: number;
|
|
1739
|
+
/** Foreign key to the courier/carrier associated with this charge. */
|
|
1740
|
+
courier_id?: number;
|
|
1741
|
+
/** Unit price for this line item in the invoice currency. */
|
|
1742
|
+
price?: number;
|
|
1743
|
+
/** Discount rate applied to this line as a percentage (e.g. 10 = 10% off). */
|
|
1744
|
+
discount_rate?: number;
|
|
1745
|
+
/** Destination postcode used for shipping cost calculation. */
|
|
1746
|
+
postcode?: string;
|
|
1747
|
+
/** ISO 3166-1 alpha-2 destination country code (e.g. "GB", "US"). */
|
|
1748
|
+
country_code?: string;
|
|
1749
|
+
/** Tax classification for VAT/GST purposes. Determines the tax rate applied (e.g. 0 = zero-rated, 1 = standard rate, 2 = exempt). */
|
|
1750
|
+
tax_class?: number;
|
|
1751
|
+
/** Cost of the consignment/shipment charged by the carrier, before margin. */
|
|
1752
|
+
consignment_price?: number;
|
|
1753
|
+
/** Fuel surcharge amount added by the carrier. */
|
|
1754
|
+
fuel?: number;
|
|
1755
|
+
/** Cost of packaging materials used for the dispatch. */
|
|
1756
|
+
packaging_price?: number;
|
|
1757
|
+
/** Calculated discount amount in the invoice currency. */
|
|
1758
|
+
discount?: number;
|
|
1759
|
+
/** Number of order lines included in this dispatch (used for per-line billing). */
|
|
1760
|
+
lines?: number;
|
|
1761
|
+
/** Number of individual item picks performed (used for per-pick billing). */
|
|
1762
|
+
picks?: number;
|
|
1763
|
+
/** Total weight of the dispatch in kilograms. */
|
|
1764
|
+
weight?: number;
|
|
1765
|
+
/** Margin percentage or amount charged on top of the carrier cost (buy/sell spread). */
|
|
1766
|
+
margin_charged?: number;
|
|
1767
|
+
/** Manual override of the calculated line total. When set, replaces the computed total. */
|
|
1768
|
+
total_override?: number;
|
|
1769
|
+
/** Flag indicating this line needs recalculation. 0 = no recheck needed, 1 = recheck required. */
|
|
1770
|
+
recheck?: number;
|
|
1771
|
+
/** Flag indicating the price has been manually overridden. 0 = auto-calculated, 1 = manually overridden. */
|
|
1772
|
+
override?: number;
|
|
1773
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1774
|
+
status?: number;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Invoices resource interface
|
|
1779
|
+
*/
|
|
1780
|
+
export declare interface InvoicesResource {
|
|
1781
|
+
/** Get all invoices with pagination */
|
|
1782
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Invoice>>;
|
|
1783
|
+
/** Get an invoice by ID */
|
|
1784
|
+
getById(id: number): Promise<Invoice>;
|
|
1785
|
+
/** Create a new invoice */
|
|
1786
|
+
create(data: CreateInvoiceRequest): Promise<Invoice>;
|
|
1787
|
+
/** Update an invoice */
|
|
1788
|
+
update(id: number, data: Partial<CreateInvoiceRequest>): Promise<Invoice>;
|
|
1789
|
+
/** Delete an invoice */
|
|
1790
|
+
delete(id: number): Promise<void>;
|
|
1791
|
+
/** Get lines for an invoice */
|
|
1792
|
+
getLines(invoiceId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<InvoiceLine>>;
|
|
1793
|
+
/** Get a specific invoice line */
|
|
1794
|
+
getLineById(invoiceId: number, lineId: number): Promise<InvoiceLine>;
|
|
1795
|
+
/** Create a new invoice line */
|
|
1796
|
+
createLine(invoiceId: number, data: CreateInvoiceLineRequest): Promise<unknown>;
|
|
1797
|
+
/** Update an invoice line */
|
|
1798
|
+
updateLine(invoiceId: number, lineId: number, data: UpdateInvoiceLineRequest): Promise<InvoiceLine>;
|
|
1799
|
+
/** Delete an invoice line */
|
|
1800
|
+
deleteLine(invoiceId: number, lineId: number): Promise<void>;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* Check if an error is a JanusApiError
|
|
1805
|
+
*/
|
|
1806
|
+
export declare function isJanusApiError(error: unknown): error is JanusApiError;
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* Check if an error is an UnauthorizedError
|
|
1810
|
+
*/
|
|
1811
|
+
export declare function isUnauthorizedError(error: unknown): error is UnauthorizedError;
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* JANUS API Client Interface
|
|
1815
|
+
*
|
|
1816
|
+
* Provides typed access to all JANUS API resources.
|
|
1817
|
+
*/
|
|
1818
|
+
export declare interface JanusApi {
|
|
1819
|
+
/** Clients resource - manage client accounts */
|
|
1820
|
+
clients: ClientsResource;
|
|
1821
|
+
/** Returns resource - manage customer returns */
|
|
1822
|
+
returns: ReturnsResource;
|
|
1823
|
+
/** Reports resource - generate reports */
|
|
1824
|
+
reports: ReportsResource;
|
|
1825
|
+
/** Helpers resource - public endpoints (no auth required) */
|
|
1826
|
+
helpers: HelpersResource;
|
|
1827
|
+
/** Couriers resource - manage couriers and services */
|
|
1828
|
+
couriers: CouriersResource;
|
|
1829
|
+
/** Orders resource - query orders and stats */
|
|
1830
|
+
orders: OrdersResource;
|
|
1831
|
+
/** Integrations resource - manage integrations */
|
|
1832
|
+
integrations: IntegrationsResource;
|
|
1833
|
+
/** Users resource - manage users */
|
|
1834
|
+
users: UsersResource;
|
|
1835
|
+
/** Logs resource - activity and order issue logs */
|
|
1836
|
+
logs: LogsResource;
|
|
1837
|
+
/** Tasks resource - task history */
|
|
1838
|
+
tasks: TasksResource;
|
|
1839
|
+
/** Customer resource - public customer tracking (no auth) */
|
|
1840
|
+
customer: CustomerResource;
|
|
1841
|
+
/** Legacy resource - legacy couriers, post services, products */
|
|
1842
|
+
legacy: LegacyResource;
|
|
1843
|
+
/** Products resource - product CRUD (preferred over legacy.queryProducts) */
|
|
1844
|
+
products: ProductsResource;
|
|
1845
|
+
/** Product categories resource */
|
|
1846
|
+
productCategories: ProductCategoriesResource;
|
|
1847
|
+
/** Stocks resource - stock management */
|
|
1848
|
+
stocks: StocksResource;
|
|
1849
|
+
/** Stock transactions resource */
|
|
1850
|
+
stockTransactions: StockTransactionsResource;
|
|
1851
|
+
/** Stock allocations resource */
|
|
1852
|
+
stockAllocations: StockAllocationsResource;
|
|
1853
|
+
/** Locations resource - warehouse locations */
|
|
1854
|
+
locations: LocationsResource;
|
|
1855
|
+
/** Audits resource - audit trail (read-only) */
|
|
1856
|
+
audits: AuditsResource;
|
|
1857
|
+
/** ASNs resource - advance shipping notices with lines and receipts */
|
|
1858
|
+
asns: AsnsResource;
|
|
1859
|
+
/** Dispatches resource */
|
|
1860
|
+
dispatches: DispatchesResource;
|
|
1861
|
+
/** Consignments resource */
|
|
1862
|
+
consignments: ConsignmentsResource;
|
|
1863
|
+
/** Invoices resource - invoices with line items */
|
|
1864
|
+
invoices: InvoicesResource;
|
|
1865
|
+
/** Underlying AuthApi instance for raw requests */
|
|
1866
|
+
auth: AuthApi;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* Error Utilities
|
|
1871
|
+
*
|
|
1872
|
+
* Custom error types and error handling utilities.
|
|
1873
|
+
* @module utils/errors
|
|
1874
|
+
*/
|
|
1875
|
+
/**
|
|
1876
|
+
* Base class for JANUS API errors
|
|
1877
|
+
*/
|
|
1878
|
+
export declare class JanusApiError extends Error {
|
|
1879
|
+
/** HTTP status code */
|
|
1880
|
+
readonly status: number;
|
|
1881
|
+
/** Original error response */
|
|
1882
|
+
readonly response?: unknown;
|
|
1883
|
+
constructor(message: string, status: number, response?: unknown);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* Options for creating a JANUS API client
|
|
1888
|
+
*/
|
|
1889
|
+
export declare interface JanusApiOptions {
|
|
1890
|
+
/** Base URL for JANUS API (defaults to production) */
|
|
1891
|
+
baseUrl?: string;
|
|
1892
|
+
/** Base URL for auth API (if different from JANUS) */
|
|
1893
|
+
authUrl?: string;
|
|
1894
|
+
/** Called on 401 unauthorized response */
|
|
1895
|
+
onUnauthorized?: () => void;
|
|
1896
|
+
/** Called on successful login */
|
|
1897
|
+
onLoginSuccess?: (token: string) => void;
|
|
1898
|
+
/** Called on login failure */
|
|
1899
|
+
onLoginError?: (error: Error) => void;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* LegacyDispatch Entity
|
|
1904
|
+
*
|
|
1905
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1906
|
+
*
|
|
1907
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Dispatch.entity.ts
|
|
1908
|
+
*/
|
|
1909
|
+
export declare interface LegacyDispatch {
|
|
1910
|
+
/** Primary key identifier for the dispatch record. */
|
|
1911
|
+
id: number;
|
|
1912
|
+
/** Foreign key to the parent order this dispatch belongs to. */
|
|
1913
|
+
orderId?: number;
|
|
1914
|
+
/** Foreign key to the user who created or processed the dispatch. */
|
|
1915
|
+
userLoginId?: number;
|
|
1916
|
+
/** Client-facing reference code for the dispatch (e.g. order number or custom reference). */
|
|
1917
|
+
reference?: string;
|
|
1918
|
+
/** Foreign key to the delivery address record for the shopper. */
|
|
1919
|
+
shopperAddressIdDelivery?: number;
|
|
1920
|
+
/** ISO 8601 date string when the dispatch was shipped. */
|
|
1921
|
+
dispatchDate?: string;
|
|
1922
|
+
/** ISO 8601 date string when the associated invoice was raised. */
|
|
1923
|
+
invoiceDate?: string;
|
|
1924
|
+
/** Foreign key to the postal/shipping service used for this dispatch. */
|
|
1925
|
+
postServiceId?: number;
|
|
1926
|
+
/** Numeric status code for the dispatch. Common values: 0 = pending, 1 = dispatched, 2 = cancelled. */
|
|
1927
|
+
dispatchStatus?: number;
|
|
1928
|
+
/** Carrier tracking number for the shipment. */
|
|
1929
|
+
trackingNumber?: string;
|
|
1930
|
+
/** Actual measured weight of the dispatch in grams or kilograms (depends on client configuration). */
|
|
1931
|
+
actualWeight?: number;
|
|
1932
|
+
/** Foreign key to the courier/carrier used for delivery. */
|
|
1933
|
+
courierId?: number;
|
|
1934
|
+
/** Internal notes or comments attached to the dispatch. */
|
|
1935
|
+
notes?: string;
|
|
1936
|
+
/** Foreign key to the tariff schedule applied to this dispatch for billing. */
|
|
1937
|
+
tariffDispatchId?: number;
|
|
1938
|
+
/** Foreign key to the email template used for automated dispatch notifications. */
|
|
1939
|
+
autoEmailTemplateId?: number;
|
|
1940
|
+
/** ISO 8601 date string when the dispatch notification email was sent. Null if not yet mailed. */
|
|
1941
|
+
mailed?: string;
|
|
1942
|
+
/** Whether the dispatch is on hold. 0 = not on hold, 1 = on hold. */
|
|
1943
|
+
hold?: unknown;
|
|
1944
|
+
/** ISO 8601 date string when a held dispatch was released for processing. */
|
|
1945
|
+
releaseDate?: string;
|
|
1946
|
+
/** Whether this dispatch is a draft. 0 = finalised, 1 = draft. */
|
|
1947
|
+
draft?: unknown;
|
|
1948
|
+
/** Gift message to include with the shipment. */
|
|
1949
|
+
giftMessage?: string;
|
|
1950
|
+
/** Special delivery instructions for the courier (e.g. "leave with neighbour"). */
|
|
1951
|
+
deliveryInstructions?: string;
|
|
1952
|
+
/** Whether a cancellation has been requested. 0 = no cancellation requested, 1 = cancellation requested. */
|
|
1953
|
+
cancelRequested?: unknown;
|
|
1954
|
+
/** Foreign key to the current dispatch action being performed (e.g. pick, pack, ship). */
|
|
1955
|
+
dispatchActionId?: number;
|
|
1956
|
+
/** Status of the current dispatch action. 0 = not started, 1 = in progress, 2 = completed. */
|
|
1957
|
+
dispatchActionStatus?: number;
|
|
1958
|
+
/** Stock fulfilment status. 0 = unallocated, 1 = partially allocated, 2 = fully allocated. */
|
|
1959
|
+
stockStatus?: number;
|
|
1960
|
+
/** Flag indicating a problem with the dispatch. 0 = no issue, 1 = issue flagged. */
|
|
1961
|
+
dispatchIssue?: number;
|
|
1962
|
+
/** Whether this dispatch is for an international export. 0 = domestic, 1 = export. */
|
|
1963
|
+
export?: unknown;
|
|
1964
|
+
/** Incoterms delivery terms code (e.g. "DAP", "DDP", "EXW"). */
|
|
1965
|
+
deliveryTerms?: string;
|
|
1966
|
+
/** Reason code for export classification (customs/regulatory). */
|
|
1967
|
+
exportReason?: unknown;
|
|
1968
|
+
/** Dispatch priority level. Higher numbers indicate higher priority. */
|
|
1969
|
+
priority?: number;
|
|
1970
|
+
/** Foreign key to a workflow action record associated with this dispatch. */
|
|
1971
|
+
actionId?: number;
|
|
1972
|
+
/** ISO 8601 date string when the dispatch action was performed. */
|
|
1973
|
+
actioned?: string;
|
|
1974
|
+
/** Free-text reason for export, used on customs declarations. */
|
|
1975
|
+
reasonForExport?: string;
|
|
1976
|
+
/** ISO 8601 date string when the dispatch record was created. */
|
|
1977
|
+
created?: string;
|
|
1978
|
+
/** ISO 8601 date string when the dispatch record was last modified. */
|
|
1979
|
+
modified?: string;
|
|
1980
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1981
|
+
status?: number;
|
|
1982
|
+
/** Partition ID for multi-tenant data isolation. */
|
|
1983
|
+
partition_id?: number;
|
|
1984
|
+
/** Whether the dispatch is fully complete. 0 = incomplete, 1 = complete. */
|
|
1985
|
+
complete?: number;
|
|
1986
|
+
/** ISO 8601 date string when the dispatch was marked as complete. */
|
|
1987
|
+
complete_date?: string;
|
|
1988
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
1989
|
+
order: LegacyOrder;
|
|
1990
|
+
/** OneToMany relationship to LegacyDispatchItem */
|
|
1991
|
+
dispatchItems: LegacyDispatchItem[];
|
|
1992
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
1993
|
+
shopperDeliveryAddress: LegacyShopperAddress;
|
|
1994
|
+
/** OneToOne relationship to Consignment */
|
|
1995
|
+
consignment: Consignment_2;
|
|
1996
|
+
/** OneToOne relationship to LegacyPostService */
|
|
1997
|
+
postService: LegacyPostService;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* LegacyDispatchItem Entity
|
|
2002
|
+
*
|
|
2003
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2004
|
+
*
|
|
2005
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/DispatchItem.entity.ts
|
|
2006
|
+
*/
|
|
2007
|
+
declare interface LegacyDispatchItem {
|
|
2008
|
+
id: number;
|
|
2009
|
+
dispatchId?: number;
|
|
2010
|
+
productId?: number;
|
|
2011
|
+
quantity?: number;
|
|
2012
|
+
tariffDispatchId?: number;
|
|
2013
|
+
tariffDispatchProductId?: number;
|
|
2014
|
+
created?: string;
|
|
2015
|
+
modified?: string;
|
|
2016
|
+
status?: number;
|
|
2017
|
+
partition_id?: number;
|
|
2018
|
+
/** ManyToOne relationship to LegacyDispatch */
|
|
2019
|
+
dispatch: LegacyDispatch;
|
|
2020
|
+
/** ManyToOne relationship to LegacyProduct */
|
|
2021
|
+
product: LegacyProduct;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* LegacyOrder Entity
|
|
2026
|
+
*
|
|
2027
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2028
|
+
*
|
|
2029
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Order.entity.ts
|
|
2030
|
+
*/
|
|
2031
|
+
declare interface LegacyOrder {
|
|
2032
|
+
id: number;
|
|
2033
|
+
customerId?: number;
|
|
2034
|
+
userLoginId?: number;
|
|
2035
|
+
brandId?: number;
|
|
2036
|
+
reference?: string;
|
|
2037
|
+
source?: number;
|
|
2038
|
+
shopperAddressIdDelivery?: number;
|
|
2039
|
+
shopperAddressIdInvoice?: number;
|
|
2040
|
+
orderDate?: string;
|
|
2041
|
+
dispatchCompletedDate?: string;
|
|
2042
|
+
postServiceId?: number;
|
|
2043
|
+
orderStatus?: number;
|
|
2044
|
+
actualWeight?: number;
|
|
2045
|
+
courierId?: number;
|
|
2046
|
+
notes?: string;
|
|
2047
|
+
skippedLines?: number;
|
|
2048
|
+
autoEmailTemplateId?: number;
|
|
2049
|
+
hold?: unknown;
|
|
2050
|
+
releaseDate?: string;
|
|
2051
|
+
draft?: unknown;
|
|
2052
|
+
giftMessage?: string;
|
|
2053
|
+
deliveryInstructions?: string;
|
|
2054
|
+
cancelRequested?: unknown;
|
|
2055
|
+
orderActionId?: number;
|
|
2056
|
+
orderActionStatus?: number;
|
|
2057
|
+
stockDeducted?: unknown;
|
|
2058
|
+
orderIssue?: number;
|
|
2059
|
+
export?: unknown;
|
|
2060
|
+
deliveryTerms?: string;
|
|
2061
|
+
exportReason?: unknown;
|
|
2062
|
+
actionId?: number;
|
|
2063
|
+
created?: string;
|
|
2064
|
+
modified?: string;
|
|
2065
|
+
status?: number;
|
|
2066
|
+
partition_id?: number;
|
|
2067
|
+
external_order_id?: string;
|
|
2068
|
+
channel_order_id?: string;
|
|
2069
|
+
transaction_type: 'b2c' | 'b2b' | 'internal_transfer' | 'damage' | 'expiry';
|
|
2070
|
+
channel?: string;
|
|
2071
|
+
/** OneToMany relationship to LegacyOrderItem */
|
|
2072
|
+
orderItems: LegacyOrderItem[];
|
|
2073
|
+
/** OneToMany relationship to LegacyOrderMeta */
|
|
2074
|
+
orderMeta: LegacyOrderMeta[];
|
|
2075
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
2076
|
+
shopperDeliveryAddress: LegacyShopperAddress;
|
|
2077
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
2078
|
+
shopperBillingAddress: LegacyShopperAddress;
|
|
2079
|
+
/** OneToMany relationship to LegacyDispatch */
|
|
2080
|
+
dispatches: LegacyDispatch[];
|
|
2081
|
+
/** OneToOne relationship to LegacyDispatch */
|
|
2082
|
+
dispatch: LegacyDispatch;
|
|
2083
|
+
/** OneToOne relationship to Source */
|
|
2084
|
+
orderSource: Source;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
/**
|
|
2088
|
+
* LegacyOrderItem Entity
|
|
2089
|
+
*
|
|
2090
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2091
|
+
*
|
|
2092
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/OrderItem.entity.ts
|
|
2093
|
+
*/
|
|
2094
|
+
declare interface LegacyOrderItem {
|
|
2095
|
+
id: number;
|
|
2096
|
+
orderId?: number;
|
|
2097
|
+
productId?: number;
|
|
2098
|
+
quantity?: number;
|
|
2099
|
+
created?: string;
|
|
2100
|
+
modified?: string;
|
|
2101
|
+
status?: number;
|
|
2102
|
+
partition_id?: number;
|
|
2103
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
2104
|
+
order: LegacyOrder;
|
|
2105
|
+
/** ManyToOne relationship to LegacyProduct */
|
|
2106
|
+
product: LegacyProduct;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* LegacyOrderMeta Entity
|
|
2111
|
+
*
|
|
2112
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2113
|
+
*
|
|
2114
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/OrderMeta.entity.ts
|
|
2115
|
+
*/
|
|
2116
|
+
declare interface LegacyOrderMeta {
|
|
2117
|
+
id: number;
|
|
2118
|
+
orderId: number;
|
|
2119
|
+
orderData?: Record<string, unknown>;
|
|
2120
|
+
created?: string;
|
|
2121
|
+
modified?: string;
|
|
2122
|
+
status?: number;
|
|
2123
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
2124
|
+
order: LegacyOrder;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* Legacy post service entity
|
|
460
2129
|
*/
|
|
461
|
-
|
|
2130
|
+
declare interface LegacyPostService {
|
|
2131
|
+
id: number;
|
|
2132
|
+
name?: string;
|
|
2133
|
+
[key: string]: unknown;
|
|
2134
|
+
}
|
|
462
2135
|
|
|
463
2136
|
/**
|
|
464
|
-
*
|
|
2137
|
+
* LegacyProduct Entity
|
|
2138
|
+
*
|
|
2139
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2140
|
+
*
|
|
2141
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Product.entity.ts
|
|
465
2142
|
*/
|
|
466
|
-
|
|
2143
|
+
declare interface LegacyProduct {
|
|
2144
|
+
id: number;
|
|
2145
|
+
sku?: string;
|
|
2146
|
+
name?: string;
|
|
2147
|
+
/** Legacy customer ID. Matches `Client.remote_client_id`, NOT `Client.id`. */
|
|
2148
|
+
customerId?: number;
|
|
2149
|
+
description?: string;
|
|
2150
|
+
commodityCode?: number;
|
|
2151
|
+
compostionId?: number;
|
|
2152
|
+
additional_skus?: string;
|
|
2153
|
+
asins?: string;
|
|
2154
|
+
custom_fields: Record<string, unknown>;
|
|
2155
|
+
unit_of_measure?: string;
|
|
2156
|
+
eaches_per_pack?: number;
|
|
2157
|
+
case_pack_sku_code?: string;
|
|
2158
|
+
weight_grams?: number;
|
|
2159
|
+
case_pack_barcode?: string;
|
|
2160
|
+
product_category_id?: number;
|
|
2161
|
+
product_type?: 'sellable_unit' | 'packaging' | 'component' | 'consumables';
|
|
2162
|
+
sellable_format: 'single' | 'case_pack' | 'bundle';
|
|
2163
|
+
commodity_description?: string;
|
|
2164
|
+
currency?: string;
|
|
2165
|
+
primary_material?: string;
|
|
2166
|
+
secondary_material?: string;
|
|
2167
|
+
dangerous_goods?: string;
|
|
2168
|
+
eccn?: string;
|
|
2169
|
+
bundle_components?: string;
|
|
2170
|
+
image_url?: string;
|
|
2171
|
+
low_stock_threshold?: number;
|
|
2172
|
+
requires_batch_tracking?: unknown;
|
|
2173
|
+
requires_serial_tracking?: unknown;
|
|
2174
|
+
requires_bbe_tracking?: unknown;
|
|
2175
|
+
fefo_fifo_override?: unknown;
|
|
2176
|
+
is_bundle?: unknown;
|
|
2177
|
+
default_stock_status: 'available' | 'quarantined' | 'expired' | 'damaged';
|
|
2178
|
+
product_status: 'active' | 'pre_active ' | 'discontinued ' | 'inactive ' | 'archived';
|
|
2179
|
+
value?: number;
|
|
2180
|
+
rrp?: number;
|
|
2181
|
+
qty?: number;
|
|
2182
|
+
dim_1?: number;
|
|
2183
|
+
dim_2?: number;
|
|
2184
|
+
dim_3?: number;
|
|
2185
|
+
weight?: number;
|
|
2186
|
+
stock?: number;
|
|
2187
|
+
stockExp?: number;
|
|
2188
|
+
stockAlloc?: number;
|
|
2189
|
+
stockRequested?: number;
|
|
2190
|
+
stockPreOrder?: number;
|
|
2191
|
+
stockPreOrderAlloc?: number;
|
|
2192
|
+
reorder?: number;
|
|
2193
|
+
barcode?: string;
|
|
2194
|
+
locationId?: number;
|
|
2195
|
+
abort: unknown;
|
|
2196
|
+
ignore: unknown;
|
|
2197
|
+
update: unknown;
|
|
2198
|
+
manage: unknown;
|
|
2199
|
+
archive: unknown;
|
|
2200
|
+
phantom: unknown;
|
|
2201
|
+
hsCode?: string;
|
|
2202
|
+
composite: unknown;
|
|
2203
|
+
origin?: string;
|
|
2204
|
+
zeroStock?: number;
|
|
2205
|
+
autoRework?: number;
|
|
2206
|
+
created?: string;
|
|
2207
|
+
modified?: string;
|
|
2208
|
+
status?: number;
|
|
2209
|
+
partition_id?: number;
|
|
2210
|
+
/** OneToMany relationship to LegacyDispatchItem */
|
|
2211
|
+
dispatchItems: LegacyDispatchItem[];
|
|
2212
|
+
/** OneToMany relationship to LegacyOrderItem */
|
|
2213
|
+
orderItems: LegacyOrderItem[];
|
|
2214
|
+
}
|
|
467
2215
|
|
|
468
2216
|
/**
|
|
469
|
-
*
|
|
2217
|
+
* Legacy resource interface
|
|
2218
|
+
*/
|
|
2219
|
+
export declare interface LegacyResource {
|
|
2220
|
+
/** Get all legacy couriers */
|
|
2221
|
+
getCouriers(): Promise<unknown[]>;
|
|
2222
|
+
/** Get all legacy post services */
|
|
2223
|
+
getPostServices(): Promise<unknown[]>;
|
|
2224
|
+
/** Get legacy post services by carrier code */
|
|
2225
|
+
getPostServicesByCarrier(carrierCode: string): Promise<unknown[]>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Query legacy products.
|
|
2228
|
+
*
|
|
2229
|
+
* **Important — Client filtering:**
|
|
2230
|
+
* For non-admin users the server auto-filters by client. For admin users
|
|
2231
|
+
* (`partition_id = 0`) you must pass `products.customer_id` explicitly using
|
|
2232
|
+
* the client's `remote_client_id` — NOT `Client.id` (the Janus internal ID).
|
|
2233
|
+
*
|
|
2234
|
+
* @deprecated Use janus.products.getAll() instead.
|
|
2235
|
+
*
|
|
2236
|
+
* @example
|
|
2237
|
+
* // Admin user — must filter by client manually
|
|
2238
|
+
* janus.legacy.queryProducts({
|
|
2239
|
+
* query: [
|
|
2240
|
+
* { query_name: 'products.customer_id', query_type: '=', query_value: selectedClient.remote_client_id },
|
|
2241
|
+
* ],
|
|
2242
|
+
* limit: 1000,
|
|
2243
|
+
* });
|
|
2244
|
+
*
|
|
2245
|
+
* // Non-admin user — server filters automatically
|
|
2246
|
+
* janus.legacy.queryProducts({ query: [], limit: 1000 });
|
|
2247
|
+
*/
|
|
2248
|
+
queryProducts(query: HttpQueryRequest): Promise<unknown>;
|
|
2249
|
+
/** Get the legacy print list */
|
|
2250
|
+
getPrintList(): Promise<unknown[]>;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
/**
|
|
2254
|
+
* LegacyShopperAddress Entity
|
|
470
2255
|
*
|
|
471
|
-
*
|
|
2256
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2257
|
+
*
|
|
2258
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/ShopperAddress.entity.ts
|
|
472
2259
|
*/
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
2260
|
+
declare interface LegacyShopperAddress {
|
|
2261
|
+
id: number;
|
|
2262
|
+
customerId?: number;
|
|
2263
|
+
userLoginId?: number;
|
|
2264
|
+
title?: string;
|
|
2265
|
+
forename?: string;
|
|
2266
|
+
surname?: string;
|
|
2267
|
+
company?: string;
|
|
2268
|
+
line_1?: string;
|
|
2269
|
+
line_2?: string;
|
|
2270
|
+
line_3?: string;
|
|
2271
|
+
city?: string;
|
|
2272
|
+
county?: string;
|
|
2273
|
+
country?: string;
|
|
2274
|
+
countryCode?: string;
|
|
2275
|
+
postcode?: string;
|
|
2276
|
+
email?: string;
|
|
2277
|
+
phoneNumber?: string;
|
|
2278
|
+
eori?: string;
|
|
2279
|
+
created?: string;
|
|
2280
|
+
modified?: string;
|
|
2281
|
+
status?: number;
|
|
2282
|
+
/** OneToOne relationship to LegacyOrder */
|
|
2283
|
+
orderDelivery: LegacyOrder;
|
|
2284
|
+
/** OneToOne relationship to LegacyOrder */
|
|
2285
|
+
orderBilling: LegacyOrder;
|
|
2286
|
+
/** OneToOne relationship to LegacyDispatch */
|
|
2287
|
+
dispatchDelivery: LegacyDispatch;
|
|
484
2288
|
}
|
|
485
2289
|
|
|
486
2290
|
/**
|
|
487
|
-
*
|
|
2291
|
+
* Location Entity
|
|
488
2292
|
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
2293
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2294
|
+
*
|
|
2295
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/locations/location.entity.ts
|
|
491
2296
|
*/
|
|
2297
|
+
declare interface Location_2 extends BaseEntity_2 {
|
|
2298
|
+
/** Foreign key to the client that owns this location. */
|
|
2299
|
+
clientId?: number;
|
|
2300
|
+
/** Unique human-readable code identifying this location (e.g. "A-01-03-B"). */
|
|
2301
|
+
location_code?: string;
|
|
2302
|
+
/** Type of warehouse location determining its role in the fulfilment workflow. */
|
|
2303
|
+
location_type: 'pick' | 'bulk' | 'staging' | 'receiving' | 'shipping' | 'quarantine' | 'returns';
|
|
2304
|
+
/** Warehouse zone grouping (e.g. "A", "B", "Mezzanine"). */
|
|
2305
|
+
zone?: string;
|
|
2306
|
+
/** Aisle identifier within the zone. */
|
|
2307
|
+
aisle?: string;
|
|
2308
|
+
/** Bay/rack identifier within the aisle. */
|
|
2309
|
+
bay?: string;
|
|
2310
|
+
/** Vertical level/shelf within the bay. */
|
|
2311
|
+
level?: string;
|
|
2312
|
+
/** Horizontal position within the level. */
|
|
2313
|
+
position?: string;
|
|
2314
|
+
/** Foreign key to the fulfilment centre this location belongs to. */
|
|
2315
|
+
fulfilment_location_id?: number;
|
|
2316
|
+
/** Human-readable name of the fulfilment centre. */
|
|
2317
|
+
fulfilment_location_name?: string;
|
|
2318
|
+
/** Current number of stock units held in this location. */
|
|
2319
|
+
current_units?: number;
|
|
2320
|
+
/** Maximum unit capacity of this location. */
|
|
2321
|
+
max_capacity_units?: number;
|
|
2322
|
+
/** Maximum weight capacity in kilograms for this location. */
|
|
2323
|
+
max_capacity_weight_kg?: number;
|
|
2324
|
+
/** Whether multiple different SKUs can be stored in this location. 0 = no (single SKU only), 1 = yes (mixed SKUs allowed). */
|
|
2325
|
+
is_mixed_sku_allowed?: number;
|
|
2326
|
+
/** Whether this location is currently active. 0 = no (decommissioned), 1 = yes (in use). */
|
|
2327
|
+
is_active?: number;
|
|
2328
|
+
/** Whether stock can be picked from this location. 0 = no, 1 = yes. */
|
|
2329
|
+
is_pickable?: number;
|
|
2330
|
+
/** Whether stock can be received into this location. 0 = no, 1 = yes. */
|
|
2331
|
+
is_receivable?: number;
|
|
2332
|
+
/** Temperature storage zone for the location. */
|
|
2333
|
+
temperature_zone: 'ambient' | 'chilled' | 'frozen';
|
|
2334
|
+
/** Free-text notes about this location (e.g. access restrictions, special handling). */
|
|
2335
|
+
notes?: string;
|
|
2336
|
+
}
|
|
2337
|
+
export { Location_2 as Location }
|
|
2338
|
+
|
|
492
2339
|
/**
|
|
493
|
-
*
|
|
494
|
-
*/
|
|
495
|
-
export declare
|
|
496
|
-
/**
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
|
|
500
|
-
|
|
2340
|
+
* Locations resource interface
|
|
2341
|
+
*/
|
|
2342
|
+
export declare interface LocationsResource {
|
|
2343
|
+
/** Get all locations with optional filters */
|
|
2344
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Location_2>>;
|
|
2345
|
+
/** Get a location by ID */
|
|
2346
|
+
getById(id: number): Promise<Location_2>;
|
|
2347
|
+
/** Create a new location */
|
|
2348
|
+
create(data: CreateLocationRequest): Promise<Location_2>;
|
|
2349
|
+
/** Update an existing location */
|
|
2350
|
+
update(id: number, data: Partial<CreateLocationRequest>): Promise<Location_2>;
|
|
2351
|
+
/** Delete a location by ID */
|
|
2352
|
+
delete(id: number): Promise<void>;
|
|
501
2353
|
}
|
|
502
2354
|
|
|
503
2355
|
/**
|
|
504
|
-
*
|
|
2356
|
+
* Logs resource interface
|
|
505
2357
|
*/
|
|
506
|
-
export declare interface
|
|
507
|
-
/**
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
|
|
513
|
-
/** Called on successful login */
|
|
514
|
-
onLoginSuccess?: (token: string) => void;
|
|
515
|
-
/** Called on login failure */
|
|
516
|
-
onLoginError?: (error: Error) => void;
|
|
2358
|
+
export declare interface LogsResource {
|
|
2359
|
+
/** Create activity log entries */
|
|
2360
|
+
createActivity(entries: Record<string, unknown>[]): Promise<unknown>;
|
|
2361
|
+
/** Create an order issue log */
|
|
2362
|
+
createOrderIssue(data: Record<string, unknown>): Promise<unknown>;
|
|
2363
|
+
/** Update an order issue log */
|
|
2364
|
+
updateOrderIssue(data: Record<string, unknown>): Promise<unknown>;
|
|
517
2365
|
}
|
|
518
2366
|
|
|
519
2367
|
/**
|
|
@@ -537,6 +2385,161 @@ declare interface NotificationSettingsResponse {
|
|
|
537
2385
|
settings?: Record<string, unknown>;
|
|
538
2386
|
}
|
|
539
2387
|
|
|
2388
|
+
/**
|
|
2389
|
+
* Filters for order returns
|
|
2390
|
+
*/
|
|
2391
|
+
export declare interface OrderReturnsFilters extends BaseFilters {
|
|
2392
|
+
/** Filter by client ID */
|
|
2393
|
+
clientId?: number;
|
|
2394
|
+
/** Page number */
|
|
2395
|
+
pageNumber?: number;
|
|
2396
|
+
/** Column to sort by */
|
|
2397
|
+
order_column?: string;
|
|
2398
|
+
/** Sort direction */
|
|
2399
|
+
order_direction?: 'ASC' | 'DESC';
|
|
2400
|
+
/** Filter by creation date from */
|
|
2401
|
+
created_at?: string;
|
|
2402
|
+
/** Filter by creation date to */
|
|
2403
|
+
created_to?: string;
|
|
2404
|
+
/** Columns to include in response */
|
|
2405
|
+
include_columns?: string;
|
|
2406
|
+
/** Search query */
|
|
2407
|
+
query?: string;
|
|
2408
|
+
/** Filter by channel */
|
|
2409
|
+
channel?: string;
|
|
2410
|
+
/** Filter by destination */
|
|
2411
|
+
destination?: string;
|
|
2412
|
+
/** Filter by courier */
|
|
2413
|
+
courier?: string;
|
|
2414
|
+
/** Filter by service */
|
|
2415
|
+
service?: string;
|
|
2416
|
+
/** Filter by status */
|
|
2417
|
+
status?: string;
|
|
2418
|
+
/** Group by field */
|
|
2419
|
+
group_by?: string;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* Filters for querying orders
|
|
2424
|
+
*/
|
|
2425
|
+
export declare interface OrdersQueryFilters extends BaseFilters {
|
|
2426
|
+
/** Filter by client ID */
|
|
2427
|
+
clientId?: number;
|
|
2428
|
+
/** Page number */
|
|
2429
|
+
pageNumber?: number;
|
|
2430
|
+
/** Column to sort by */
|
|
2431
|
+
order_column?: string;
|
|
2432
|
+
/** Sort direction */
|
|
2433
|
+
order_direction?: 'ASC' | 'DESC';
|
|
2434
|
+
/** Filter by creation date from */
|
|
2435
|
+
created_at?: string;
|
|
2436
|
+
/** Filter by creation date to */
|
|
2437
|
+
created_to?: string;
|
|
2438
|
+
/** Filter by channel */
|
|
2439
|
+
channel?: string;
|
|
2440
|
+
/** Filter by destination */
|
|
2441
|
+
destination?: string;
|
|
2442
|
+
/** Filter by courier */
|
|
2443
|
+
courier?: string;
|
|
2444
|
+
/** Filter by service */
|
|
2445
|
+
service?: string;
|
|
2446
|
+
/** Columns to include in response */
|
|
2447
|
+
include_columns?: string;
|
|
2448
|
+
/** Search query */
|
|
2449
|
+
query?: string;
|
|
2450
|
+
/** Include all stages */
|
|
2451
|
+
include_all_stages?: boolean;
|
|
2452
|
+
/** Filter by status */
|
|
2453
|
+
status?: string;
|
|
2454
|
+
/** Filter */
|
|
2455
|
+
filter?: string;
|
|
2456
|
+
/** Sub-filter */
|
|
2457
|
+
subfilter?: string;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
/**
|
|
2461
|
+
* Orders resource interface
|
|
2462
|
+
*/
|
|
2463
|
+
export declare interface OrdersResource {
|
|
2464
|
+
/** Get all orders with optional query filters (client, date range, status, etc.) */
|
|
2465
|
+
getAll(filters?: OrdersQueryFilters): Promise<unknown[]>;
|
|
2466
|
+
/** Get aggregated order statistics (counts, totals) with optional filters */
|
|
2467
|
+
getStats(filters?: OrdersStatsFilters): Promise<OrdersStatsResponse>;
|
|
2468
|
+
/** Get orders that have associated returns, with optional return-specific filters */
|
|
2469
|
+
getReturns(filters?: OrderReturnsFilters): Promise<unknown[]>;
|
|
2470
|
+
/**
|
|
2471
|
+
* Get a single order by its dispatch reference string.
|
|
2472
|
+
* Optionally scope to a specific client.
|
|
2473
|
+
*/
|
|
2474
|
+
getByRef(dispatchRef: string, clientId?: number): Promise<unknown>;
|
|
2475
|
+
/** Get available filter options for the returns order list, scoped to a client */
|
|
2476
|
+
getReturnFilterOptions(clientId: number): Promise<FilterOptionsResponse>;
|
|
2477
|
+
/**
|
|
2478
|
+
* Get available filter type options for the main orders list.
|
|
2479
|
+
* Optionally scoped to a specific client; omit for all available filter types.
|
|
2480
|
+
*/
|
|
2481
|
+
getFilterTypes(clientId?: number): Promise<FilterOptionsResponse>;
|
|
2482
|
+
/** Create a new order. The request body must include all required order fields and line items. */
|
|
2483
|
+
create(data: CreateOrderRequest): Promise<unknown>;
|
|
2484
|
+
/** Update an existing order by ID. Only the provided fields will be changed (partial update). */
|
|
2485
|
+
updateOrder(id: number, data: Partial<CreateOrderRequest>): Promise<unknown>;
|
|
2486
|
+
}
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Filters for order statistics
|
|
2490
|
+
*/
|
|
2491
|
+
export declare interface OrdersStatsFilters {
|
|
2492
|
+
/** Filter by client ID */
|
|
2493
|
+
clientId?: number;
|
|
2494
|
+
/** Filter by creation date from */
|
|
2495
|
+
created_at?: string;
|
|
2496
|
+
/** Filter by creation date to */
|
|
2497
|
+
created_to?: string;
|
|
2498
|
+
/** Dashboard mode */
|
|
2499
|
+
dashboard?: boolean;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
/**
|
|
2503
|
+
* Orders statistics response
|
|
2504
|
+
*/
|
|
2505
|
+
export declare interface OrdersStatsResponse {
|
|
2506
|
+
[key: string]: unknown;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
/**
|
|
2510
|
+
* Paginated list response from v2 endpoints.
|
|
2511
|
+
*
|
|
2512
|
+
* New v2 endpoints (products, stocks, locations, etc.) return this shape.
|
|
2513
|
+
* Distinct from `PaginatedResponse<T>` which is used by older endpoints.
|
|
2514
|
+
*/
|
|
2515
|
+
export declare interface PaginatedListResponse<T> {
|
|
2516
|
+
/** Data items for the current page */
|
|
2517
|
+
data: T[];
|
|
2518
|
+
/** Pagination metadata */
|
|
2519
|
+
meta: PaginationMeta;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* Base filters for v2 paginated list endpoints.
|
|
2524
|
+
*
|
|
2525
|
+
* All new v2 endpoints accept these query parameters (sent as snake_case on the wire).
|
|
2526
|
+
* Use with `buildPaginatedUrl()` which converts camelCase keys automatically.
|
|
2527
|
+
*/
|
|
2528
|
+
export declare interface PaginatedQueryFilters {
|
|
2529
|
+
/** Filter by client ID (Janus internal ID) */
|
|
2530
|
+
clientId?: number;
|
|
2531
|
+
/** Results per page */
|
|
2532
|
+
pageSize?: number;
|
|
2533
|
+
/** Page number (1-based) */
|
|
2534
|
+
pageNumber?: number;
|
|
2535
|
+
/** Column to sort by */
|
|
2536
|
+
orderColumn?: string;
|
|
2537
|
+
/** Sort direction */
|
|
2538
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
2539
|
+
/** Free-text search */
|
|
2540
|
+
query?: string;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
540
2543
|
/**
|
|
541
2544
|
* Response Types for API Operations
|
|
542
2545
|
* @module types/responses
|
|
@@ -555,6 +2558,66 @@ export declare interface PaginatedResponse<T> {
|
|
|
555
2558
|
pageSize?: number;
|
|
556
2559
|
}
|
|
557
2560
|
|
|
2561
|
+
/**
|
|
2562
|
+
* Pagination metadata returned by v2 list endpoints
|
|
2563
|
+
*/
|
|
2564
|
+
export declare interface PaginationMeta {
|
|
2565
|
+
/** Total number of items across all pages */
|
|
2566
|
+
total_items: number;
|
|
2567
|
+
/** Total number of pages */
|
|
2568
|
+
total_pages: number;
|
|
2569
|
+
/** Current page number (1-based) */
|
|
2570
|
+
current_page: number;
|
|
2571
|
+
/** Items per page */
|
|
2572
|
+
page_size: number;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* Product categories resource interface
|
|
2577
|
+
*/
|
|
2578
|
+
export declare interface ProductCategoriesResource {
|
|
2579
|
+
/** Get all product categories with optional filters */
|
|
2580
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<ProductCategory>>;
|
|
2581
|
+
/** Get a product category by ID */
|
|
2582
|
+
getById(id: number): Promise<ProductCategory>;
|
|
2583
|
+
/** Create a new product category */
|
|
2584
|
+
create(data: CreateProductCategoryRequest): Promise<ProductCategory>;
|
|
2585
|
+
/** Update an existing product category */
|
|
2586
|
+
update(id: number, data: Partial<CreateProductCategoryRequest>): Promise<ProductCategory>;
|
|
2587
|
+
/** Delete a product category by ID */
|
|
2588
|
+
delete(id: number): Promise<void>;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
/**
|
|
2592
|
+
* ProductCategory Entity
|
|
2593
|
+
*
|
|
2594
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2595
|
+
*
|
|
2596
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/productcategories/productcategory.entity.ts
|
|
2597
|
+
*/
|
|
2598
|
+
export declare interface ProductCategory extends BaseEntity_2 {
|
|
2599
|
+
clientId: number;
|
|
2600
|
+
category_name?: string;
|
|
2601
|
+
description?: string;
|
|
2602
|
+
parent_category_id?: number;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
/**
|
|
2606
|
+
* Products resource interface
|
|
2607
|
+
*/
|
|
2608
|
+
export declare interface ProductsResource {
|
|
2609
|
+
/** Get all products with optional filters */
|
|
2610
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<FormattedProduct>>;
|
|
2611
|
+
/** Get a product by ID */
|
|
2612
|
+
getById(id: number): Promise<FormattedProduct>;
|
|
2613
|
+
/** Create a new product */
|
|
2614
|
+
create(data: CreateProductRequest): Promise<FormattedProduct>;
|
|
2615
|
+
/** Update an existing product */
|
|
2616
|
+
update(id: number, data: Partial<CreateProductRequest>): Promise<FormattedProduct>;
|
|
2617
|
+
/** Delete a product by ID */
|
|
2618
|
+
delete(id: number): Promise<void>;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
558
2621
|
/**
|
|
559
2622
|
* Reports resource interface
|
|
560
2623
|
*/
|
|
@@ -655,6 +2718,15 @@ export declare interface ReturnCategory extends BaseEntity {
|
|
|
655
2718
|
active?: boolean;
|
|
656
2719
|
}
|
|
657
2720
|
|
|
2721
|
+
/** Return category entity */
|
|
2722
|
+
export declare interface ReturnCategoryEntity {
|
|
2723
|
+
id: number;
|
|
2724
|
+
category_name: string;
|
|
2725
|
+
clients?: unknown[];
|
|
2726
|
+
created_ts?: string;
|
|
2727
|
+
updated_ts?: string;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
658
2730
|
/**
|
|
659
2731
|
* Return Comment Entity
|
|
660
2732
|
*
|
|
@@ -722,6 +2794,15 @@ export declare interface ReturnReason extends BaseEntity {
|
|
|
722
2794
|
active?: boolean;
|
|
723
2795
|
}
|
|
724
2796
|
|
|
2797
|
+
/** Return source entity */
|
|
2798
|
+
export declare interface ReturnSourceEntity {
|
|
2799
|
+
id: number;
|
|
2800
|
+
alias?: string;
|
|
2801
|
+
status: boolean;
|
|
2802
|
+
created_ts?: string;
|
|
2803
|
+
updated_ts?: string;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
725
2806
|
/**
|
|
726
2807
|
* Filters for returns overview report
|
|
727
2808
|
*/
|
|
@@ -794,40 +2875,90 @@ export declare interface ReturnsReasonsFilters extends BaseFilters {
|
|
|
794
2875
|
export declare interface ReturnsResource {
|
|
795
2876
|
/** Query returns with filters */
|
|
796
2877
|
query(filters?: ReturnsQueryFilters): Promise<Return[]>;
|
|
2878
|
+
/** Query returns with HTTP query body */
|
|
2879
|
+
queryPost(query: HttpQueryRequest): Promise<Return[]>;
|
|
797
2880
|
/** Get a return by ID */
|
|
798
2881
|
getById(id: number, options?: {
|
|
799
2882
|
include_associations?: string;
|
|
800
2883
|
}): Promise<Return>;
|
|
801
2884
|
/** Create a new return (via helpers endpoint for portal access) */
|
|
802
2885
|
create(data: CreateReturnRequest): Promise<Return>;
|
|
803
|
-
/**
|
|
2886
|
+
/** Create a new return (authenticated, direct endpoint) */
|
|
2887
|
+
createDirect(data: Partial<Return>): Promise<Return>;
|
|
2888
|
+
/** Full update a return (PUT) */
|
|
2889
|
+
replace(returnId: number, data: Partial<Return>): Promise<Return>;
|
|
2890
|
+
/** Partial update a return (PATCH) */
|
|
804
2891
|
update(returnId: number, data: Partial<Return>): Promise<Return>;
|
|
805
2892
|
/** Delete a return */
|
|
806
2893
|
delete(returnId: number): Promise<void>;
|
|
807
|
-
/**
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
|
|
811
|
-
/** Remove a specific status from a return */
|
|
812
|
-
removeStatus(returnId: number, statusId: number): Promise<void>;
|
|
2894
|
+
/** Set approval status for a return */
|
|
2895
|
+
setApproval(returnId: number, approved: boolean): Promise<unknown>;
|
|
2896
|
+
/** View return email by reference */
|
|
2897
|
+
getEmail(ref: string): Promise<string>;
|
|
813
2898
|
/** Get return items for a return */
|
|
814
2899
|
getItems(returnId: number): Promise<ReturnItem[]>;
|
|
2900
|
+
/** Get a specific return item */
|
|
2901
|
+
getItemById(returnId: number, itemId: number): Promise<ReturnItem>;
|
|
815
2902
|
/** Add an item to a return */
|
|
816
2903
|
addItem(returnId: number, item: CreateReturnItemRequest): Promise<ReturnItem>;
|
|
817
2904
|
/** Update a return item */
|
|
818
2905
|
updateItem(returnId: number, itemId: number, data: Partial<ReturnItem>): Promise<ReturnItem>;
|
|
2906
|
+
/** Bulk update return items */
|
|
2907
|
+
updateItems(returnId: number, items: Partial<ReturnItem>[]): Promise<ReturnItem[]>;
|
|
2908
|
+
/** Get all statuses for a return */
|
|
2909
|
+
getStatuses(returnId: number): Promise<ReturnStatus[]>;
|
|
2910
|
+
/** Add a status to a return */
|
|
2911
|
+
addStatus(returnId: number, statusId: number): Promise<unknown>;
|
|
2912
|
+
/** Remove a specific status from a return */
|
|
2913
|
+
removeStatus(returnId: number, statusId: number): Promise<void>;
|
|
819
2914
|
/** Get comments for a return */
|
|
820
2915
|
getComments(returnId: number): Promise<ReturnComment[]>;
|
|
2916
|
+
/** Get a specific comment */
|
|
2917
|
+
getCommentById(returnId: number, commentId: number): Promise<ReturnComment>;
|
|
821
2918
|
/** Add a comment to a return */
|
|
822
2919
|
addComment(returnId: number, comment: string): Promise<ReturnComment>;
|
|
823
2920
|
/** Remove a comment from a return */
|
|
824
2921
|
removeComment(returnId: number, commentId: number): Promise<void>;
|
|
825
|
-
/**
|
|
826
|
-
setApproval(returnId: number, approved: boolean): Promise<unknown>;
|
|
827
|
-
/** Get all return reasons (reference data) */
|
|
2922
|
+
/** Get all return reasons */
|
|
828
2923
|
getReasons(): Promise<ReturnReason[]>;
|
|
829
|
-
/** Get
|
|
2924
|
+
/** Get a return reason by ID */
|
|
2925
|
+
getReasonById(id: number): Promise<ReturnReason>;
|
|
2926
|
+
/** Create a return reason */
|
|
2927
|
+
createReason(data: CreateReturnReasonRequest): Promise<ReturnReason>;
|
|
2928
|
+
/** Update a return reason */
|
|
2929
|
+
updateReason(id: number, data: Partial<CreateReturnReasonRequest>): Promise<ReturnReason>;
|
|
2930
|
+
/** Get all return statuses */
|
|
830
2931
|
getAllStatuses(): Promise<ReturnStatus[]>;
|
|
2932
|
+
/** Get a return status by ID */
|
|
2933
|
+
getStatusById(id: number): Promise<ReturnStatus>;
|
|
2934
|
+
/** Create a return status */
|
|
2935
|
+
createStatus(data: CreateReturnStatusRequest): Promise<ReturnStatus>;
|
|
2936
|
+
/** Update a return status */
|
|
2937
|
+
updateStatus(id: number, data: Partial<CreateReturnStatusRequest>): Promise<ReturnStatus>;
|
|
2938
|
+
/** Delete a return status */
|
|
2939
|
+
deleteStatus(id: number): Promise<void>;
|
|
2940
|
+
/** Get all return categories */
|
|
2941
|
+
getCategories(): Promise<ReturnCategoryEntity[]>;
|
|
2942
|
+
/** Get a return category by ID */
|
|
2943
|
+
getCategoryById(id: number): Promise<ReturnCategoryEntity>;
|
|
2944
|
+
/** Create a return category */
|
|
2945
|
+
createCategory(data: CreateReturnCategoryRequest): Promise<ReturnCategoryEntity>;
|
|
2946
|
+
/** Update a return category */
|
|
2947
|
+
updateCategory(id: number, data: Partial<CreateReturnCategoryRequest>): Promise<ReturnCategoryEntity>;
|
|
2948
|
+
/** Get all return sources */
|
|
2949
|
+
getSources(): Promise<ReturnSourceEntity[]>;
|
|
2950
|
+
/** Get a return source by ID */
|
|
2951
|
+
getSourceById(id: number): Promise<ReturnSourceEntity>;
|
|
2952
|
+
/** Create a return source */
|
|
2953
|
+
createSource(data: CreateReturnSourceRequest): Promise<ReturnSourceEntity>;
|
|
2954
|
+
/** Update a return source */
|
|
2955
|
+
updateSource(id: number, data: Partial<CreateReturnSourceRequest>): Promise<ReturnSourceEntity>;
|
|
2956
|
+
/** Delete a return source */
|
|
2957
|
+
deleteSource(id: number): Promise<void>;
|
|
2958
|
+
/** Get all return comments (global) */
|
|
2959
|
+
getAllComments(): Promise<ReturnComment[]>;
|
|
2960
|
+
/** Get a return comment by ID (global) */
|
|
2961
|
+
getGlobalCommentById(id: number): Promise<ReturnComment>;
|
|
831
2962
|
/** Get filter options for returns */
|
|
832
2963
|
getFilterOptions(clientId: number): Promise<FilterOptionsResponse>;
|
|
833
2964
|
}
|
|
@@ -944,6 +3075,230 @@ export declare interface SetReturnApprovalRequest {
|
|
|
944
3075
|
approve: boolean;
|
|
945
3076
|
}
|
|
946
3077
|
|
|
3078
|
+
/**
|
|
3079
|
+
* Order source entity
|
|
3080
|
+
*/
|
|
3081
|
+
declare interface Source {
|
|
3082
|
+
id: number;
|
|
3083
|
+
name?: string;
|
|
3084
|
+
[key: string]: unknown;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
/**
|
|
3088
|
+
* Stock Entity
|
|
3089
|
+
*
|
|
3090
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3091
|
+
*
|
|
3092
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/stock.entity.ts
|
|
3093
|
+
*/
|
|
3094
|
+
export declare interface Stock extends BaseEntity_2 {
|
|
3095
|
+
/** Foreign key to the client that owns this stock. */
|
|
3096
|
+
clientId?: number;
|
|
3097
|
+
/** Stock Keeping Unit code identifying the product. */
|
|
3098
|
+
sku_code?: string;
|
|
3099
|
+
/** Location code where this stock is held (e.g. "A-01-03-B"). */
|
|
3100
|
+
location?: string;
|
|
3101
|
+
/** Number of units of this SKU at this location. */
|
|
3102
|
+
quantity?: number;
|
|
3103
|
+
/** Batch or lot number for batch-tracked products. */
|
|
3104
|
+
batch_number?: string;
|
|
3105
|
+
/** Serial number for serial-tracked products. */
|
|
3106
|
+
serial_number?: string;
|
|
3107
|
+
/** ISO 8601 date string for the best-before/expiry date (used in FEFO rotation). */
|
|
3108
|
+
best_before_date?: string;
|
|
3109
|
+
/** ISO 8601 date string when this stock was received into the warehouse. */
|
|
3110
|
+
received_date?: string;
|
|
3111
|
+
/** Current quality/availability status of the stock. */
|
|
3112
|
+
stock_status: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
3113
|
+
/** Foreign key to the fulfilment centre holding this stock. */
|
|
3114
|
+
fulfilment_location_id?: number;
|
|
3115
|
+
/** Human-readable name of the fulfilment centre. */
|
|
3116
|
+
fulfilment_location_name?: string;
|
|
3117
|
+
/** ISO 3166-1 alpha-2 country code of the fulfilment centre (e.g. "GB", "US"). */
|
|
3118
|
+
fulfilment_location_country?: string;
|
|
3119
|
+
/** Free-text notes about this stock record (e.g. condition details, special handling). */
|
|
3120
|
+
notes?: string;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
/**
|
|
3124
|
+
* StockAllocation Entity
|
|
3125
|
+
*
|
|
3126
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3127
|
+
*
|
|
3128
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/allocation.entity.ts
|
|
3129
|
+
*/
|
|
3130
|
+
export declare interface StockAllocation extends BaseEntity_2 {
|
|
3131
|
+
/** Foreign key to the client this allocation belongs to. */
|
|
3132
|
+
clientId: number;
|
|
3133
|
+
/** Foreign key to the order this stock is allocated for. */
|
|
3134
|
+
order_id: number;
|
|
3135
|
+
/** SKU code of the product being allocated. */
|
|
3136
|
+
sku_code?: string;
|
|
3137
|
+
/** Total number of units allocated across all locations. */
|
|
3138
|
+
total_quantity: number;
|
|
3139
|
+
/** Breakdown of allocated stock by location. Keys are location codes, values contain quantity and stock details (e.g. `{ "A-01-03": { quantity: 5, stock_id: 42 } }`). */
|
|
3140
|
+
allocated_stock?: Record<string, unknown>;
|
|
3141
|
+
/** ISO 8601 date string until which the stock reservation is held. After this date the allocation may be released. */
|
|
3142
|
+
reserve_until?: string;
|
|
3143
|
+
/** ISO 8601 date string for when this allocation should be released for fulfilment. */
|
|
3144
|
+
nominated_release_date?: string;
|
|
3145
|
+
/** Whether the allocation is for immediate fulfilment or scheduled for a future date. */
|
|
3146
|
+
allocation_type: 'immediate' | 'future';
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
/**
|
|
3150
|
+
* Filters for stock allocations
|
|
3151
|
+
*/
|
|
3152
|
+
export declare interface StockAllocationsFilters extends ClientScopedPaginatedQueryFilters {
|
|
3153
|
+
/** Filter by order ID */
|
|
3154
|
+
orderId?: number;
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* Stock allocations resource interface
|
|
3159
|
+
*
|
|
3160
|
+
* Note: DELETE is intentionally not available for stock allocations.
|
|
3161
|
+
* Allocations should be updated or superseded rather than deleted.
|
|
3162
|
+
*/
|
|
3163
|
+
export declare interface StockAllocationsResource {
|
|
3164
|
+
/** Get all stock allocations with optional filters */
|
|
3165
|
+
getAll(filters?: StockAllocationsFilters): Promise<PaginatedListResponse<StockAllocation>>;
|
|
3166
|
+
/** Get a stock allocation by ID */
|
|
3167
|
+
getById(id: number): Promise<StockAllocation>;
|
|
3168
|
+
/** Create a new stock allocation */
|
|
3169
|
+
create(data: CreateStockAllocationRequest): Promise<StockAllocation>;
|
|
3170
|
+
/** Update an existing stock allocation */
|
|
3171
|
+
update(id: number, data: Partial<CreateStockAllocationRequest>): Promise<StockAllocation>;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
/**
|
|
3175
|
+
* Stocks resource interface
|
|
3176
|
+
*/
|
|
3177
|
+
export declare interface StocksResource {
|
|
3178
|
+
/** Get all stock records with optional filters */
|
|
3179
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Stock>>;
|
|
3180
|
+
/** Get a stock record by ID */
|
|
3181
|
+
getById(id: number): Promise<Stock>;
|
|
3182
|
+
/** Create a new stock record */
|
|
3183
|
+
create(data: CreateStockRequest): Promise<Stock>;
|
|
3184
|
+
/** Update an existing stock record */
|
|
3185
|
+
update(id: number, data: Partial<CreateStockRequest>): Promise<Stock>;
|
|
3186
|
+
/** Delete a stock record by ID */
|
|
3187
|
+
delete(id: number): Promise<void>;
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
/**
|
|
3191
|
+
* StockTransaction Entity
|
|
3192
|
+
*
|
|
3193
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3194
|
+
*
|
|
3195
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/transaction.entity.ts
|
|
3196
|
+
*/
|
|
3197
|
+
export declare interface StockTransaction extends BaseEntity_2 {
|
|
3198
|
+
/** Foreign key to the client this transaction belongs to. */
|
|
3199
|
+
clientId: number;
|
|
3200
|
+
/** Type of stock movement that occurred. */
|
|
3201
|
+
transaction_type: 'goods_in' | 'goods_out' | 'adjustment' | 'transfer' | 'return' | 'damage' | 'expiry';
|
|
3202
|
+
/** Foreign key to the stock record affected by this transaction. */
|
|
3203
|
+
stock_id: number;
|
|
3204
|
+
/** SKU code of the product involved in this transaction. */
|
|
3205
|
+
sku_code?: string;
|
|
3206
|
+
/** Number of units moved in this transaction (positive = in, negative = out). */
|
|
3207
|
+
quantity?: number;
|
|
3208
|
+
/** Stock quantity at the location before this transaction was applied. */
|
|
3209
|
+
quantity_before?: number;
|
|
3210
|
+
/** Stock quantity at the location after this transaction was applied. */
|
|
3211
|
+
quantity_after?: number;
|
|
3212
|
+
/** Location code the stock was moved from (for transfers and goods_out). */
|
|
3213
|
+
location_from?: string;
|
|
3214
|
+
/** Location code the stock was moved to (for transfers and goods_in). */
|
|
3215
|
+
location_to?: string;
|
|
3216
|
+
/** Batch or lot number of the stock involved. */
|
|
3217
|
+
batch_number?: string;
|
|
3218
|
+
/** Serial number of the stock involved. */
|
|
3219
|
+
serial_number?: string;
|
|
3220
|
+
/** Standardised reason code for the transaction (e.g. "DAMAGED", "CYCLE_COUNT_ADJ", "CUSTOMER_RETURN"). */
|
|
3221
|
+
reason_code?: string;
|
|
3222
|
+
/** Human-readable description of the reason for this transaction. */
|
|
3223
|
+
reason_description?: string;
|
|
3224
|
+
/** External reference tying this transaction to an order, ASN, or return (e.g. order ID, ASN number). */
|
|
3225
|
+
reference_number?: string;
|
|
3226
|
+
/** Unit value of the stock in GBP at the time of the transaction. */
|
|
3227
|
+
price_gbp?: number;
|
|
3228
|
+
/** Foreign key to the IMS validation record that authorised this transaction. Null if no validation was required. */
|
|
3229
|
+
ims_validation_id?: number;
|
|
3230
|
+
/** System that originated this transaction. */
|
|
3231
|
+
source_system: 'ims_ui' | 'ims_api' | 'mobile_app' | 'asn' | 'oms' | 'cycle_count';
|
|
3232
|
+
/** Foreign key to the user who performed this transaction. */
|
|
3233
|
+
performed_by?: number;
|
|
3234
|
+
/** Whether the stock record was created, updated, or soft-deleted by this transaction. */
|
|
3235
|
+
action: 'created' | 'updated' | 'deleted';
|
|
3236
|
+
/** Free-text notes providing additional context for this transaction. */
|
|
3237
|
+
notes?: string;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
/**
|
|
3241
|
+
* Filters for stock transactions
|
|
3242
|
+
*/
|
|
3243
|
+
export declare interface StockTransactionsFilters extends ClientScopedPaginatedQueryFilters {
|
|
3244
|
+
/** Filter by stock record ID */
|
|
3245
|
+
stockId?: number;
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Stock transactions resource interface
|
|
3250
|
+
*/
|
|
3251
|
+
export declare interface StockTransactionsResource {
|
|
3252
|
+
/** Get all stock transactions with optional filters */
|
|
3253
|
+
getAll(filters?: StockTransactionsFilters): Promise<PaginatedListResponse<StockTransaction>>;
|
|
3254
|
+
/** Get a stock transaction by ID */
|
|
3255
|
+
getById(id: number): Promise<StockTransaction>;
|
|
3256
|
+
/** Create a new stock transaction */
|
|
3257
|
+
create(data: CreateStockTransactionRequest): Promise<StockTransaction>;
|
|
3258
|
+
/** Update an existing stock transaction */
|
|
3259
|
+
update(id: number, data: Partial<CreateStockTransactionRequest>): Promise<StockTransaction>;
|
|
3260
|
+
/** Delete a stock transaction by ID */
|
|
3261
|
+
delete(id: number): Promise<void>;
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
/** Task history entity from the API */
|
|
3265
|
+
export declare interface TaskHistoryEntity {
|
|
3266
|
+
id: number;
|
|
3267
|
+
task?: string;
|
|
3268
|
+
uuid?: string;
|
|
3269
|
+
clientName?: string;
|
|
3270
|
+
userName?: string;
|
|
3271
|
+
clientId?: number;
|
|
3272
|
+
integrationName?: string;
|
|
3273
|
+
progress?: number;
|
|
3274
|
+
endpoint?: string;
|
|
3275
|
+
method?: string;
|
|
3276
|
+
payload?: Record<string, unknown>;
|
|
3277
|
+
result?: Record<string, unknown>;
|
|
3278
|
+
created_ts?: string;
|
|
3279
|
+
updated_ts?: string;
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
/**
|
|
3283
|
+
* Filters for task histories
|
|
3284
|
+
*/
|
|
3285
|
+
export declare interface TaskHistoryFilters {
|
|
3286
|
+
/** Filter by date from */
|
|
3287
|
+
date_from?: string;
|
|
3288
|
+
/** Filter by date to */
|
|
3289
|
+
date_to?: string;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
/**
|
|
3293
|
+
* Tasks resource interface
|
|
3294
|
+
*/
|
|
3295
|
+
export declare interface TasksResource {
|
|
3296
|
+
/** Get task history by UUID */
|
|
3297
|
+
getByUuid(uuid: string): Promise<TaskHistoryEntity>;
|
|
3298
|
+
/** Get task histories with optional date filters */
|
|
3299
|
+
getAll(filters?: TaskHistoryFilters): Promise<TaskHistoryEntity[]>;
|
|
3300
|
+
}
|
|
3301
|
+
|
|
947
3302
|
/**
|
|
948
3303
|
* Error thrown when authentication fails (401)
|
|
949
3304
|
*/
|
|
@@ -951,6 +3306,22 @@ export declare class UnauthorizedError extends JanusApiError {
|
|
|
951
3306
|
constructor(message?: string, response?: unknown);
|
|
952
3307
|
}
|
|
953
3308
|
|
|
3309
|
+
/**
|
|
3310
|
+
* Data for updating an ASN line
|
|
3311
|
+
*/
|
|
3312
|
+
export declare interface UpdateAsnLineRequest extends Partial<Omit<CreateAsnLineRequest, 'client_id'>> {
|
|
3313
|
+
/** Client ID */
|
|
3314
|
+
client_id: number;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
/**
|
|
3318
|
+
* Data for updating an ASN receipt
|
|
3319
|
+
*/
|
|
3320
|
+
export declare interface UpdateAsnReceiptRequest extends Partial<Omit<CreateAsnReceiptRequest, 'client_id' | 'asn_id' | 'asn_line_id'>> {
|
|
3321
|
+
/** Client ID */
|
|
3322
|
+
client_id: number;
|
|
3323
|
+
}
|
|
3324
|
+
|
|
954
3325
|
/**
|
|
955
3326
|
* Data for updating a client
|
|
956
3327
|
*/
|
|
@@ -975,6 +3346,28 @@ export declare interface UpdateClientRequest {
|
|
|
975
3346
|
active?: boolean;
|
|
976
3347
|
}
|
|
977
3348
|
|
|
3349
|
+
/**
|
|
3350
|
+
* Data for updating an invoice line
|
|
3351
|
+
*/
|
|
3352
|
+
export declare interface UpdateInvoiceLineRequest extends Partial<Omit<CreateInvoiceLineRequest, 'client_id'>> {
|
|
3353
|
+
/** Client ID */
|
|
3354
|
+
client_id: number;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
/**
|
|
3358
|
+
* Data for updating a user
|
|
3359
|
+
*/
|
|
3360
|
+
export declare interface UpdateUserRequest {
|
|
3361
|
+
/** User ID */
|
|
3362
|
+
id: number;
|
|
3363
|
+
/** First name */
|
|
3364
|
+
firstname?: string;
|
|
3365
|
+
/** Last name */
|
|
3366
|
+
lastname?: string;
|
|
3367
|
+
/** Password */
|
|
3368
|
+
password?: string;
|
|
3369
|
+
}
|
|
3370
|
+
|
|
978
3371
|
/**
|
|
979
3372
|
* Data for uploading a file
|
|
980
3373
|
*/
|
|
@@ -1025,6 +3418,53 @@ export declare interface UserClientAccess {
|
|
|
1025
3418
|
name: string;
|
|
1026
3419
|
}
|
|
1027
3420
|
|
|
3421
|
+
/**
|
|
3422
|
+
* Filters for user list
|
|
3423
|
+
*/
|
|
3424
|
+
export declare interface UsersListFilters extends PaginatedQueryFilters {
|
|
3425
|
+
/** Filter by role */
|
|
3426
|
+
filterRole?: string;
|
|
3427
|
+
/** Filter by user type */
|
|
3428
|
+
filterType?: string;
|
|
3429
|
+
/** Filter by assigned client ID */
|
|
3430
|
+
filterClientId?: number;
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* Users resource interface
|
|
3435
|
+
*/
|
|
3436
|
+
export declare interface UsersResource {
|
|
3437
|
+
/** Get all users with optional pagination and search filters */
|
|
3438
|
+
getAll(filters?: UsersListFilters): Promise<PaginatedListResponse<User>>;
|
|
3439
|
+
/** Get a single user by their numeric ID */
|
|
3440
|
+
getById(id: number): Promise<User>;
|
|
3441
|
+
/** Create a new user account with the required registration fields */
|
|
3442
|
+
create(data: CreateUserRequest): Promise<User>;
|
|
3443
|
+
/** Partially update a user (PATCH). Only the provided fields will be changed. */
|
|
3444
|
+
update(data: UpdateUserRequest): Promise<User>;
|
|
3445
|
+
/**
|
|
3446
|
+
* Fully replace a user record (PUT).
|
|
3447
|
+
* All user fields should be provided in the data object, including:
|
|
3448
|
+
* `username`, `firstname`, `lastname`, `email`, `partition_id`, and any
|
|
3449
|
+
* other user-level properties. Omitted fields may be reset to defaults.
|
|
3450
|
+
*/
|
|
3451
|
+
replace(id: number, data: Record<string, unknown>): Promise<User>;
|
|
3452
|
+
/** Delete a user by ID */
|
|
3453
|
+
delete(id: number): Promise<void>;
|
|
3454
|
+
/**
|
|
3455
|
+
* Change the authenticated user's password.
|
|
3456
|
+
* The request body should contain the current password and the new password
|
|
3457
|
+
* (see {@link ChangePasswordRequest}).
|
|
3458
|
+
*/
|
|
3459
|
+
changePassword(data: ChangePasswordRequest): Promise<void>;
|
|
3460
|
+
/**
|
|
3461
|
+
* Complete a password reset using a token/link string.
|
|
3462
|
+
* The `link` parameter is the password-reset token received via email,
|
|
3463
|
+
* which the server validates to authorize the reset.
|
|
3464
|
+
*/
|
|
3465
|
+
resetPassword(link: string): Promise<void>;
|
|
3466
|
+
}
|
|
3467
|
+
|
|
1028
3468
|
/**
|
|
1029
3469
|
* Error thrown for validation errors (400)
|
|
1030
3470
|
*/
|