@withaevum/sdk 1.1.0 → 1.3.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/offerings.d.ts +9 -1
- package/dist/offerings.js +80 -0
- package/dist/types.d.ts +28 -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/offerings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AevumClient } from './client';
|
|
2
|
-
import type { Offering, CreateOfferingParams, ListOfferingsParams, CreateSimpleOfferingParams, CreateRecurringWeeklyOfferingParams, CreateRecurringDailyOfferingParams, CreateSimpleOfferingEndpointParams } from './types';
|
|
2
|
+
import type { Offering, CreateOfferingParams, UpdateOfferingParams, ListOfferingsParams, CreateSimpleOfferingParams, CreateRecurringWeeklyOfferingParams, CreateRecurringDailyOfferingParams, CreateSimpleOfferingEndpointParams } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Offerings API methods
|
|
5
5
|
*/
|
|
@@ -14,6 +14,14 @@ export declare class OfferingsAPI {
|
|
|
14
14
|
* Get a single offering by ID
|
|
15
15
|
*/
|
|
16
16
|
get(offeringId: string): Promise<Offering>;
|
|
17
|
+
/**
|
|
18
|
+
* Update an existing offering
|
|
19
|
+
*/
|
|
20
|
+
update(offeringId: string, params: UpdateOfferingParams): Promise<Offering>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete an offering
|
|
23
|
+
*/
|
|
24
|
+
delete(offeringId: string): Promise<void>;
|
|
17
25
|
/**
|
|
18
26
|
* Create a new offering
|
|
19
27
|
*/
|
package/dist/offerings.js
CHANGED
|
@@ -73,6 +73,86 @@ export class OfferingsAPI {
|
|
|
73
73
|
const response = await this.client.request('GET', `/api/v1/orgs/{orgId}/offerings/${offeringId}`);
|
|
74
74
|
return response.offering;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Update an existing offering
|
|
78
|
+
*/
|
|
79
|
+
async update(offeringId, params) {
|
|
80
|
+
const body = {};
|
|
81
|
+
if (params.name !== undefined)
|
|
82
|
+
body.name = params.name;
|
|
83
|
+
if (params.description !== undefined)
|
|
84
|
+
body.description = params.description;
|
|
85
|
+
if (params.price_cents !== undefined)
|
|
86
|
+
body.price_cents = params.price_cents;
|
|
87
|
+
if (params.duration_minutes !== undefined)
|
|
88
|
+
body.duration_minutes = params.duration_minutes;
|
|
89
|
+
if (params.timezone !== undefined)
|
|
90
|
+
body.timezone = params.timezone;
|
|
91
|
+
if (params.is_all_day !== undefined)
|
|
92
|
+
body.is_all_day = params.is_all_day;
|
|
93
|
+
if (params.attendee_mode !== undefined)
|
|
94
|
+
body.attendee_mode = params.attendee_mode;
|
|
95
|
+
if (params.attendee_limit !== undefined)
|
|
96
|
+
body.attendee_limit = params.attendee_limit;
|
|
97
|
+
if (params.customer !== undefined)
|
|
98
|
+
body.customer = params.customer;
|
|
99
|
+
if (params.status !== undefined)
|
|
100
|
+
body.status = params.status;
|
|
101
|
+
if (params.type !== undefined)
|
|
102
|
+
body.type = params.type;
|
|
103
|
+
if (params.time_mode !== undefined)
|
|
104
|
+
body.time_mode = params.time_mode;
|
|
105
|
+
if (params.start_time !== undefined)
|
|
106
|
+
body.start_time = params.start_time;
|
|
107
|
+
if (params.end_time !== undefined)
|
|
108
|
+
body.end_time = params.end_time;
|
|
109
|
+
if (params.session_count !== undefined)
|
|
110
|
+
body.session_count = params.session_count;
|
|
111
|
+
if (params.recurrence_preset !== undefined)
|
|
112
|
+
body.recurrence_preset = params.recurrence_preset;
|
|
113
|
+
if (params.recurrence_interval_count !== undefined)
|
|
114
|
+
body.recurrence_interval_count = params.recurrence_interval_count;
|
|
115
|
+
if (params.recurrence_interval_unit !== undefined)
|
|
116
|
+
body.recurrence_interval_unit = params.recurrence_interval_unit;
|
|
117
|
+
if (params.recurrence_repeat_on !== undefined)
|
|
118
|
+
body.recurrence_repeat_on = params.recurrence_repeat_on;
|
|
119
|
+
if (params.recurrence_end_mode !== undefined)
|
|
120
|
+
body.recurrence_end_mode = params.recurrence_end_mode;
|
|
121
|
+
if (params.recurrence_end_date !== undefined)
|
|
122
|
+
body.recurrence_end_date = params.recurrence_end_date;
|
|
123
|
+
if (params.recurrence_end_count !== undefined)
|
|
124
|
+
body.recurrence_end_count = params.recurrence_end_count;
|
|
125
|
+
if (params.override_price_cents !== undefined)
|
|
126
|
+
body.override_price_cents = params.override_price_cents;
|
|
127
|
+
if (params.min_age !== undefined)
|
|
128
|
+
body.min_age = params.min_age;
|
|
129
|
+
if (params.max_age !== undefined)
|
|
130
|
+
body.max_age = params.max_age;
|
|
131
|
+
if (params.window_start_time !== undefined)
|
|
132
|
+
body.window_start_time = params.window_start_time;
|
|
133
|
+
if (params.window_end_time !== undefined)
|
|
134
|
+
body.window_end_time = params.window_end_time;
|
|
135
|
+
if (params.cadence_minutes !== undefined)
|
|
136
|
+
body.cadence_minutes = params.cadence_minutes;
|
|
137
|
+
if (params.slot_days !== undefined)
|
|
138
|
+
body.slot_days = params.slot_days;
|
|
139
|
+
if (params.providerIds !== undefined)
|
|
140
|
+
body.providerIds = params.providerIds;
|
|
141
|
+
if (params.hours !== undefined)
|
|
142
|
+
body.hours = params.hours;
|
|
143
|
+
if (params.weekly_hours !== undefined)
|
|
144
|
+
body.weekly_hours = params.weekly_hours;
|
|
145
|
+
if (params.monthly_recurrence !== undefined)
|
|
146
|
+
body.monthly_recurrence = params.monthly_recurrence;
|
|
147
|
+
const response = await this.client.request('PATCH', `/api/v1/orgs/{orgId}/offerings/${offeringId}`, { body });
|
|
148
|
+
return response.offering;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Delete an offering
|
|
152
|
+
*/
|
|
153
|
+
async delete(offeringId) {
|
|
154
|
+
await this.client.request('DELETE', `/api/v1/orgs/{orgId}/offerings/${offeringId}`);
|
|
155
|
+
}
|
|
76
156
|
/**
|
|
77
157
|
* Create a new offering
|
|
78
158
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -257,6 +257,12 @@ export interface CreateOfferingParams {
|
|
|
257
257
|
weekly_hours?: any;
|
|
258
258
|
monthly_recurrence?: any;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Parameters for updating an offering (all fields optional)
|
|
262
|
+
*/
|
|
263
|
+
export type UpdateOfferingParams = Partial<Omit<CreateOfferingParams, 'name'>> & {
|
|
264
|
+
name?: string;
|
|
265
|
+
};
|
|
260
266
|
/**
|
|
261
267
|
* Parameters for listing offerings
|
|
262
268
|
*/
|
|
@@ -608,6 +614,28 @@ export interface CreateAvailabilityScheduleParams {
|
|
|
608
614
|
/** Number of sessions when recurrence_end_mode is 'after' */
|
|
609
615
|
recurrence_end_count?: number | null;
|
|
610
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
* Parameters for updating an availability schedule (all fields optional)
|
|
619
|
+
*/
|
|
620
|
+
export interface UpdateAvailabilityScheduleParams {
|
|
621
|
+
/** Schedule name */
|
|
622
|
+
name?: string;
|
|
623
|
+
/** Timezone (e.g. America/New_York) */
|
|
624
|
+
timezone?: string;
|
|
625
|
+
/** Weekly hours: day key -> array of { start, end }; pass null to clear */
|
|
626
|
+
weekly_hours?: Record<string, Array<{
|
|
627
|
+
start: string;
|
|
628
|
+
end: string;
|
|
629
|
+
}>> | null;
|
|
630
|
+
/** Recurrence pattern: daily | weekly | monthly | yearly */
|
|
631
|
+
recurrence_preset?: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
632
|
+
/** When recurrence stops: never | on | after */
|
|
633
|
+
recurrence_end_mode?: 'never' | 'on' | 'after';
|
|
634
|
+
/** End date (ISO) when recurrence_end_mode is 'on' */
|
|
635
|
+
recurrence_end_date?: string | null;
|
|
636
|
+
/** Number of sessions when recurrence_end_mode is 'after' */
|
|
637
|
+
recurrence_end_count?: number | null;
|
|
638
|
+
}
|
|
611
639
|
/**
|
|
612
640
|
* Enhanced parameters for getting availability slots
|
|
613
641
|
*/
|