@microboxlabs/miot-calendar-client 0.5.0 → 0.8.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/README.md +15 -0
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -122,6 +122,7 @@ Create a new calendar.
|
|
|
122
122
|
| `active` | `boolean` | No | `true` | Whether the calendar is active |
|
|
123
123
|
| `parallelism` | `number` | No | `1` | Parallel resources per slot (e.g. loading docks) |
|
|
124
124
|
| `groups` | `string[]` | No | — | Group codes to assign. `null` = no change; `[]` = remove all; `["code"]` = replace all |
|
|
125
|
+
| `filter` | [`CalendarFilter`](#calendarfilter) | No | — | Task filter map (`origin?`, `destination?`). `null` = no change; `{}` = clear; populated = replace |
|
|
125
126
|
|
|
126
127
|
**Returns:** `CalendarResponse`
|
|
127
128
|
|
|
@@ -176,6 +177,7 @@ Create a time window within a calendar.
|
|
|
176
177
|
| `capacity` | `number` | No | `1` | Total number of services this window can handle across all slots |
|
|
177
178
|
| `daysOfWeek` | `string` | No | — | Comma-separated days (1=Mon … 7=Sun) |
|
|
178
179
|
| `active` | `boolean` | No | `true` | Whether the time window is active |
|
|
180
|
+
| `color` | `string` | No | — | UI color token (e.g., `"emerald"`, `"amber"`) |
|
|
179
181
|
|
|
180
182
|
**Returns:** `TimeWindowResponse`
|
|
181
183
|
|
|
@@ -529,9 +531,21 @@ interface CalendarRequest {
|
|
|
529
531
|
active?: boolean; // Active status (default: true)
|
|
530
532
|
parallelism?: number; // Parallel resources per slot (default: 1, e.g. loading docks)
|
|
531
533
|
groups?: string[]; // Group codes to assign. null = no change; [] = remove all; ["code"] = replace all
|
|
534
|
+
filter?: CalendarFilter; // Optional task filter. null = no change; {} = clear; populated = replace
|
|
532
535
|
}
|
|
533
536
|
```
|
|
534
537
|
|
|
538
|
+
### `CalendarFilter`
|
|
539
|
+
|
|
540
|
+
```ts
|
|
541
|
+
interface CalendarFilter {
|
|
542
|
+
origin?: string; // Origin delegate code (e.g., "ANF")
|
|
543
|
+
destination?: string; // Destination delegate code
|
|
544
|
+
}
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
Optional map persisted on a calendar so client UIs can constrain task lists tied to that calendar. Both keys are optional; when both are set, the backend AND-combines them.
|
|
548
|
+
|
|
535
549
|
### `CalendarResponse`
|
|
536
550
|
|
|
537
551
|
```ts
|
|
@@ -546,6 +560,7 @@ interface CalendarResponse {
|
|
|
546
560
|
createdAt: string; // ISO 8601
|
|
547
561
|
updatedAt: string; // ISO 8601
|
|
548
562
|
groups?: CalendarGroupResponse[]; // Groups this calendar belongs to
|
|
563
|
+
filter?: CalendarFilter; // Optional task filter (origin / destination delegate codes)
|
|
549
564
|
}
|
|
550
565
|
```
|
|
551
566
|
|
package/dist/index.d.mts
CHANGED
|
@@ -42,6 +42,10 @@ interface CalendarGroupResponse {
|
|
|
42
42
|
createdAt: string;
|
|
43
43
|
updatedAt: string;
|
|
44
44
|
}
|
|
45
|
+
interface CalendarFilter {
|
|
46
|
+
origin?: string;
|
|
47
|
+
destination?: string;
|
|
48
|
+
}
|
|
45
49
|
interface CalendarRequest {
|
|
46
50
|
code: string;
|
|
47
51
|
name: string;
|
|
@@ -50,6 +54,7 @@ interface CalendarRequest {
|
|
|
50
54
|
active?: boolean;
|
|
51
55
|
parallelism?: number;
|
|
52
56
|
groups?: string[];
|
|
57
|
+
filter?: CalendarFilter;
|
|
53
58
|
autoSlotManager?: boolean;
|
|
54
59
|
}
|
|
55
60
|
interface CalendarResponse {
|
|
@@ -63,8 +68,18 @@ interface CalendarResponse {
|
|
|
63
68
|
createdAt: string;
|
|
64
69
|
updatedAt: string;
|
|
65
70
|
groups?: CalendarGroupResponse[];
|
|
71
|
+
filter?: CalendarFilter;
|
|
66
72
|
hasSlotManager?: boolean;
|
|
67
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Discriminator for a time window.
|
|
76
|
+
*
|
|
77
|
+
* - `WINDOW` — bookable period with a capacity quota (the historical default).
|
|
78
|
+
* - `BLOCK` — non-bookable period (holiday, maintenance, manual closure);
|
|
79
|
+
* slot generation produces CLOSED slots so the planning UI can paint them
|
|
80
|
+
* and the backend rejects bookings against them.
|
|
81
|
+
*/
|
|
82
|
+
type TimeWindowKind = "WINDOW" | "BLOCK";
|
|
68
83
|
interface TimeWindowRequest {
|
|
69
84
|
name: string;
|
|
70
85
|
startHour: number;
|
|
@@ -74,6 +89,9 @@ interface TimeWindowRequest {
|
|
|
74
89
|
daysOfWeek?: string;
|
|
75
90
|
validTo?: string;
|
|
76
91
|
active?: boolean;
|
|
92
|
+
color?: string;
|
|
93
|
+
/** Defaults to `WINDOW` server-side when omitted. */
|
|
94
|
+
kind?: TimeWindowKind;
|
|
77
95
|
}
|
|
78
96
|
interface TimeWindowResponse {
|
|
79
97
|
id: string;
|
|
@@ -87,6 +105,8 @@ interface TimeWindowResponse {
|
|
|
87
105
|
validFrom: string;
|
|
88
106
|
validTo?: string;
|
|
89
107
|
active: boolean;
|
|
108
|
+
color?: string;
|
|
109
|
+
kind: TimeWindowKind;
|
|
90
110
|
createdAt: string;
|
|
91
111
|
updatedAt: string;
|
|
92
112
|
}
|
|
@@ -245,4 +265,4 @@ declare class MiotCalendarApiError extends Error {
|
|
|
245
265
|
constructor(status: number, body: ErrorResponse | string);
|
|
246
266
|
}
|
|
247
267
|
|
|
248
|
-
export { type BookingListResponse, type BookingRequest, type BookingResponse, type CalendarGroupRequest, type CalendarGroupResponse, type CalendarRequest, type CalendarResponse, type ClientConfig, type ErrorResponse, type GenerateSlotsRequest, type GenerateSlotsResponse, MiotCalendarApiError, type ResourceData, type SlotData, type SlotListResponse, type SlotManagerRequest, type SlotManagerResponse, type SlotManagerRunResponse, type SlotResponse, type SlotStatus, type TimeWindowRequest, type TimeWindowResponse, type UpdateSlotStatusRequest, createMiotCalendarClient };
|
|
268
|
+
export { type BookingListResponse, type BookingRequest, type BookingResponse, type CalendarFilter, type CalendarGroupRequest, type CalendarGroupResponse, type CalendarRequest, type CalendarResponse, type ClientConfig, type ErrorResponse, type GenerateSlotsRequest, type GenerateSlotsResponse, MiotCalendarApiError, type ResourceData, type SlotData, type SlotListResponse, type SlotManagerRequest, type SlotManagerResponse, type SlotManagerRunResponse, type SlotResponse, type SlotStatus, type TimeWindowKind, type TimeWindowRequest, type TimeWindowResponse, type UpdateSlotStatusRequest, createMiotCalendarClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ interface CalendarGroupResponse {
|
|
|
42
42
|
createdAt: string;
|
|
43
43
|
updatedAt: string;
|
|
44
44
|
}
|
|
45
|
+
interface CalendarFilter {
|
|
46
|
+
origin?: string;
|
|
47
|
+
destination?: string;
|
|
48
|
+
}
|
|
45
49
|
interface CalendarRequest {
|
|
46
50
|
code: string;
|
|
47
51
|
name: string;
|
|
@@ -50,6 +54,7 @@ interface CalendarRequest {
|
|
|
50
54
|
active?: boolean;
|
|
51
55
|
parallelism?: number;
|
|
52
56
|
groups?: string[];
|
|
57
|
+
filter?: CalendarFilter;
|
|
53
58
|
autoSlotManager?: boolean;
|
|
54
59
|
}
|
|
55
60
|
interface CalendarResponse {
|
|
@@ -63,8 +68,18 @@ interface CalendarResponse {
|
|
|
63
68
|
createdAt: string;
|
|
64
69
|
updatedAt: string;
|
|
65
70
|
groups?: CalendarGroupResponse[];
|
|
71
|
+
filter?: CalendarFilter;
|
|
66
72
|
hasSlotManager?: boolean;
|
|
67
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Discriminator for a time window.
|
|
76
|
+
*
|
|
77
|
+
* - `WINDOW` — bookable period with a capacity quota (the historical default).
|
|
78
|
+
* - `BLOCK` — non-bookable period (holiday, maintenance, manual closure);
|
|
79
|
+
* slot generation produces CLOSED slots so the planning UI can paint them
|
|
80
|
+
* and the backend rejects bookings against them.
|
|
81
|
+
*/
|
|
82
|
+
type TimeWindowKind = "WINDOW" | "BLOCK";
|
|
68
83
|
interface TimeWindowRequest {
|
|
69
84
|
name: string;
|
|
70
85
|
startHour: number;
|
|
@@ -74,6 +89,9 @@ interface TimeWindowRequest {
|
|
|
74
89
|
daysOfWeek?: string;
|
|
75
90
|
validTo?: string;
|
|
76
91
|
active?: boolean;
|
|
92
|
+
color?: string;
|
|
93
|
+
/** Defaults to `WINDOW` server-side when omitted. */
|
|
94
|
+
kind?: TimeWindowKind;
|
|
77
95
|
}
|
|
78
96
|
interface TimeWindowResponse {
|
|
79
97
|
id: string;
|
|
@@ -87,6 +105,8 @@ interface TimeWindowResponse {
|
|
|
87
105
|
validFrom: string;
|
|
88
106
|
validTo?: string;
|
|
89
107
|
active: boolean;
|
|
108
|
+
color?: string;
|
|
109
|
+
kind: TimeWindowKind;
|
|
90
110
|
createdAt: string;
|
|
91
111
|
updatedAt: string;
|
|
92
112
|
}
|
|
@@ -245,4 +265,4 @@ declare class MiotCalendarApiError extends Error {
|
|
|
245
265
|
constructor(status: number, body: ErrorResponse | string);
|
|
246
266
|
}
|
|
247
267
|
|
|
248
|
-
export { type BookingListResponse, type BookingRequest, type BookingResponse, type CalendarGroupRequest, type CalendarGroupResponse, type CalendarRequest, type CalendarResponse, type ClientConfig, type ErrorResponse, type GenerateSlotsRequest, type GenerateSlotsResponse, MiotCalendarApiError, type ResourceData, type SlotData, type SlotListResponse, type SlotManagerRequest, type SlotManagerResponse, type SlotManagerRunResponse, type SlotResponse, type SlotStatus, type TimeWindowRequest, type TimeWindowResponse, type UpdateSlotStatusRequest, createMiotCalendarClient };
|
|
268
|
+
export { type BookingListResponse, type BookingRequest, type BookingResponse, type CalendarFilter, type CalendarGroupRequest, type CalendarGroupResponse, type CalendarRequest, type CalendarResponse, type ClientConfig, type ErrorResponse, type GenerateSlotsRequest, type GenerateSlotsResponse, MiotCalendarApiError, type ResourceData, type SlotData, type SlotListResponse, type SlotManagerRequest, type SlotManagerResponse, type SlotManagerRunResponse, type SlotResponse, type SlotStatus, type TimeWindowKind, type TimeWindowRequest, type TimeWindowResponse, type UpdateSlotStatusRequest, createMiotCalendarClient };
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microboxlabs/miot-calendar-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/microboxlabs/modulariot",
|
|
8
8
|
"directory": "packages/miot-calendar-client"
|
|
9
9
|
},
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
15
|
"import": {
|