@withaevum/sdk 1.2.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/offerings.d.ts +9 -1
- package/dist/offerings.js +80 -0
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
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
|
*/
|