@microboxlabs/miot-calendar-client 0.4.1 → 0.5.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 +9 -9
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/package.json +1 -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,6 +120,7 @@ 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
125
|
|
|
126
126
|
**Returns:** `CalendarResponse`
|
|
@@ -173,8 +173,7 @@ Create a time window within a calendar.
|
|
|
173
173
|
| `endHour` | `number` | Yes | — | End hour (0–23, must be > startHour) |
|
|
174
174
|
| `validFrom` | `string` | Yes | — | Start date (`YYYY-MM-DD`) |
|
|
175
175
|
| `validTo` | `string` | No | — | End date (`YYYY-MM-DD`) |
|
|
176
|
-
| `
|
|
177
|
-
| `capacityPerSlot` | `number` | No | `1` | Max bookings per slot |
|
|
176
|
+
| `capacity` | `number` | No | `1` | Total number of services this window can handle across all slots |
|
|
178
177
|
| `daysOfWeek` | `string` | No | — | Comma-separated days (1=Mon … 7=Sun) |
|
|
179
178
|
| `active` | `boolean` | No | `true` | Whether the time window is active |
|
|
180
179
|
|
|
@@ -528,6 +527,7 @@ interface CalendarRequest {
|
|
|
528
527
|
description?: string; // Optional description
|
|
529
528
|
timezone?: string; // IANA timezone (default: "UTC")
|
|
530
529
|
active?: boolean; // Active status (default: true)
|
|
530
|
+
parallelism?: number; // Parallel resources per slot (default: 1, e.g. loading docks)
|
|
531
531
|
groups?: string[]; // Group codes to assign. null = no change; [] = remove all; ["code"] = replace all
|
|
532
532
|
}
|
|
533
533
|
```
|
|
@@ -542,6 +542,7 @@ interface CalendarResponse {
|
|
|
542
542
|
description?: string;
|
|
543
543
|
timezone: string; // Always present (default: "UTC")
|
|
544
544
|
active: boolean; // Always present (default: true)
|
|
545
|
+
parallelism: number; // Parallel resources per slot (min: 1)
|
|
545
546
|
createdAt: string; // ISO 8601
|
|
546
547
|
updatedAt: string; // ISO 8601
|
|
547
548
|
groups?: CalendarGroupResponse[]; // Groups this calendar belongs to
|
|
@@ -557,8 +558,7 @@ interface TimeWindowRequest {
|
|
|
557
558
|
endHour: number; // 0–23 (must be > startHour)
|
|
558
559
|
validFrom: string; // YYYY-MM-DD
|
|
559
560
|
validTo?: string; // YYYY-MM-DD
|
|
560
|
-
|
|
561
|
-
capacityPerSlot?: number; // Default: 1
|
|
561
|
+
capacity?: number; // Default: 1 — total services this window can handle
|
|
562
562
|
daysOfWeek?: string; // Comma-separated: "1,2,3,4,5" (1=Mon, 7=Sun)
|
|
563
563
|
active?: boolean; // Default: true
|
|
564
564
|
}
|
|
@@ -573,8 +573,8 @@ interface TimeWindowResponse {
|
|
|
573
573
|
name: string;
|
|
574
574
|
startHour: number;
|
|
575
575
|
endHour: number;
|
|
576
|
-
slotDurationMinutes: number; //
|
|
577
|
-
|
|
576
|
+
slotDurationMinutes: number; // Read-only, derived from capacity model
|
|
577
|
+
capacity: number; // Total services this window can handle
|
|
578
578
|
daysOfWeek: string;
|
|
579
579
|
validFrom: string;
|
|
580
580
|
validTo?: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -48,6 +48,7 @@ interface CalendarRequest {
|
|
|
48
48
|
description?: string;
|
|
49
49
|
timezone?: string;
|
|
50
50
|
active?: boolean;
|
|
51
|
+
parallelism?: number;
|
|
51
52
|
groups?: string[];
|
|
52
53
|
autoSlotManager?: boolean;
|
|
53
54
|
}
|
|
@@ -58,6 +59,7 @@ interface CalendarResponse {
|
|
|
58
59
|
description?: string;
|
|
59
60
|
timezone: string;
|
|
60
61
|
active: boolean;
|
|
62
|
+
parallelism: number;
|
|
61
63
|
createdAt: string;
|
|
62
64
|
updatedAt: string;
|
|
63
65
|
groups?: CalendarGroupResponse[];
|
|
@@ -68,8 +70,7 @@ interface TimeWindowRequest {
|
|
|
68
70
|
startHour: number;
|
|
69
71
|
endHour: number;
|
|
70
72
|
validFrom: string;
|
|
71
|
-
|
|
72
|
-
capacityPerSlot?: number;
|
|
73
|
+
capacity?: number;
|
|
73
74
|
daysOfWeek?: string;
|
|
74
75
|
validTo?: string;
|
|
75
76
|
active?: boolean;
|
|
@@ -81,7 +82,7 @@ interface TimeWindowResponse {
|
|
|
81
82
|
startHour: number;
|
|
82
83
|
endHour: number;
|
|
83
84
|
slotDurationMinutes: number;
|
|
84
|
-
|
|
85
|
+
capacity: number;
|
|
85
86
|
daysOfWeek: string;
|
|
86
87
|
validFrom: string;
|
|
87
88
|
validTo?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ interface CalendarRequest {
|
|
|
48
48
|
description?: string;
|
|
49
49
|
timezone?: string;
|
|
50
50
|
active?: boolean;
|
|
51
|
+
parallelism?: number;
|
|
51
52
|
groups?: string[];
|
|
52
53
|
autoSlotManager?: boolean;
|
|
53
54
|
}
|
|
@@ -58,6 +59,7 @@ interface CalendarResponse {
|
|
|
58
59
|
description?: string;
|
|
59
60
|
timezone: string;
|
|
60
61
|
active: boolean;
|
|
62
|
+
parallelism: number;
|
|
61
63
|
createdAt: string;
|
|
62
64
|
updatedAt: string;
|
|
63
65
|
groups?: CalendarGroupResponse[];
|
|
@@ -68,8 +70,7 @@ interface TimeWindowRequest {
|
|
|
68
70
|
startHour: number;
|
|
69
71
|
endHour: number;
|
|
70
72
|
validFrom: string;
|
|
71
|
-
|
|
72
|
-
capacityPerSlot?: number;
|
|
73
|
+
capacity?: number;
|
|
73
74
|
daysOfWeek?: string;
|
|
74
75
|
validTo?: string;
|
|
75
76
|
active?: boolean;
|
|
@@ -81,7 +82,7 @@ interface TimeWindowResponse {
|
|
|
81
82
|
startHour: number;
|
|
82
83
|
endHour: number;
|
|
83
84
|
slotDurationMinutes: number;
|
|
84
|
-
|
|
85
|
+
capacity: number;
|
|
85
86
|
daysOfWeek: string;
|
|
86
87
|
validFrom: string;
|
|
87
88
|
validTo?: string;
|