@scanlab/api-types 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scanlab-api.d.ts +284 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scanlab/api-types",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "TypeScript types for the ScanLab API",
5
5
  "main": "scanlab-api.d.ts",
6
6
  "types": "scanlab-api.d.ts",
package/scanlab-api.d.ts CHANGED
@@ -63,6 +63,94 @@ export interface paths {
63
63
  patch?: never;
64
64
  trace?: never;
65
65
  };
66
+ "/admin/orders": {
67
+ parameters: {
68
+ query?: never;
69
+ header?: never;
70
+ path?: never;
71
+ cookie?: never;
72
+ };
73
+ /** Retrieves all orders, with all fields */
74
+ get: operations["adminGetOrders"];
75
+ put?: never;
76
+ post?: never;
77
+ delete?: never;
78
+ options?: never;
79
+ head?: never;
80
+ patch?: never;
81
+ trace?: never;
82
+ };
83
+ "/admin/orders/{code}": {
84
+ parameters: {
85
+ query?: never;
86
+ header?: never;
87
+ path: {
88
+ /** @description The unique code of the order */
89
+ code: string;
90
+ };
91
+ cookie?: never;
92
+ };
93
+ /** Retrieves a specific order by its code, with all fields */
94
+ get: operations["adminGetOrder"];
95
+ put?: never;
96
+ post?: never;
97
+ delete?: never;
98
+ options?: never;
99
+ head?: never;
100
+ patch?: never;
101
+ trace?: never;
102
+ };
103
+ "/admin/orders/status": {
104
+ parameters: {
105
+ query?: never;
106
+ header?: never;
107
+ path?: never;
108
+ cookie?: never;
109
+ };
110
+ get?: never;
111
+ put?: never;
112
+ post?: never;
113
+ delete?: never;
114
+ options?: never;
115
+ head?: never;
116
+ /** Updates the status of an order */
117
+ patch: operations["adminUpdateOrderStatus"];
118
+ trace?: never;
119
+ };
120
+ "/admin/orders/image-count": {
121
+ parameters: {
122
+ query?: never;
123
+ header?: never;
124
+ path?: never;
125
+ cookie?: never;
126
+ };
127
+ get?: never;
128
+ put?: never;
129
+ post?: never;
130
+ delete?: never;
131
+ options?: never;
132
+ head?: never;
133
+ /** Updates the image count for an order */
134
+ patch: operations["updateOrderImageCount"];
135
+ trace?: never;
136
+ };
137
+ "/admin/orders/download-link": {
138
+ parameters: {
139
+ query?: never;
140
+ header?: never;
141
+ path?: never;
142
+ cookie?: never;
143
+ };
144
+ get?: never;
145
+ put?: never;
146
+ post?: never;
147
+ delete?: never;
148
+ options?: never;
149
+ head?: never;
150
+ /** Updates the image count for an order */
151
+ patch: operations["updateOrderImageCount"];
152
+ trace?: never;
153
+ };
66
154
  }
67
155
  export type webhooks = Record<string, never>;
68
156
  export interface components {
@@ -75,7 +163,6 @@ export interface components {
75
163
  * - `completed`: Film has been digitalized
76
164
  * - `paid`: Order has been paid
77
165
  * - `cancelled`: Order cancelled
78
- *
79
166
  * @example pending
80
167
  * @enum {string}
81
168
  */
@@ -94,6 +181,12 @@ export interface components {
94
181
  * @example 2025-04-05T10:30:00Z
95
182
  */
96
183
  createdAt: string;
184
+ /**
185
+ * Format: date-time
186
+ * @description ISO 8601 timestamp of when the order was updated
187
+ * @example 2025-04-05T10:30:00Z
188
+ */
189
+ updatedAt?: string;
97
190
  /**
98
191
  * Format: float
99
192
  * @description Price of the order (optional)
@@ -101,11 +194,26 @@ export interface components {
101
194
  */
102
195
  price?: number;
103
196
  /**
104
- * Format: date-time
105
- * @description ISO 8601 timestamp of payment (optional)
106
- * @example 2025-04-10T14:00:00Z
197
+ * @description Number of images in the order (optional)
198
+ * @example 5
199
+ */
200
+ imageCount?: number;
201
+ /**
202
+ * @description Whether a discount was applied to the order
203
+ * @example true
204
+ */
205
+ withDiscount?: boolean | null;
206
+ /**
207
+ * Format: uri
208
+ * @description Link to download the digitalized images
209
+ * @example https://example.com/download/ATX-B2C
107
210
  */
108
- paidAt?: string;
211
+ downloadLink?: string | null;
212
+ /**
213
+ * @description The final price after applying the discount (optional)
214
+ * @example 10
215
+ */
216
+ discountedPrice?: number | null;
109
217
  };
110
218
  /** @description Data Transfer Object for an order's status history */
111
219
  OrderStatusHistoryDto: {
@@ -126,6 +234,11 @@ export interface components {
126
234
  value?: unknown;
127
235
  };
128
236
  ErrorResponse: {
237
+ /**
238
+ * @description HTTP status code of the error
239
+ * @example 404
240
+ */
241
+ status?: number;
129
242
  /**
130
243
  * @description Application-specific error code
131
244
  * @example ORDER_NOT_FOUND
@@ -330,4 +443,170 @@ export interface operations {
330
443
  };
331
444
  };
332
445
  };
446
+ adminGetOrders: {
447
+ parameters: {
448
+ query?: never;
449
+ header?: never;
450
+ path?: never;
451
+ cookie?: never;
452
+ };
453
+ requestBody?: never;
454
+ responses: {
455
+ /** @description A list of all orders */
456
+ 200: {
457
+ headers: {
458
+ [name: string]: unknown;
459
+ };
460
+ content: {
461
+ "application/json": components["schemas"]["OrderDto"][];
462
+ };
463
+ };
464
+ };
465
+ };
466
+ adminGetOrder: {
467
+ parameters: {
468
+ query?: never;
469
+ header?: never;
470
+ path: {
471
+ /** @description The unique code of the order */
472
+ code: string;
473
+ };
474
+ cookie?: never;
475
+ };
476
+ requestBody?: never;
477
+ responses: {
478
+ /** @description Successful query, returns the order details */
479
+ 200: {
480
+ headers: {
481
+ [name: string]: unknown;
482
+ };
483
+ content: {
484
+ "application/json": components["schemas"]["OrderDto"];
485
+ };
486
+ };
487
+ /** @description Order with the given code not found */
488
+ 404: {
489
+ headers: {
490
+ [name: string]: unknown;
491
+ };
492
+ content: {
493
+ "application/json": components["schemas"]["ErrorResponse"];
494
+ };
495
+ };
496
+ };
497
+ };
498
+ adminUpdateOrderStatus: {
499
+ parameters: {
500
+ query?: never;
501
+ header?: never;
502
+ path?: never;
503
+ cookie?: never;
504
+ };
505
+ /** @description Object containing the order code and new status */
506
+ requestBody: {
507
+ content: {
508
+ "application/json": {
509
+ /**
510
+ * @description Unique code of the order
511
+ * @example ATX-B2C
512
+ */
513
+ code: string;
514
+ status: components["schemas"]["OrderStatus"];
515
+ };
516
+ };
517
+ };
518
+ responses: {
519
+ /** @description Order status successfully updated */
520
+ 200: {
521
+ headers: {
522
+ [name: string]: unknown;
523
+ };
524
+ content: {
525
+ "application/json": {
526
+ /** @example Order status updated successfully */
527
+ message?: string;
528
+ };
529
+ };
530
+ };
531
+ };
532
+ };
533
+ updateOrderImageCount: {
534
+ parameters: {
535
+ query?: never;
536
+ header?: never;
537
+ path?: never;
538
+ cookie?: never;
539
+ };
540
+ /** @description Object containing the order code and new image count */
541
+ requestBody: {
542
+ content: {
543
+ "application/json": {
544
+ /**
545
+ * @description Unique code of the order
546
+ * @example ATX-B2C
547
+ */
548
+ code: string;
549
+ /**
550
+ * @description New image count for the order
551
+ * @example 10
552
+ */
553
+ imageCount: number;
554
+ };
555
+ };
556
+ };
557
+ responses: {
558
+ /** @description Image count successfully updated */
559
+ 200: {
560
+ headers: {
561
+ [name: string]: unknown;
562
+ };
563
+ content: {
564
+ "application/json": {
565
+ /** @example Order image count updated successfully */
566
+ message?: string;
567
+ };
568
+ };
569
+ };
570
+ };
571
+ };
572
+ updateOrderImageCount: {
573
+ parameters: {
574
+ query?: never;
575
+ header?: never;
576
+ path?: never;
577
+ cookie?: never;
578
+ };
579
+ /** @description Object containing the order code and new image count */
580
+ requestBody: {
581
+ content: {
582
+ "application/json": {
583
+ /**
584
+ * @description Unique code of the order
585
+ * @example ATX-B2C
586
+ */
587
+ code: string;
588
+ /**
589
+ * Format: uri
590
+ * @description New download link for the order
591
+ * @example https://example.com/download/ATX-B2C
592
+ */
593
+ downloadLink?: string;
594
+ };
595
+ };
596
+ };
597
+ responses: {
598
+ /** @description Image count successfully updated */
599
+ 200: {
600
+ headers: {
601
+ [name: string]: unknown;
602
+ };
603
+ content: {
604
+ "application/json": {
605
+ /** @example Order download link updated successfully */
606
+ message?: string;
607
+ };
608
+ };
609
+ };
610
+ };
611
+ };
333
612
  }