@cimplify/sdk 0.2.0 → 0.2.1
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/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +13 -8
- package/dist/index.mjs +13 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2329,7 +2329,11 @@ declare class SchedulingService {
|
|
|
2329
2329
|
private client;
|
|
2330
2330
|
constructor(client: CimplifyClient);
|
|
2331
2331
|
getServices(): Promise<Service[]>;
|
|
2332
|
-
|
|
2332
|
+
/**
|
|
2333
|
+
* Get a specific service by ID
|
|
2334
|
+
* Note: Filters from all services client-side (no single-service endpoint)
|
|
2335
|
+
*/
|
|
2336
|
+
getService(serviceId: string): Promise<Service | null>;
|
|
2333
2337
|
getAvailableSlots(input: GetAvailableSlotsInput): Promise<AvailableSlot[]>;
|
|
2334
2338
|
checkSlotAvailability(input: CheckSlotAvailabilityInput): Promise<{
|
|
2335
2339
|
available: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -2329,7 +2329,11 @@ declare class SchedulingService {
|
|
|
2329
2329
|
private client;
|
|
2330
2330
|
constructor(client: CimplifyClient);
|
|
2331
2331
|
getServices(): Promise<Service[]>;
|
|
2332
|
-
|
|
2332
|
+
/**
|
|
2333
|
+
* Get a specific service by ID
|
|
2334
|
+
* Note: Filters from all services client-side (no single-service endpoint)
|
|
2335
|
+
*/
|
|
2336
|
+
getService(serviceId: string): Promise<Service | null>;
|
|
2333
2337
|
getAvailableSlots(input: GetAvailableSlotsInput): Promise<AvailableSlot[]>;
|
|
2334
2338
|
checkSlotAvailability(input: CheckSlotAvailabilityInput): Promise<{
|
|
2335
2339
|
available: boolean;
|
package/dist/index.js
CHANGED
|
@@ -871,27 +871,32 @@ var SchedulingService = class {
|
|
|
871
871
|
async getServices() {
|
|
872
872
|
return this.client.query("scheduling.services");
|
|
873
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* Get a specific service by ID
|
|
876
|
+
* Note: Filters from all services client-side (no single-service endpoint)
|
|
877
|
+
*/
|
|
874
878
|
async getService(serviceId) {
|
|
875
|
-
|
|
879
|
+
const services = await this.getServices();
|
|
880
|
+
return services.find((s) => s.id === serviceId) || null;
|
|
876
881
|
}
|
|
877
882
|
// --------------------------------------------------------------------------
|
|
878
883
|
// AVAILABILITY
|
|
879
884
|
// --------------------------------------------------------------------------
|
|
880
885
|
async getAvailableSlots(input) {
|
|
881
886
|
return this.client.query(
|
|
882
|
-
"scheduling.
|
|
887
|
+
"scheduling.slots",
|
|
883
888
|
input
|
|
884
889
|
);
|
|
885
890
|
}
|
|
886
891
|
async checkSlotAvailability(input) {
|
|
887
892
|
return this.client.query(
|
|
888
|
-
"scheduling.
|
|
893
|
+
"scheduling.check_availability",
|
|
889
894
|
input
|
|
890
895
|
);
|
|
891
896
|
}
|
|
892
897
|
async getServiceAvailability(params) {
|
|
893
898
|
return this.client.query(
|
|
894
|
-
"scheduling.
|
|
899
|
+
"scheduling.availability",
|
|
895
900
|
params
|
|
896
901
|
);
|
|
897
902
|
}
|
|
@@ -899,19 +904,19 @@ var SchedulingService = class {
|
|
|
899
904
|
// BOOKINGS
|
|
900
905
|
// --------------------------------------------------------------------------
|
|
901
906
|
async getBooking(bookingId) {
|
|
902
|
-
return this.client.query(`scheduling
|
|
907
|
+
return this.client.query(`scheduling.${bookingId}`);
|
|
903
908
|
}
|
|
904
909
|
async getCustomerBookings() {
|
|
905
|
-
return this.client.query("scheduling
|
|
910
|
+
return this.client.query("scheduling");
|
|
906
911
|
}
|
|
907
912
|
async getUpcomingBookings() {
|
|
908
913
|
return this.client.query(
|
|
909
|
-
"scheduling
|
|
914
|
+
"scheduling[?(@.status!='completed' && @.status!='cancelled')]#sort(start_time,asc)"
|
|
910
915
|
);
|
|
911
916
|
}
|
|
912
917
|
async getPastBookings(limit = 10) {
|
|
913
918
|
return this.client.query(
|
|
914
|
-
`scheduling
|
|
919
|
+
`scheduling[?(@.status=='completed')]#sort(start_time,desc)#limit(${limit})`
|
|
915
920
|
);
|
|
916
921
|
}
|
|
917
922
|
// --------------------------------------------------------------------------
|
package/dist/index.mjs
CHANGED
|
@@ -869,27 +869,32 @@ var SchedulingService = class {
|
|
|
869
869
|
async getServices() {
|
|
870
870
|
return this.client.query("scheduling.services");
|
|
871
871
|
}
|
|
872
|
+
/**
|
|
873
|
+
* Get a specific service by ID
|
|
874
|
+
* Note: Filters from all services client-side (no single-service endpoint)
|
|
875
|
+
*/
|
|
872
876
|
async getService(serviceId) {
|
|
873
|
-
|
|
877
|
+
const services = await this.getServices();
|
|
878
|
+
return services.find((s) => s.id === serviceId) || null;
|
|
874
879
|
}
|
|
875
880
|
// --------------------------------------------------------------------------
|
|
876
881
|
// AVAILABILITY
|
|
877
882
|
// --------------------------------------------------------------------------
|
|
878
883
|
async getAvailableSlots(input) {
|
|
879
884
|
return this.client.query(
|
|
880
|
-
"scheduling.
|
|
885
|
+
"scheduling.slots",
|
|
881
886
|
input
|
|
882
887
|
);
|
|
883
888
|
}
|
|
884
889
|
async checkSlotAvailability(input) {
|
|
885
890
|
return this.client.query(
|
|
886
|
-
"scheduling.
|
|
891
|
+
"scheduling.check_availability",
|
|
887
892
|
input
|
|
888
893
|
);
|
|
889
894
|
}
|
|
890
895
|
async getServiceAvailability(params) {
|
|
891
896
|
return this.client.query(
|
|
892
|
-
"scheduling.
|
|
897
|
+
"scheduling.availability",
|
|
893
898
|
params
|
|
894
899
|
);
|
|
895
900
|
}
|
|
@@ -897,19 +902,19 @@ var SchedulingService = class {
|
|
|
897
902
|
// BOOKINGS
|
|
898
903
|
// --------------------------------------------------------------------------
|
|
899
904
|
async getBooking(bookingId) {
|
|
900
|
-
return this.client.query(`scheduling
|
|
905
|
+
return this.client.query(`scheduling.${bookingId}`);
|
|
901
906
|
}
|
|
902
907
|
async getCustomerBookings() {
|
|
903
|
-
return this.client.query("scheduling
|
|
908
|
+
return this.client.query("scheduling");
|
|
904
909
|
}
|
|
905
910
|
async getUpcomingBookings() {
|
|
906
911
|
return this.client.query(
|
|
907
|
-
"scheduling
|
|
912
|
+
"scheduling[?(@.status!='completed' && @.status!='cancelled')]#sort(start_time,asc)"
|
|
908
913
|
);
|
|
909
914
|
}
|
|
910
915
|
async getPastBookings(limit = 10) {
|
|
911
916
|
return this.client.query(
|
|
912
|
-
`scheduling
|
|
917
|
+
`scheduling[?(@.status=='completed')]#sort(start_time,desc)#limit(${limit})`
|
|
913
918
|
);
|
|
914
919
|
}
|
|
915
920
|
// --------------------------------------------------------------------------
|