@withaevum/sdk 1.3.2 → 1.3.4

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.
@@ -26,4 +26,17 @@ export declare class BookingsAPI {
26
26
  * Reschedule a booking
27
27
  */
28
28
  reschedule(bookingId: string, params: RescheduleBookingParams): Promise<Booking>;
29
+ /**
30
+ * Confirm a booking
31
+ */
32
+ confirm(bookingId: string, params?: {
33
+ sendNotification?: boolean;
34
+ }): Promise<Booking>;
35
+ /**
36
+ * Update a booking (status and/or notes)
37
+ */
38
+ update(bookingId: string, params: {
39
+ status?: string;
40
+ notes?: string;
41
+ }): Promise<Booking>;
29
42
  }
package/dist/bookings.js CHANGED
@@ -119,4 +119,30 @@ export class BookingsAPI {
119
119
  // Return updated booking
120
120
  return this.get(bookingId);
121
121
  }
122
+ /**
123
+ * Confirm a booking
124
+ */
125
+ async confirm(bookingId, params) {
126
+ const body = {
127
+ sendNotification: params?.sendNotification ?? false,
128
+ };
129
+ await this.client.request('PATCH', `/api/v1/orgs/{orgId}/bookings/${bookingId}/confirm`, { body });
130
+ // Return updated booking
131
+ return this.get(bookingId);
132
+ }
133
+ /**
134
+ * Update a booking (status and/or notes)
135
+ */
136
+ async update(bookingId, params) {
137
+ const body = {};
138
+ if (params.status !== undefined) {
139
+ body.status = params.status;
140
+ }
141
+ if (params.notes !== undefined) {
142
+ body.notes = params.notes;
143
+ }
144
+ await this.client.request('PATCH', `/api/v1/orgs/{orgId}/bookings/${bookingId}`, { body });
145
+ // Return updated booking
146
+ return this.get(bookingId);
147
+ }
122
148
  }
package/dist/client.js CHANGED
@@ -20,7 +20,22 @@ export class AevumClient {
20
20
  throw new Error('API key is required');
21
21
  }
22
22
  this.apiKey = config.apiKey;
23
- this.baseUrl = config.baseUrl || 'https://withaevum.com';
23
+ // Default baseUrl: use provided, or check env var (Node.js only), or use production
24
+ if (config.baseUrl) {
25
+ this.baseUrl = config.baseUrl;
26
+ }
27
+ else if (typeof process !== 'undefined' && process.env?.AEVUM_API_BASE_URL) {
28
+ // Check environment variable if in Node.js
29
+ this.baseUrl = process.env.AEVUM_API_BASE_URL;
30
+ }
31
+ else if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') {
32
+ // Default to localhost in development
33
+ this.baseUrl = 'http://localhost:3000';
34
+ }
35
+ else {
36
+ // Production default
37
+ this.baseUrl = 'https://withaevum.com';
38
+ }
24
39
  // Set orgId if provided in config (avoids extra API call)
25
40
  if (config.orgId) {
26
41
  this.orgId = config.orgId;
@@ -26,4 +26,8 @@ export declare class CustomersAPI {
26
26
  * Get customer booking history with analytics
27
27
  */
28
28
  getHistory(customerId: string): Promise<CustomerHistoryResponse>;
29
+ /**
30
+ * Delete a customer
31
+ */
32
+ delete(customerId: string): Promise<void>;
29
33
  }
package/dist/customers.js CHANGED
@@ -74,4 +74,10 @@ export class CustomersAPI {
74
74
  async getHistory(customerId) {
75
75
  return this.client.request('GET', `/api/v1/orgs/{orgId}/customers/${customerId}/history`);
76
76
  }
77
+ /**
78
+ * Delete a customer
79
+ */
80
+ async delete(customerId) {
81
+ await this.client.request('DELETE', `/api/v1/orgs/{orgId}/customers/${customerId}`);
82
+ }
77
83
  }
@@ -18,4 +18,39 @@ export declare class ProvidersAPI {
18
18
  * Create a new provider
19
19
  */
20
20
  create(params: CreateProviderParams): Promise<Provider>;
21
+ /**
22
+ * Update an existing provider
23
+ */
24
+ update(providerId: string, params: {
25
+ name?: string;
26
+ email?: string | null;
27
+ phone?: string | null;
28
+ userId?: string | null;
29
+ bio?: string | null;
30
+ }): Promise<Provider>;
31
+ /**
32
+ * Delete a provider
33
+ */
34
+ delete(providerId: string): Promise<void>;
35
+ /**
36
+ * Get Google Calendar connection status for a provider
37
+ */
38
+ getGoogleCalendarStatus(providerId: string): Promise<{
39
+ connected: boolean;
40
+ email?: string;
41
+ lastSync?: string;
42
+ }>;
43
+ /**
44
+ * Sync Google Calendar for a provider
45
+ */
46
+ syncGoogleCalendar(providerId: string): Promise<{
47
+ success: boolean;
48
+ syncedEvents?: number;
49
+ }>;
50
+ /**
51
+ * Disconnect Google Calendar for a provider
52
+ */
53
+ disconnectGoogleCalendar(providerId: string): Promise<{
54
+ success: boolean;
55
+ }>;
21
56
  }
package/dist/providers.js CHANGED
@@ -55,4 +55,51 @@ export class ProvidersAPI {
55
55
  const response = await this.client.request('POST', '/api/v1/orgs/{orgId}/providers', { body });
56
56
  return response.provider;
57
57
  }
58
+ /**
59
+ * Update an existing provider
60
+ */
61
+ async update(providerId, params) {
62
+ const body = {};
63
+ if (params.name !== undefined) {
64
+ body.name = params.name;
65
+ }
66
+ if (params.email !== undefined) {
67
+ body.email = params.email;
68
+ }
69
+ if (params.phone !== undefined) {
70
+ body.phone = params.phone;
71
+ }
72
+ if (params.userId !== undefined) {
73
+ body.userId = params.userId;
74
+ }
75
+ if (params.bio !== undefined) {
76
+ body.bio = params.bio;
77
+ }
78
+ const response = await this.client.request('PATCH', `/api/v1/orgs/{orgId}/providers/${providerId}`, { body });
79
+ return response.provider;
80
+ }
81
+ /**
82
+ * Delete a provider
83
+ */
84
+ async delete(providerId) {
85
+ await this.client.request('DELETE', `/api/v1/orgs/{orgId}/providers/${providerId}`);
86
+ }
87
+ /**
88
+ * Get Google Calendar connection status for a provider
89
+ */
90
+ async getGoogleCalendarStatus(providerId) {
91
+ return this.client.request('GET', `/api/v1/orgs/{orgId}/providers/${providerId}/google-calendar/status`);
92
+ }
93
+ /**
94
+ * Sync Google Calendar for a provider
95
+ */
96
+ async syncGoogleCalendar(providerId) {
97
+ return this.client.request('POST', `/api/v1/orgs/{orgId}/providers/${providerId}/google-calendar/sync`);
98
+ }
99
+ /**
100
+ * Disconnect Google Calendar for a provider
101
+ */
102
+ async disconnectGoogleCalendar(providerId) {
103
+ return this.client.request('POST', `/api/v1/orgs/{orgId}/providers/${providerId}/google-calendar/disconnect`);
104
+ }
58
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withaevum/sdk",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "TypeScript SDK for the Aevum API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,6 +46,7 @@
46
46
  "access": "public"
47
47
  },
48
48
  "devDependencies": {
49
+ "@types/node": "^25.2.1",
49
50
  "typescript": "^5.6.3"
50
51
  }
51
52
  }