@microboxlabs/miot-calendar-client 0.4.1 → 0.7.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 +24 -9
- package/dist/index.d.mts +13 -4
- package/dist/index.d.ts +13 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -29,15 +29,14 @@ const calendar = await client.calendars.create({
|
|
|
29
29
|
timezone: "America/New_York", // defaults to "UTC" if omitted
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
// 2. Add a time window (Mon–Fri, 8 AM – 5 PM
|
|
32
|
+
// 2. Add a time window (Mon–Fri, 8 AM – 5 PM)
|
|
33
33
|
const timeWindow = await client.calendars.createTimeWindow(calendar.id, {
|
|
34
34
|
name: "Business Hours",
|
|
35
35
|
startHour: 8,
|
|
36
36
|
endHour: 17,
|
|
37
37
|
validFrom: "2026-03-01",
|
|
38
38
|
daysOfWeek: "1,2,3,4,5", // Mon–Fri
|
|
39
|
-
|
|
40
|
-
capacityPerSlot: 2, // default: 1
|
|
39
|
+
capacity: 2, // default: 1
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
// 3. Generate slots for the first two weeks
|
|
@@ -121,7 +120,9 @@ Create a new calendar.
|
|
|
121
120
|
| `description` | `string` | No | — | Optional description |
|
|
122
121
|
| `timezone` | `string` | No | `"UTC"` | IANA timezone |
|
|
123
122
|
| `active` | `boolean` | No | `true` | Whether the calendar is active |
|
|
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
|
|
|
@@ -173,10 +174,10 @@ Create a time window within a calendar.
|
|
|
173
174
|
| `endHour` | `number` | Yes | — | End hour (0–23, must be > startHour) |
|
|
174
175
|
| `validFrom` | `string` | Yes | — | Start date (`YYYY-MM-DD`) |
|
|
175
176
|
| `validTo` | `string` | No | — | End date (`YYYY-MM-DD`) |
|
|
176
|
-
| `
|
|
177
|
-
| `capacityPerSlot` | `number` | No | `1` | Max bookings per slot |
|
|
177
|
+
| `capacity` | `number` | No | `1` | Total number of services this window can handle across all slots |
|
|
178
178
|
| `daysOfWeek` | `string` | No | — | Comma-separated days (1=Mon … 7=Sun) |
|
|
179
179
|
| `active` | `boolean` | No | `true` | Whether the time window is active |
|
|
180
|
+
| `color` | `string` | No | — | UI color token (e.g., `"emerald"`, `"amber"`) |
|
|
180
181
|
|
|
181
182
|
**Returns:** `TimeWindowResponse`
|
|
182
183
|
|
|
@@ -528,10 +529,23 @@ interface CalendarRequest {
|
|
|
528
529
|
description?: string; // Optional description
|
|
529
530
|
timezone?: string; // IANA timezone (default: "UTC")
|
|
530
531
|
active?: boolean; // Active status (default: true)
|
|
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
|
|
@@ -542,9 +556,11 @@ interface CalendarResponse {
|
|
|
542
556
|
description?: string;
|
|
543
557
|
timezone: string; // Always present (default: "UTC")
|
|
544
558
|
active: boolean; // Always present (default: true)
|
|
559
|
+
parallelism: number; // Parallel resources per slot (min: 1)
|
|
545
560
|
createdAt: string; // ISO 8601
|
|
546
561
|
updatedAt: string; // ISO 8601
|
|
547
562
|
groups?: CalendarGroupResponse[]; // Groups this calendar belongs to
|
|
563
|
+
filter?: CalendarFilter; // Optional task filter (origin / destination delegate codes)
|
|
548
564
|
}
|
|
549
565
|
```
|
|
550
566
|
|
|
@@ -557,8 +573,7 @@ interface TimeWindowRequest {
|
|
|
557
573
|
endHour: number; // 0–23 (must be > startHour)
|
|
558
574
|
validFrom: string; // YYYY-MM-DD
|
|
559
575
|
validTo?: string; // YYYY-MM-DD
|
|
560
|
-
|
|
561
|
-
capacityPerSlot?: number; // Default: 1
|
|
576
|
+
capacity?: number; // Default: 1 — total services this window can handle
|
|
562
577
|
daysOfWeek?: string; // Comma-separated: "1,2,3,4,5" (1=Mon, 7=Sun)
|
|
563
578
|
active?: boolean; // Default: true
|
|
564
579
|
}
|
|
@@ -573,8 +588,8 @@ interface TimeWindowResponse {
|
|
|
573
588
|
name: string;
|
|
574
589
|
startHour: number;
|
|
575
590
|
endHour: number;
|
|
576
|
-
slotDurationMinutes: number; //
|
|
577
|
-
|
|
591
|
+
slotDurationMinutes: number; // Read-only, derived from capacity model
|
|
592
|
+
capacity: number; // Total services this window can handle
|
|
578
593
|
daysOfWeek: string;
|
|
579
594
|
validFrom: string;
|
|
580
595
|
validTo?: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -42,13 +42,19 @@ 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;
|
|
48
52
|
description?: string;
|
|
49
53
|
timezone?: string;
|
|
50
54
|
active?: boolean;
|
|
55
|
+
parallelism?: number;
|
|
51
56
|
groups?: string[];
|
|
57
|
+
filter?: CalendarFilter;
|
|
52
58
|
autoSlotManager?: boolean;
|
|
53
59
|
}
|
|
54
60
|
interface CalendarResponse {
|
|
@@ -58,9 +64,11 @@ interface CalendarResponse {
|
|
|
58
64
|
description?: string;
|
|
59
65
|
timezone: string;
|
|
60
66
|
active: boolean;
|
|
67
|
+
parallelism: number;
|
|
61
68
|
createdAt: string;
|
|
62
69
|
updatedAt: string;
|
|
63
70
|
groups?: CalendarGroupResponse[];
|
|
71
|
+
filter?: CalendarFilter;
|
|
64
72
|
hasSlotManager?: boolean;
|
|
65
73
|
}
|
|
66
74
|
interface TimeWindowRequest {
|
|
@@ -68,11 +76,11 @@ interface TimeWindowRequest {
|
|
|
68
76
|
startHour: number;
|
|
69
77
|
endHour: number;
|
|
70
78
|
validFrom: string;
|
|
71
|
-
|
|
72
|
-
capacityPerSlot?: number;
|
|
79
|
+
capacity?: number;
|
|
73
80
|
daysOfWeek?: string;
|
|
74
81
|
validTo?: string;
|
|
75
82
|
active?: boolean;
|
|
83
|
+
color?: string;
|
|
76
84
|
}
|
|
77
85
|
interface TimeWindowResponse {
|
|
78
86
|
id: string;
|
|
@@ -81,11 +89,12 @@ interface TimeWindowResponse {
|
|
|
81
89
|
startHour: number;
|
|
82
90
|
endHour: number;
|
|
83
91
|
slotDurationMinutes: number;
|
|
84
|
-
|
|
92
|
+
capacity: number;
|
|
85
93
|
daysOfWeek: string;
|
|
86
94
|
validFrom: string;
|
|
87
95
|
validTo?: string;
|
|
88
96
|
active: boolean;
|
|
97
|
+
color?: string;
|
|
89
98
|
createdAt: string;
|
|
90
99
|
updatedAt: string;
|
|
91
100
|
}
|
|
@@ -244,4 +253,4 @@ declare class MiotCalendarApiError extends Error {
|
|
|
244
253
|
constructor(status: number, body: ErrorResponse | string);
|
|
245
254
|
}
|
|
246
255
|
|
|
247
|
-
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 };
|
|
256
|
+
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 TimeWindowRequest, type TimeWindowResponse, type UpdateSlotStatusRequest, createMiotCalendarClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -42,13 +42,19 @@ 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;
|
|
48
52
|
description?: string;
|
|
49
53
|
timezone?: string;
|
|
50
54
|
active?: boolean;
|
|
55
|
+
parallelism?: number;
|
|
51
56
|
groups?: string[];
|
|
57
|
+
filter?: CalendarFilter;
|
|
52
58
|
autoSlotManager?: boolean;
|
|
53
59
|
}
|
|
54
60
|
interface CalendarResponse {
|
|
@@ -58,9 +64,11 @@ interface CalendarResponse {
|
|
|
58
64
|
description?: string;
|
|
59
65
|
timezone: string;
|
|
60
66
|
active: boolean;
|
|
67
|
+
parallelism: number;
|
|
61
68
|
createdAt: string;
|
|
62
69
|
updatedAt: string;
|
|
63
70
|
groups?: CalendarGroupResponse[];
|
|
71
|
+
filter?: CalendarFilter;
|
|
64
72
|
hasSlotManager?: boolean;
|
|
65
73
|
}
|
|
66
74
|
interface TimeWindowRequest {
|
|
@@ -68,11 +76,11 @@ interface TimeWindowRequest {
|
|
|
68
76
|
startHour: number;
|
|
69
77
|
endHour: number;
|
|
70
78
|
validFrom: string;
|
|
71
|
-
|
|
72
|
-
capacityPerSlot?: number;
|
|
79
|
+
capacity?: number;
|
|
73
80
|
daysOfWeek?: string;
|
|
74
81
|
validTo?: string;
|
|
75
82
|
active?: boolean;
|
|
83
|
+
color?: string;
|
|
76
84
|
}
|
|
77
85
|
interface TimeWindowResponse {
|
|
78
86
|
id: string;
|
|
@@ -81,11 +89,12 @@ interface TimeWindowResponse {
|
|
|
81
89
|
startHour: number;
|
|
82
90
|
endHour: number;
|
|
83
91
|
slotDurationMinutes: number;
|
|
84
|
-
|
|
92
|
+
capacity: number;
|
|
85
93
|
daysOfWeek: string;
|
|
86
94
|
validFrom: string;
|
|
87
95
|
validTo?: string;
|
|
88
96
|
active: boolean;
|
|
97
|
+
color?: string;
|
|
89
98
|
createdAt: string;
|
|
90
99
|
updatedAt: string;
|
|
91
100
|
}
|
|
@@ -244,4 +253,4 @@ declare class MiotCalendarApiError extends Error {
|
|
|
244
253
|
constructor(status: number, body: ErrorResponse | string);
|
|
245
254
|
}
|
|
246
255
|
|
|
247
|
-
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 };
|
|
256
|
+
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 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.7.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": {
|