@slotchain/sdk 1.1.0 → 1.1.2
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/README.md +47 -0
- package/dist/index.cjs.js +145 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +204 -17
- package/dist/index.d.ts +204 -17
- package/dist/index.esm.js +145 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/clients/booking-client.ts +87 -10
- package/src/clients/organization-client.ts +83 -0
- package/src/index.ts +8 -0
- package/src/types/api.ts +94 -11
package/dist/index.d.mts
CHANGED
|
@@ -27,6 +27,20 @@ interface Tenant {
|
|
|
27
27
|
id: string;
|
|
28
28
|
slug: string;
|
|
29
29
|
name: string;
|
|
30
|
+
primary_domain?: string;
|
|
31
|
+
subdomain?: string;
|
|
32
|
+
custom_domains?: string[];
|
|
33
|
+
branding?: {
|
|
34
|
+
logo?: string;
|
|
35
|
+
colors?: {
|
|
36
|
+
primary?: string;
|
|
37
|
+
secondary?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
is_public?: boolean;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
created_at: string;
|
|
43
|
+
updated_at: string;
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
32
46
|
* Tenant branding configuration
|
|
@@ -79,10 +93,47 @@ interface Category {
|
|
|
79
93
|
}
|
|
80
94
|
interface Booking {
|
|
81
95
|
id: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
slot_id: string;
|
|
97
|
+
customer_id?: string;
|
|
98
|
+
customer_info: {
|
|
99
|
+
name: string;
|
|
100
|
+
email: string;
|
|
101
|
+
phone?: string;
|
|
102
|
+
address?: string;
|
|
103
|
+
city?: string;
|
|
104
|
+
state?: string;
|
|
105
|
+
zipCode?: string;
|
|
106
|
+
isGuestCheckout?: boolean;
|
|
107
|
+
};
|
|
108
|
+
booking_data: {
|
|
109
|
+
services?: string[];
|
|
110
|
+
selected_services?: string[];
|
|
111
|
+
service_items?: string[];
|
|
112
|
+
total?: number;
|
|
113
|
+
delivery_type?: string;
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
};
|
|
116
|
+
status?: string;
|
|
117
|
+
created_at: string;
|
|
118
|
+
updated_at: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Booking with nested slot information
|
|
122
|
+
*/
|
|
123
|
+
interface BookingWithSlot extends Booking {
|
|
124
|
+
slots?: Slot;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Options for listing bookings
|
|
128
|
+
*/
|
|
129
|
+
interface ListBookingsOptions {
|
|
130
|
+
tenant_id?: string;
|
|
131
|
+
slot_id?: string;
|
|
132
|
+
customer_id?: string;
|
|
85
133
|
status?: string;
|
|
134
|
+
includeSlot?: boolean;
|
|
135
|
+
page?: number;
|
|
136
|
+
limit?: number;
|
|
86
137
|
}
|
|
87
138
|
interface Service {
|
|
88
139
|
id: string;
|
|
@@ -94,11 +145,13 @@ interface Service {
|
|
|
94
145
|
}
|
|
95
146
|
interface Slot {
|
|
96
147
|
id: string;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
148
|
+
tenant_id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
status?: string;
|
|
152
|
+
is_active?: boolean;
|
|
153
|
+
created_at: string;
|
|
154
|
+
updated_at: string;
|
|
102
155
|
}
|
|
103
156
|
interface Customer {
|
|
104
157
|
id: string;
|
|
@@ -139,6 +192,34 @@ interface DataQualityIssue {
|
|
|
139
192
|
message: string;
|
|
140
193
|
resolved: boolean;
|
|
141
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Organization type
|
|
197
|
+
*/
|
|
198
|
+
interface Organization {
|
|
199
|
+
id: string;
|
|
200
|
+
slug?: string;
|
|
201
|
+
name: string;
|
|
202
|
+
description?: string;
|
|
203
|
+
metadata?: Record<string, unknown>;
|
|
204
|
+
tenant_slugs?: string[];
|
|
205
|
+
created_at: string;
|
|
206
|
+
updated_at: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Organization with nested tenants
|
|
210
|
+
*/
|
|
211
|
+
interface OrganizationFullConfig extends Organization {
|
|
212
|
+
tenants: Tenant[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Options for getting organization
|
|
216
|
+
*/
|
|
217
|
+
interface GetOrganizationOptions {
|
|
218
|
+
includeTenants?: boolean;
|
|
219
|
+
page?: number;
|
|
220
|
+
limit?: number;
|
|
221
|
+
is_public?: boolean;
|
|
222
|
+
}
|
|
142
223
|
/**
|
|
143
224
|
* Full tenant configuration including branding, services, and service items
|
|
144
225
|
* Service items are nested within each service object (not as a separate top-level array)
|
|
@@ -287,16 +368,74 @@ declare class BookingClient {
|
|
|
287
368
|
*/
|
|
288
369
|
getById(id: string): Promise<ApiResponse<Booking>>;
|
|
289
370
|
/**
|
|
290
|
-
* List bookings
|
|
371
|
+
* List bookings with enhanced filtering
|
|
291
372
|
* GET /api/v1/bookings
|
|
373
|
+
*
|
|
374
|
+
* Supports filtering by tenant_id, slot_id, customer_id, status, and optional nested slot information.
|
|
375
|
+
*
|
|
376
|
+
* @param params - Query options (tenant_id, slot_id, customer_id, status, includeSlot, page, limit)
|
|
377
|
+
* @returns Bookings or BookingsWithSlot based on includeSlot parameter
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* // List bookings by tenant (single query - fast!)
|
|
382
|
+
* const bookings = await slotly.booking.list({
|
|
383
|
+
* tenant_id: 'tenant-123',
|
|
384
|
+
* includeSlot: true,
|
|
385
|
+
* page: 1,
|
|
386
|
+
* limit: 20
|
|
387
|
+
* });
|
|
388
|
+
*
|
|
389
|
+
* // List bookings by slot
|
|
390
|
+
* const slotBookings = await slotly.booking.list({
|
|
391
|
+
* slot_id: 'slot-456',
|
|
392
|
+
* status: 'confirmed'
|
|
393
|
+
* });
|
|
394
|
+
* ```
|
|
292
395
|
*/
|
|
293
|
-
list(params?:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
396
|
+
list(params?: ListBookingsOptions): Promise<ApiResponse<Booking[] | BookingWithSlot[]>>;
|
|
397
|
+
/**
|
|
398
|
+
* List bookings by tenant (convenience method)
|
|
399
|
+
* GET /api/v1/bookings?tenant_id=:id
|
|
400
|
+
*
|
|
401
|
+
* @param tenantId - Tenant ID
|
|
402
|
+
* @param options - Additional options (includeSlot, page, limit, status)
|
|
403
|
+
* @returns Bookings or BookingsWithSlot based on includeSlot parameter
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* const bookings = await slotly.booking.listByTenant('tenant-123', {
|
|
408
|
+
* page: 1,
|
|
409
|
+
* limit: 20,
|
|
410
|
+
* status: 'confirmed'
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
listByTenant(tenantId: string, options?: Omit<ListBookingsOptions, 'tenant_id'>): Promise<ApiResponse<Booking[] | BookingWithSlot[]>>;
|
|
415
|
+
/**
|
|
416
|
+
* List bookings by tenant with nested slot information (convenience method)
|
|
417
|
+
* GET /api/v1/bookings?tenant_id=:id&includeSlot=true
|
|
418
|
+
*
|
|
419
|
+
* @param tenantId - Tenant ID
|
|
420
|
+
* @param options - Additional options (page, limit, status)
|
|
421
|
+
* @returns BookingsWithSlot (includes nested slot information)
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```typescript
|
|
425
|
+
* const bookings = await slotly.booking.listByTenantWithSlots('tenant-123', {
|
|
426
|
+
* page: 1,
|
|
427
|
+
* limit: 20
|
|
428
|
+
* });
|
|
429
|
+
*
|
|
430
|
+
* // Access slot information
|
|
431
|
+
* bookings.data.forEach(booking => {
|
|
432
|
+
* if (booking.slots) {
|
|
433
|
+
* console.log('Slot name:', booking.slots.name);
|
|
434
|
+
* }
|
|
435
|
+
* });
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
listByTenantWithSlots(tenantId: string, options?: Omit<ListBookingsOptions, 'tenant_id' | 'includeSlot'>): Promise<ApiResponse<BookingWithSlot[]>>;
|
|
300
439
|
/**
|
|
301
440
|
* Create a new booking (publishes booking.created event)
|
|
302
441
|
* POST /api/v1/bookings
|
|
@@ -943,6 +1082,53 @@ declare class DataQualityClient {
|
|
|
943
1082
|
getSummary(tenantId: string): Promise<ApiResponse<any>>;
|
|
944
1083
|
}
|
|
945
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* OrganizationClient provides methods for managing organizations
|
|
1087
|
+
*/
|
|
1088
|
+
declare class OrganizationClient {
|
|
1089
|
+
private client;
|
|
1090
|
+
constructor(client: AxiosInstance);
|
|
1091
|
+
/**
|
|
1092
|
+
* Get organization by ID or slug
|
|
1093
|
+
* GET /api/v1/organizations/:id
|
|
1094
|
+
*
|
|
1095
|
+
* @param identifier - Organization ID or slug
|
|
1096
|
+
* @param options - Query options (includeTenants, page, limit, is_public)
|
|
1097
|
+
* @returns Organization or OrganizationFullConfig (with nested tenants if includeTenants=true)
|
|
1098
|
+
*
|
|
1099
|
+
* @example
|
|
1100
|
+
* ```typescript
|
|
1101
|
+
* // Get organization only
|
|
1102
|
+
* const org = await slotly.organization.getById('org-123');
|
|
1103
|
+
*
|
|
1104
|
+
* // Get organization with tenants
|
|
1105
|
+
* const orgWithTenants = await slotly.organization.getById('org-123', {
|
|
1106
|
+
* includeTenants: true,
|
|
1107
|
+
* page: 1,
|
|
1108
|
+
* limit: 10,
|
|
1109
|
+
* is_public: true
|
|
1110
|
+
* });
|
|
1111
|
+
* ```
|
|
1112
|
+
*/
|
|
1113
|
+
getById(identifier: string, options?: GetOrganizationOptions): Promise<ApiResponse<Organization | OrganizationFullConfig>>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Get organization by slug (alias for getById)
|
|
1116
|
+
* GET /api/v1/organizations/:slug
|
|
1117
|
+
*
|
|
1118
|
+
* @param slug - Organization slug
|
|
1119
|
+
* @param options - Query options (includeTenants, page, limit, is_public)
|
|
1120
|
+
* @returns Organization or OrganizationFullConfig (with nested tenants if includeTenants=true)
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1123
|
+
* ```typescript
|
|
1124
|
+
* const org = await slotly.organization.getBySlug('acme-corp', {
|
|
1125
|
+
* includeTenants: true
|
|
1126
|
+
* });
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1129
|
+
getBySlug(slug: string, options?: GetOrganizationOptions): Promise<ApiResponse<Organization | OrganizationFullConfig>>;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
946
1132
|
/**
|
|
947
1133
|
* Custom error classes for Slotly SDK
|
|
948
1134
|
*/
|
|
@@ -1104,6 +1290,7 @@ interface SlotlyApi {
|
|
|
1104
1290
|
studio: StudioClient;
|
|
1105
1291
|
notification: NotificationClient;
|
|
1106
1292
|
dataQuality: DataQualityClient;
|
|
1293
|
+
organization: OrganizationClient;
|
|
1107
1294
|
}
|
|
1108
1295
|
/**
|
|
1109
1296
|
* Initialize and configure a new Slotly API client with dual authentication.
|
|
@@ -1168,4 +1355,4 @@ interface SlotlyApi {
|
|
|
1168
1355
|
*/
|
|
1169
1356
|
declare const useSlotly: (options: SlotlyClientOptions) => SlotlyApi;
|
|
1170
1357
|
|
|
1171
|
-
export { type ApiResponse, type Booking, type Category, type Customer, type DataQualityIssue, type Flow, type FlowStep, type Notification, type Service, type ServiceItem, type ServiceItemWithService, type ServiceWithItems, type Slot, type SlotlyApi, SlotlyApiError, type SlotlyAuthContext, SlotlyAuthError, type SlotlyClientOptions, SlotlyConfigurationError, SlotlyNetworkError, type SlotlyRequest, type Studio, type Tenant, type TenantBranding, type TenantFullConfig, useSlotly as default, getSlotlyContext, useSlotly, validateSlotlyRequest };
|
|
1358
|
+
export { type ApiResponse, type Booking, type BookingWithSlot, type Category, type Customer, type DataQualityIssue, type Flow, type FlowStep, type GetOrganizationOptions, type ListBookingsOptions, type Notification, type Organization, type OrganizationFullConfig, type Service, type ServiceItem, type ServiceItemWithService, type ServiceWithItems, type Slot, type SlotlyApi, SlotlyApiError, type SlotlyAuthContext, SlotlyAuthError, type SlotlyClientOptions, SlotlyConfigurationError, SlotlyNetworkError, type SlotlyRequest, type Studio, type Tenant, type TenantBranding, type TenantFullConfig, useSlotly as default, getSlotlyContext, useSlotly, validateSlotlyRequest };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,20 @@ interface Tenant {
|
|
|
27
27
|
id: string;
|
|
28
28
|
slug: string;
|
|
29
29
|
name: string;
|
|
30
|
+
primary_domain?: string;
|
|
31
|
+
subdomain?: string;
|
|
32
|
+
custom_domains?: string[];
|
|
33
|
+
branding?: {
|
|
34
|
+
logo?: string;
|
|
35
|
+
colors?: {
|
|
36
|
+
primary?: string;
|
|
37
|
+
secondary?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
is_public?: boolean;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
created_at: string;
|
|
43
|
+
updated_at: string;
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
32
46
|
* Tenant branding configuration
|
|
@@ -79,10 +93,47 @@ interface Category {
|
|
|
79
93
|
}
|
|
80
94
|
interface Booking {
|
|
81
95
|
id: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
slot_id: string;
|
|
97
|
+
customer_id?: string;
|
|
98
|
+
customer_info: {
|
|
99
|
+
name: string;
|
|
100
|
+
email: string;
|
|
101
|
+
phone?: string;
|
|
102
|
+
address?: string;
|
|
103
|
+
city?: string;
|
|
104
|
+
state?: string;
|
|
105
|
+
zipCode?: string;
|
|
106
|
+
isGuestCheckout?: boolean;
|
|
107
|
+
};
|
|
108
|
+
booking_data: {
|
|
109
|
+
services?: string[];
|
|
110
|
+
selected_services?: string[];
|
|
111
|
+
service_items?: string[];
|
|
112
|
+
total?: number;
|
|
113
|
+
delivery_type?: string;
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
};
|
|
116
|
+
status?: string;
|
|
117
|
+
created_at: string;
|
|
118
|
+
updated_at: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Booking with nested slot information
|
|
122
|
+
*/
|
|
123
|
+
interface BookingWithSlot extends Booking {
|
|
124
|
+
slots?: Slot;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Options for listing bookings
|
|
128
|
+
*/
|
|
129
|
+
interface ListBookingsOptions {
|
|
130
|
+
tenant_id?: string;
|
|
131
|
+
slot_id?: string;
|
|
132
|
+
customer_id?: string;
|
|
85
133
|
status?: string;
|
|
134
|
+
includeSlot?: boolean;
|
|
135
|
+
page?: number;
|
|
136
|
+
limit?: number;
|
|
86
137
|
}
|
|
87
138
|
interface Service {
|
|
88
139
|
id: string;
|
|
@@ -94,11 +145,13 @@ interface Service {
|
|
|
94
145
|
}
|
|
95
146
|
interface Slot {
|
|
96
147
|
id: string;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
148
|
+
tenant_id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
status?: string;
|
|
152
|
+
is_active?: boolean;
|
|
153
|
+
created_at: string;
|
|
154
|
+
updated_at: string;
|
|
102
155
|
}
|
|
103
156
|
interface Customer {
|
|
104
157
|
id: string;
|
|
@@ -139,6 +192,34 @@ interface DataQualityIssue {
|
|
|
139
192
|
message: string;
|
|
140
193
|
resolved: boolean;
|
|
141
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Organization type
|
|
197
|
+
*/
|
|
198
|
+
interface Organization {
|
|
199
|
+
id: string;
|
|
200
|
+
slug?: string;
|
|
201
|
+
name: string;
|
|
202
|
+
description?: string;
|
|
203
|
+
metadata?: Record<string, unknown>;
|
|
204
|
+
tenant_slugs?: string[];
|
|
205
|
+
created_at: string;
|
|
206
|
+
updated_at: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Organization with nested tenants
|
|
210
|
+
*/
|
|
211
|
+
interface OrganizationFullConfig extends Organization {
|
|
212
|
+
tenants: Tenant[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Options for getting organization
|
|
216
|
+
*/
|
|
217
|
+
interface GetOrganizationOptions {
|
|
218
|
+
includeTenants?: boolean;
|
|
219
|
+
page?: number;
|
|
220
|
+
limit?: number;
|
|
221
|
+
is_public?: boolean;
|
|
222
|
+
}
|
|
142
223
|
/**
|
|
143
224
|
* Full tenant configuration including branding, services, and service items
|
|
144
225
|
* Service items are nested within each service object (not as a separate top-level array)
|
|
@@ -287,16 +368,74 @@ declare class BookingClient {
|
|
|
287
368
|
*/
|
|
288
369
|
getById(id: string): Promise<ApiResponse<Booking>>;
|
|
289
370
|
/**
|
|
290
|
-
* List bookings
|
|
371
|
+
* List bookings with enhanced filtering
|
|
291
372
|
* GET /api/v1/bookings
|
|
373
|
+
*
|
|
374
|
+
* Supports filtering by tenant_id, slot_id, customer_id, status, and optional nested slot information.
|
|
375
|
+
*
|
|
376
|
+
* @param params - Query options (tenant_id, slot_id, customer_id, status, includeSlot, page, limit)
|
|
377
|
+
* @returns Bookings or BookingsWithSlot based on includeSlot parameter
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* // List bookings by tenant (single query - fast!)
|
|
382
|
+
* const bookings = await slotly.booking.list({
|
|
383
|
+
* tenant_id: 'tenant-123',
|
|
384
|
+
* includeSlot: true,
|
|
385
|
+
* page: 1,
|
|
386
|
+
* limit: 20
|
|
387
|
+
* });
|
|
388
|
+
*
|
|
389
|
+
* // List bookings by slot
|
|
390
|
+
* const slotBookings = await slotly.booking.list({
|
|
391
|
+
* slot_id: 'slot-456',
|
|
392
|
+
* status: 'confirmed'
|
|
393
|
+
* });
|
|
394
|
+
* ```
|
|
292
395
|
*/
|
|
293
|
-
list(params?:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
396
|
+
list(params?: ListBookingsOptions): Promise<ApiResponse<Booking[] | BookingWithSlot[]>>;
|
|
397
|
+
/**
|
|
398
|
+
* List bookings by tenant (convenience method)
|
|
399
|
+
* GET /api/v1/bookings?tenant_id=:id
|
|
400
|
+
*
|
|
401
|
+
* @param tenantId - Tenant ID
|
|
402
|
+
* @param options - Additional options (includeSlot, page, limit, status)
|
|
403
|
+
* @returns Bookings or BookingsWithSlot based on includeSlot parameter
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* const bookings = await slotly.booking.listByTenant('tenant-123', {
|
|
408
|
+
* page: 1,
|
|
409
|
+
* limit: 20,
|
|
410
|
+
* status: 'confirmed'
|
|
411
|
+
* });
|
|
412
|
+
* ```
|
|
413
|
+
*/
|
|
414
|
+
listByTenant(tenantId: string, options?: Omit<ListBookingsOptions, 'tenant_id'>): Promise<ApiResponse<Booking[] | BookingWithSlot[]>>;
|
|
415
|
+
/**
|
|
416
|
+
* List bookings by tenant with nested slot information (convenience method)
|
|
417
|
+
* GET /api/v1/bookings?tenant_id=:id&includeSlot=true
|
|
418
|
+
*
|
|
419
|
+
* @param tenantId - Tenant ID
|
|
420
|
+
* @param options - Additional options (page, limit, status)
|
|
421
|
+
* @returns BookingsWithSlot (includes nested slot information)
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```typescript
|
|
425
|
+
* const bookings = await slotly.booking.listByTenantWithSlots('tenant-123', {
|
|
426
|
+
* page: 1,
|
|
427
|
+
* limit: 20
|
|
428
|
+
* });
|
|
429
|
+
*
|
|
430
|
+
* // Access slot information
|
|
431
|
+
* bookings.data.forEach(booking => {
|
|
432
|
+
* if (booking.slots) {
|
|
433
|
+
* console.log('Slot name:', booking.slots.name);
|
|
434
|
+
* }
|
|
435
|
+
* });
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
listByTenantWithSlots(tenantId: string, options?: Omit<ListBookingsOptions, 'tenant_id' | 'includeSlot'>): Promise<ApiResponse<BookingWithSlot[]>>;
|
|
300
439
|
/**
|
|
301
440
|
* Create a new booking (publishes booking.created event)
|
|
302
441
|
* POST /api/v1/bookings
|
|
@@ -943,6 +1082,53 @@ declare class DataQualityClient {
|
|
|
943
1082
|
getSummary(tenantId: string): Promise<ApiResponse<any>>;
|
|
944
1083
|
}
|
|
945
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* OrganizationClient provides methods for managing organizations
|
|
1087
|
+
*/
|
|
1088
|
+
declare class OrganizationClient {
|
|
1089
|
+
private client;
|
|
1090
|
+
constructor(client: AxiosInstance);
|
|
1091
|
+
/**
|
|
1092
|
+
* Get organization by ID or slug
|
|
1093
|
+
* GET /api/v1/organizations/:id
|
|
1094
|
+
*
|
|
1095
|
+
* @param identifier - Organization ID or slug
|
|
1096
|
+
* @param options - Query options (includeTenants, page, limit, is_public)
|
|
1097
|
+
* @returns Organization or OrganizationFullConfig (with nested tenants if includeTenants=true)
|
|
1098
|
+
*
|
|
1099
|
+
* @example
|
|
1100
|
+
* ```typescript
|
|
1101
|
+
* // Get organization only
|
|
1102
|
+
* const org = await slotly.organization.getById('org-123');
|
|
1103
|
+
*
|
|
1104
|
+
* // Get organization with tenants
|
|
1105
|
+
* const orgWithTenants = await slotly.organization.getById('org-123', {
|
|
1106
|
+
* includeTenants: true,
|
|
1107
|
+
* page: 1,
|
|
1108
|
+
* limit: 10,
|
|
1109
|
+
* is_public: true
|
|
1110
|
+
* });
|
|
1111
|
+
* ```
|
|
1112
|
+
*/
|
|
1113
|
+
getById(identifier: string, options?: GetOrganizationOptions): Promise<ApiResponse<Organization | OrganizationFullConfig>>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Get organization by slug (alias for getById)
|
|
1116
|
+
* GET /api/v1/organizations/:slug
|
|
1117
|
+
*
|
|
1118
|
+
* @param slug - Organization slug
|
|
1119
|
+
* @param options - Query options (includeTenants, page, limit, is_public)
|
|
1120
|
+
* @returns Organization or OrganizationFullConfig (with nested tenants if includeTenants=true)
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1123
|
+
* ```typescript
|
|
1124
|
+
* const org = await slotly.organization.getBySlug('acme-corp', {
|
|
1125
|
+
* includeTenants: true
|
|
1126
|
+
* });
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1129
|
+
getBySlug(slug: string, options?: GetOrganizationOptions): Promise<ApiResponse<Organization | OrganizationFullConfig>>;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
946
1132
|
/**
|
|
947
1133
|
* Custom error classes for Slotly SDK
|
|
948
1134
|
*/
|
|
@@ -1104,6 +1290,7 @@ interface SlotlyApi {
|
|
|
1104
1290
|
studio: StudioClient;
|
|
1105
1291
|
notification: NotificationClient;
|
|
1106
1292
|
dataQuality: DataQualityClient;
|
|
1293
|
+
organization: OrganizationClient;
|
|
1107
1294
|
}
|
|
1108
1295
|
/**
|
|
1109
1296
|
* Initialize and configure a new Slotly API client with dual authentication.
|
|
@@ -1168,4 +1355,4 @@ interface SlotlyApi {
|
|
|
1168
1355
|
*/
|
|
1169
1356
|
declare const useSlotly: (options: SlotlyClientOptions) => SlotlyApi;
|
|
1170
1357
|
|
|
1171
|
-
export { type ApiResponse, type Booking, type Category, type Customer, type DataQualityIssue, type Flow, type FlowStep, type Notification, type Service, type ServiceItem, type ServiceItemWithService, type ServiceWithItems, type Slot, type SlotlyApi, SlotlyApiError, type SlotlyAuthContext, SlotlyAuthError, type SlotlyClientOptions, SlotlyConfigurationError, SlotlyNetworkError, type SlotlyRequest, type Studio, type Tenant, type TenantBranding, type TenantFullConfig, useSlotly as default, getSlotlyContext, useSlotly, validateSlotlyRequest };
|
|
1358
|
+
export { type ApiResponse, type Booking, type BookingWithSlot, type Category, type Customer, type DataQualityIssue, type Flow, type FlowStep, type GetOrganizationOptions, type ListBookingsOptions, type Notification, type Organization, type OrganizationFullConfig, type Service, type ServiceItem, type ServiceItemWithService, type ServiceWithItems, type Slot, type SlotlyApi, SlotlyApiError, type SlotlyAuthContext, SlotlyAuthError, type SlotlyClientOptions, SlotlyConfigurationError, SlotlyNetworkError, type SlotlyRequest, type Studio, type Tenant, type TenantBranding, type TenantFullConfig, useSlotly as default, getSlotlyContext, useSlotly, validateSlotlyRequest };
|