Skip to content

Commit 35fe43b

Browse files
committed
Working version with timeslot function
1 parent a529e59 commit 35fe43b

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/OFS.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
OFSPropertyDetails,
1414
OFSPropertyListResponse,
1515
OFSGetPropertiesParams,
16+
OFSTimeslotsResponse,
1617
} from "./model";
1718

1819
export * from "./model";
@@ -566,4 +567,10 @@ export class OFS {
566567
const partialURL = `/rest/ofscMetadata/v1/properties/${data.label}`;
567568
return this._patch(partialURL, data);
568569
}
570+
571+
//Meta: Timeslots
572+
async getTimeslots(): Promise<OFSTimeslotsResponse> {
573+
const partialURL = `/rest/ofscMetadata/v1/timeSlots`;
574+
return this._get(partialURL);
575+
}
569576
}

src/model.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,26 @@ export interface OFSGetPropertiesParams {
109109
offset?: number;
110110
type?: number;
111111
}
112-
class OFSPropertyList {
112+
export class OFSPropertyList {
113113
items: OFSPropertyDetails[] = [];
114114
limit: number = 0;
115115
offset: number = 0;
116116
totalResults: number = 0;
117117
}
118-
118+
export class OFSTimeslot {
119+
active: boolean = false;
120+
isAllDay: boolean = false;
121+
timeEnd: string = "";
122+
timeStart: string = "";
123+
label: string = "";
124+
name: string = "";
125+
}
126+
export class OFSTimeslotsList {
127+
items: OFSTimeslot[] = [];
128+
limit: number = 0;
129+
offset: number = 0;
130+
totalResults: number = 0;
131+
}
119132
export class OFSSubscriptionResponse extends OFSResponse {
120133
data: SubscriptionListResponse = {
121134
totalResults: 0,
@@ -146,3 +159,7 @@ export class OFSPropertyDetailsResponse extends OFSResponse {
146159
export class OFSPropertyListResponse extends OFSResponse {
147160
data: OFSPropertyList = new OFSPropertyList();
148161
}
162+
163+
export class OFSTimeslotsResponse extends OFSResponse {
164+
data: OFSTimeslotsList = new OFSTimeslotsList();
165+
}

0 commit comments

Comments
 (0)