@withaevum/sdk 1.1.0 → 1.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/availability.d.ts +13 -1
- package/dist/availability.js +33 -0
- package/dist/types.d.ts +22 -0
- package/package.json +1 -1
package/dist/availability.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AevumClient } from './client';
|
|
2
|
-
import type { GetSlotsParams, GetSlotsResponse, CheckAvailabilityParams, CheckAvailabilityResponse, GetAvailabilitySchedulesParams, CreateAvailabilityScheduleParams, AvailabilitySchedule, GetAvailabilitySlotsParams } from './types';
|
|
2
|
+
import type { GetSlotsParams, GetSlotsResponse, CheckAvailabilityParams, CheckAvailabilityResponse, GetAvailabilitySchedulesParams, CreateAvailabilityScheduleParams, UpdateAvailabilityScheduleParams, AvailabilitySchedule, GetAvailabilitySlotsParams } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Availability API methods
|
|
5
5
|
*/
|
|
@@ -19,6 +19,18 @@ export declare class AvailabilityAPI {
|
|
|
19
19
|
* Create an availability schedule for a provider
|
|
20
20
|
*/
|
|
21
21
|
createSchedule(params: CreateAvailabilityScheduleParams): Promise<AvailabilitySchedule>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a single availability schedule by ID
|
|
24
|
+
*/
|
|
25
|
+
getSchedule(scheduleId: string): Promise<AvailabilitySchedule>;
|
|
26
|
+
/**
|
|
27
|
+
* Update an availability schedule (partial update)
|
|
28
|
+
*/
|
|
29
|
+
updateSchedule(scheduleId: string, params: UpdateAvailabilityScheduleParams): Promise<AvailabilitySchedule>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete an availability schedule
|
|
32
|
+
*/
|
|
33
|
+
deleteSchedule(scheduleId: string): Promise<void>;
|
|
22
34
|
/**
|
|
23
35
|
* Check if a specific time slot is available
|
|
24
36
|
* This is a client-side implementation that uses getSlots()
|
package/dist/availability.js
CHANGED
|
@@ -92,6 +92,39 @@ export class AvailabilityAPI {
|
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Get a single availability schedule by ID
|
|
97
|
+
*/
|
|
98
|
+
async getSchedule(scheduleId) {
|
|
99
|
+
return this.client.request('GET', `/api/v1/orgs/{orgId}/availability/schedules/${scheduleId}`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Update an availability schedule (partial update)
|
|
103
|
+
*/
|
|
104
|
+
async updateSchedule(scheduleId, params) {
|
|
105
|
+
const body = {};
|
|
106
|
+
if (params.name !== undefined)
|
|
107
|
+
body.name = params.name;
|
|
108
|
+
if (params.timezone !== undefined)
|
|
109
|
+
body.timezone = params.timezone;
|
|
110
|
+
if (params.weekly_hours !== undefined)
|
|
111
|
+
body.weekly_hours = params.weekly_hours;
|
|
112
|
+
if (params.recurrence_preset !== undefined)
|
|
113
|
+
body.recurrence_preset = params.recurrence_preset;
|
|
114
|
+
if (params.recurrence_end_mode !== undefined)
|
|
115
|
+
body.recurrence_end_mode = params.recurrence_end_mode;
|
|
116
|
+
if (params.recurrence_end_date !== undefined)
|
|
117
|
+
body.recurrence_end_date = params.recurrence_end_date;
|
|
118
|
+
if (params.recurrence_end_count !== undefined)
|
|
119
|
+
body.recurrence_end_count = params.recurrence_end_count;
|
|
120
|
+
return this.client.request('PATCH', `/api/v1/orgs/{orgId}/availability/schedules/${scheduleId}`, { body });
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Delete an availability schedule
|
|
124
|
+
*/
|
|
125
|
+
async deleteSchedule(scheduleId) {
|
|
126
|
+
await this.client.request('DELETE', `/api/v1/orgs/{orgId}/availability/schedules/${scheduleId}`);
|
|
127
|
+
}
|
|
95
128
|
/**
|
|
96
129
|
* Check if a specific time slot is available
|
|
97
130
|
* This is a client-side implementation that uses getSlots()
|
package/dist/types.d.ts
CHANGED
|
@@ -608,6 +608,28 @@ export interface CreateAvailabilityScheduleParams {
|
|
|
608
608
|
/** Number of sessions when recurrence_end_mode is 'after' */
|
|
609
609
|
recurrence_end_count?: number | null;
|
|
610
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* Parameters for updating an availability schedule (all fields optional)
|
|
613
|
+
*/
|
|
614
|
+
export interface UpdateAvailabilityScheduleParams {
|
|
615
|
+
/** Schedule name */
|
|
616
|
+
name?: string;
|
|
617
|
+
/** Timezone (e.g. America/New_York) */
|
|
618
|
+
timezone?: string;
|
|
619
|
+
/** Weekly hours: day key -> array of { start, end }; pass null to clear */
|
|
620
|
+
weekly_hours?: Record<string, Array<{
|
|
621
|
+
start: string;
|
|
622
|
+
end: string;
|
|
623
|
+
}>> | null;
|
|
624
|
+
/** Recurrence pattern: daily | weekly | monthly | yearly */
|
|
625
|
+
recurrence_preset?: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
626
|
+
/** When recurrence stops: never | on | after */
|
|
627
|
+
recurrence_end_mode?: 'never' | 'on' | 'after';
|
|
628
|
+
/** End date (ISO) when recurrence_end_mode is 'on' */
|
|
629
|
+
recurrence_end_date?: string | null;
|
|
630
|
+
/** Number of sessions when recurrence_end_mode is 'after' */
|
|
631
|
+
recurrence_end_count?: number | null;
|
|
632
|
+
}
|
|
611
633
|
/**
|
|
612
634
|
* Enhanced parameters for getting availability slots
|
|
613
635
|
*/
|