@withaevum/sdk 1.0.0 → 1.1.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.
@@ -1,5 +1,5 @@
1
1
  import { AevumClient } from './client';
2
- import type { GetSlotsParams, GetSlotsResponse, CheckAvailabilityParams, CheckAvailabilityResponse, GetAvailabilitySchedulesParams, AvailabilitySchedule, GetAvailabilitySlotsParams } from './types';
2
+ import type { GetSlotsParams, GetSlotsResponse, CheckAvailabilityParams, CheckAvailabilityResponse, GetAvailabilitySchedulesParams, CreateAvailabilityScheduleParams, AvailabilitySchedule, GetAvailabilitySlotsParams } from './types';
3
3
  /**
4
4
  * Availability API methods
5
5
  */
@@ -15,6 +15,10 @@ export declare class AvailabilityAPI {
15
15
  * Get availability schedules
16
16
  */
17
17
  getSchedules(params?: GetAvailabilitySchedulesParams): Promise<AvailabilitySchedule[]>;
18
+ /**
19
+ * Create an availability schedule for a provider
20
+ */
21
+ createSchedule(params: CreateAvailabilityScheduleParams): Promise<AvailabilitySchedule>;
18
22
  /**
19
23
  * Check if a specific time slot is available
20
24
  * This is a client-side implementation that uses getSlots()
@@ -75,6 +75,23 @@ export class AvailabilityAPI {
75
75
  throw error;
76
76
  }
77
77
  }
78
+ /**
79
+ * Create an availability schedule for a provider
80
+ */
81
+ async createSchedule(params) {
82
+ return this.client.request('POST', '/api/v1/orgs/{orgId}/availability/schedules', {
83
+ body: {
84
+ providerId: params.providerId,
85
+ name: params.name,
86
+ timezone: params.timezone,
87
+ weekly_hours: params.weekly_hours,
88
+ recurrence_preset: params.recurrence_preset,
89
+ recurrence_end_mode: params.recurrence_end_mode,
90
+ recurrence_end_date: params.recurrence_end_date,
91
+ recurrence_end_count: params.recurrence_end_count,
92
+ },
93
+ });
94
+ }
78
95
  /**
79
96
  * Check if a specific time slot is available
80
97
  * This is a client-side implementation that uses getSlots()
package/dist/types.d.ts CHANGED
@@ -567,6 +567,14 @@ export interface AvailabilitySchedule {
567
567
  providerId: string;
568
568
  name?: string | null;
569
569
  timezone?: string | null;
570
+ weekly_hours?: Record<string, Array<{
571
+ start: string;
572
+ end: string;
573
+ }>>;
574
+ recurrence_preset?: string | null;
575
+ recurrence_end_mode?: string | null;
576
+ recurrence_end_date?: string | null;
577
+ recurrence_end_count?: number | null;
570
578
  [key: string]: any;
571
579
  }
572
580
  /**
@@ -576,6 +584,30 @@ export interface GetAvailabilitySchedulesParams {
576
584
  /** Filter by provider ID */
577
585
  providerId?: string;
578
586
  }
587
+ /**
588
+ * Parameters for creating an availability schedule
589
+ */
590
+ export interface CreateAvailabilityScheduleParams {
591
+ /** Provider ID */
592
+ providerId: string;
593
+ /** Schedule name */
594
+ name: string;
595
+ /** Timezone (e.g. America/New_York). Defaults to UTC */
596
+ timezone?: string;
597
+ /** Weekly hours: day key -> array of { start, end } (e.g. "09:00", "17:00") */
598
+ weekly_hours?: Record<string, Array<{
599
+ start: string;
600
+ end: string;
601
+ }>>;
602
+ /** Recurrence pattern: daily | weekly | monthly | yearly. Defaults to weekly */
603
+ recurrence_preset?: 'daily' | 'weekly' | 'monthly' | 'yearly';
604
+ /** When recurrence stops: never | on | after */
605
+ recurrence_end_mode?: 'never' | 'on' | 'after';
606
+ /** End date (ISO) when recurrence_end_mode is 'on' */
607
+ recurrence_end_date?: string | null;
608
+ /** Number of sessions when recurrence_end_mode is 'after' */
609
+ recurrence_end_count?: number | null;
610
+ }
579
611
  /**
580
612
  * Enhanced parameters for getting availability slots
581
613
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withaevum/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "TypeScript SDK for the Aevum API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",