@atzentis/booking-sdk 0.1.7 → 0.1.9
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.cjs +712 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1696 -40
- package/dist/index.d.ts +1696 -40
- package/dist/index.js +704 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1039,6 +1039,327 @@ var CategoriesService = class extends BaseService {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
|
|
1042
|
+
// src/services/distribution.ts
|
|
1043
|
+
var DistributionService = class extends BaseService {
|
|
1044
|
+
constructor() {
|
|
1045
|
+
super(...arguments);
|
|
1046
|
+
this.basePath = "/distribution/v1";
|
|
1047
|
+
}
|
|
1048
|
+
// ---------------------------------------------------------------------------
|
|
1049
|
+
// Channel CRUD
|
|
1050
|
+
// ---------------------------------------------------------------------------
|
|
1051
|
+
/** Create a new distribution channel */
|
|
1052
|
+
createChannel(input) {
|
|
1053
|
+
return this._post(this._buildPath("channels"), input);
|
|
1054
|
+
}
|
|
1055
|
+
/** Get a channel by ID */
|
|
1056
|
+
getChannel(channelId) {
|
|
1057
|
+
return this._get(this._buildPath("channels", channelId));
|
|
1058
|
+
}
|
|
1059
|
+
/** List channels with optional filters */
|
|
1060
|
+
listChannels(params) {
|
|
1061
|
+
if (!params) return this._get(this._buildPath("channels"));
|
|
1062
|
+
const query = {};
|
|
1063
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1064
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1065
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1066
|
+
if (params.enabled !== void 0) query.enabled = params.enabled;
|
|
1067
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1068
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1069
|
+
return this._get(this._buildPath("channels"), query);
|
|
1070
|
+
}
|
|
1071
|
+
/** Update a channel */
|
|
1072
|
+
updateChannel(channelId, input) {
|
|
1073
|
+
return this._patch(this._buildPath("channels", channelId), input);
|
|
1074
|
+
}
|
|
1075
|
+
/** Delete a channel */
|
|
1076
|
+
deleteChannel(channelId) {
|
|
1077
|
+
return this._delete(this._buildPath("channels", channelId));
|
|
1078
|
+
}
|
|
1079
|
+
// ---------------------------------------------------------------------------
|
|
1080
|
+
// Mapping management
|
|
1081
|
+
// ---------------------------------------------------------------------------
|
|
1082
|
+
/** Create a mapping between a local category and OTA room type/rate plan */
|
|
1083
|
+
createMapping(channelId, input) {
|
|
1084
|
+
return this._post(this._buildPath("channels", channelId, "mappings"), input);
|
|
1085
|
+
}
|
|
1086
|
+
/** List mappings for a channel */
|
|
1087
|
+
listMappings(channelId, params) {
|
|
1088
|
+
if (!params) {
|
|
1089
|
+
return this._get(this._buildPath("channels", channelId, "mappings"));
|
|
1090
|
+
}
|
|
1091
|
+
const query = {};
|
|
1092
|
+
if (params.localCategoryId !== void 0) query.localCategoryId = params.localCategoryId;
|
|
1093
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1094
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1095
|
+
return this._get(this._buildPath("channels", channelId, "mappings"), query);
|
|
1096
|
+
}
|
|
1097
|
+
/** Delete a mapping */
|
|
1098
|
+
deleteMapping(channelId, mappingId) {
|
|
1099
|
+
return this._delete(this._buildPath("channels", channelId, "mappings", mappingId));
|
|
1100
|
+
}
|
|
1101
|
+
// ---------------------------------------------------------------------------
|
|
1102
|
+
// Push/pull sync
|
|
1103
|
+
// ---------------------------------------------------------------------------
|
|
1104
|
+
/** Push availability and rates to a channel */
|
|
1105
|
+
push(channelId, input) {
|
|
1106
|
+
return this._post(this._buildPath("channels", channelId, "push"), input ?? {});
|
|
1107
|
+
}
|
|
1108
|
+
/** Pull reservations from a channel */
|
|
1109
|
+
pull(channelId, input) {
|
|
1110
|
+
return this._post(this._buildPath("channels", channelId, "pull"), input ?? {});
|
|
1111
|
+
}
|
|
1112
|
+
/** Get sync operation log for a channel */
|
|
1113
|
+
getSyncLog(channelId, params) {
|
|
1114
|
+
if (!params) {
|
|
1115
|
+
return this._get(this._buildPath("channels", channelId, "sync-log"));
|
|
1116
|
+
}
|
|
1117
|
+
const query = {};
|
|
1118
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1119
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1120
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1121
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1122
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1123
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1124
|
+
return this._get(this._buildPath("channels", channelId, "sync-log"), query);
|
|
1125
|
+
}
|
|
1126
|
+
// ---------------------------------------------------------------------------
|
|
1127
|
+
// iCal import/export
|
|
1128
|
+
// ---------------------------------------------------------------------------
|
|
1129
|
+
/** Import availability from an external iCal feed */
|
|
1130
|
+
icalImport(input) {
|
|
1131
|
+
return this._post(this._buildPath("ical", "import"), input);
|
|
1132
|
+
}
|
|
1133
|
+
/** Get iCal export URL for a space */
|
|
1134
|
+
icalExport(spaceId) {
|
|
1135
|
+
return this._get(this._buildPath("ical", "export", spaceId));
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
// src/services/finance.ts
|
|
1140
|
+
var FinanceService = class extends BaseService {
|
|
1141
|
+
constructor() {
|
|
1142
|
+
super(...arguments);
|
|
1143
|
+
this.basePath = "/finance/v1";
|
|
1144
|
+
}
|
|
1145
|
+
// ---------------------------------------------------------------------------
|
|
1146
|
+
// Folio CRUD and lifecycle
|
|
1147
|
+
// ---------------------------------------------------------------------------
|
|
1148
|
+
/** Create a new folio for a booking */
|
|
1149
|
+
createFolio(input) {
|
|
1150
|
+
return this._post(this._buildPath("folios"), input);
|
|
1151
|
+
}
|
|
1152
|
+
/** Get a folio by ID */
|
|
1153
|
+
getFolio(folioId) {
|
|
1154
|
+
return this._get(this._buildPath("folios", folioId));
|
|
1155
|
+
}
|
|
1156
|
+
/** List folios with optional filters */
|
|
1157
|
+
listFolios(params) {
|
|
1158
|
+
if (!params) return this._get(this._buildPath("folios"));
|
|
1159
|
+
const query = {};
|
|
1160
|
+
if (params.bookingId !== void 0) query.bookingId = params.bookingId;
|
|
1161
|
+
if (params.guestId !== void 0) query.guestId = params.guestId;
|
|
1162
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1163
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1164
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1165
|
+
return this._get(this._buildPath("folios"), query);
|
|
1166
|
+
}
|
|
1167
|
+
/** Update a folio */
|
|
1168
|
+
updateFolio(folioId, input) {
|
|
1169
|
+
return this._patch(this._buildPath("folios", folioId), input);
|
|
1170
|
+
}
|
|
1171
|
+
/** Close a folio (no more charges can be added) */
|
|
1172
|
+
closeFolio(folioId) {
|
|
1173
|
+
return this._post(this._buildPath("folios", folioId, "close"), {});
|
|
1174
|
+
}
|
|
1175
|
+
/** Settle a folio (mark as fully paid) */
|
|
1176
|
+
settleFolio(folioId) {
|
|
1177
|
+
return this._post(this._buildPath("folios", folioId, "settle"), {});
|
|
1178
|
+
}
|
|
1179
|
+
// ---------------------------------------------------------------------------
|
|
1180
|
+
// Charge operations
|
|
1181
|
+
// ---------------------------------------------------------------------------
|
|
1182
|
+
/** Create a charge on a folio */
|
|
1183
|
+
createCharge(folioId, input) {
|
|
1184
|
+
return this._post(this._buildPath("folios", folioId, "charges"), input);
|
|
1185
|
+
}
|
|
1186
|
+
/** List charges on a folio */
|
|
1187
|
+
listCharges(folioId, params) {
|
|
1188
|
+
if (!params) {
|
|
1189
|
+
return this._get(this._buildPath("folios", folioId, "charges"));
|
|
1190
|
+
}
|
|
1191
|
+
const query = {};
|
|
1192
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1193
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1194
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1195
|
+
return this._get(this._buildPath("folios", folioId, "charges"), query);
|
|
1196
|
+
}
|
|
1197
|
+
/** Create a transitory (non-billable) charge on a folio */
|
|
1198
|
+
createTransitoryCharge(folioId, input) {
|
|
1199
|
+
return this._post(
|
|
1200
|
+
this._buildPath("folios", folioId, "charges", "transitory"),
|
|
1201
|
+
input
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
/** Move charges from one folio to another */
|
|
1205
|
+
moveCharges(folioId, input) {
|
|
1206
|
+
return this._post(
|
|
1207
|
+
this._buildPath("folios", folioId, "charges", "move"),
|
|
1208
|
+
input
|
|
1209
|
+
);
|
|
1210
|
+
}
|
|
1211
|
+
// ---------------------------------------------------------------------------
|
|
1212
|
+
// Folio payment operations
|
|
1213
|
+
// ---------------------------------------------------------------------------
|
|
1214
|
+
/** Record a payment on a folio */
|
|
1215
|
+
createFolioPayment(folioId, input) {
|
|
1216
|
+
return this._post(this._buildPath("folios", folioId, "payments"), input);
|
|
1217
|
+
}
|
|
1218
|
+
/** List payments on a folio */
|
|
1219
|
+
listFolioPayments(folioId, params) {
|
|
1220
|
+
if (!params) {
|
|
1221
|
+
return this._get(this._buildPath("folios", folioId, "payments"));
|
|
1222
|
+
}
|
|
1223
|
+
const query = {};
|
|
1224
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1225
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1226
|
+
return this._get(this._buildPath("folios", folioId, "payments"), query);
|
|
1227
|
+
}
|
|
1228
|
+
// ---------------------------------------------------------------------------
|
|
1229
|
+
// Invoice operations
|
|
1230
|
+
// ---------------------------------------------------------------------------
|
|
1231
|
+
/** Generate an invoice for a folio */
|
|
1232
|
+
generateInvoice(folioId, input) {
|
|
1233
|
+
return this._post(this._buildPath("folios", folioId, "invoice"), input ?? {});
|
|
1234
|
+
}
|
|
1235
|
+
/** Get an invoice by ID */
|
|
1236
|
+
getInvoice(invoiceId) {
|
|
1237
|
+
return this._get(this._buildPath("invoices", invoiceId));
|
|
1238
|
+
}
|
|
1239
|
+
/** Get invoice as PDF binary data */
|
|
1240
|
+
getInvoicePdf(invoiceId) {
|
|
1241
|
+
return this._get(this._buildPath("invoices", invoiceId, "pdf"));
|
|
1242
|
+
}
|
|
1243
|
+
// ---------------------------------------------------------------------------
|
|
1244
|
+
// Accounting reports
|
|
1245
|
+
// ---------------------------------------------------------------------------
|
|
1246
|
+
/** Get daily accounting report */
|
|
1247
|
+
getDailyReport(params) {
|
|
1248
|
+
if (!params) return this._get(this._buildPath("accounting", "daily"));
|
|
1249
|
+
const query = {};
|
|
1250
|
+
if (params.date !== void 0) query.date = params.date;
|
|
1251
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1252
|
+
return this._get(this._buildPath("accounting", "daily"), query);
|
|
1253
|
+
}
|
|
1254
|
+
/** Get revenue report by charge type */
|
|
1255
|
+
getRevenueReport(params) {
|
|
1256
|
+
if (!params)
|
|
1257
|
+
return this._get(this._buildPath("accounting", "revenue"));
|
|
1258
|
+
const query = {};
|
|
1259
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1260
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1261
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1262
|
+
return this._get(this._buildPath("accounting", "revenue"), query);
|
|
1263
|
+
}
|
|
1264
|
+
/** Get VAT accounting report */
|
|
1265
|
+
getVatReport(params) {
|
|
1266
|
+
if (!params) return this._get(this._buildPath("accounting", "vat"));
|
|
1267
|
+
const query = {};
|
|
1268
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1269
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1270
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1271
|
+
return this._get(this._buildPath("accounting", "vat"), query);
|
|
1272
|
+
}
|
|
1273
|
+
// ---------------------------------------------------------------------------
|
|
1274
|
+
// POS Bridge operations (P13)
|
|
1275
|
+
// ---------------------------------------------------------------------------
|
|
1276
|
+
/** Post a POS charge to a guest folio */
|
|
1277
|
+
folioPost(input) {
|
|
1278
|
+
return this._post(this._buildPath("folio-post"), input);
|
|
1279
|
+
}
|
|
1280
|
+
/** List POS charges on a folio */
|
|
1281
|
+
listFolioPostCharges(folioId, params) {
|
|
1282
|
+
if (!params) {
|
|
1283
|
+
return this._get(this._buildPath("folio-post", folioId));
|
|
1284
|
+
}
|
|
1285
|
+
const query = {};
|
|
1286
|
+
if (params.posTerminalId !== void 0) query.posTerminalId = params.posTerminalId;
|
|
1287
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1288
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1289
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1290
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1291
|
+
return this._get(this._buildPath("folio-post", folioId), query);
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
// src/services/groups.ts
|
|
1296
|
+
var GroupsService = class extends BaseService {
|
|
1297
|
+
constructor() {
|
|
1298
|
+
super(...arguments);
|
|
1299
|
+
this.basePath = "/booking/v1/groups";
|
|
1300
|
+
}
|
|
1301
|
+
// ---------------------------------------------------------------------------
|
|
1302
|
+
// Group CRUD
|
|
1303
|
+
// ---------------------------------------------------------------------------
|
|
1304
|
+
/** Create a group booking */
|
|
1305
|
+
create(input) {
|
|
1306
|
+
return this._post(this.basePath, input);
|
|
1307
|
+
}
|
|
1308
|
+
/** Get a group booking by ID */
|
|
1309
|
+
get(groupId) {
|
|
1310
|
+
return this._get(this._buildPath(groupId));
|
|
1311
|
+
}
|
|
1312
|
+
/** List group bookings with filters */
|
|
1313
|
+
list(params) {
|
|
1314
|
+
const query = {};
|
|
1315
|
+
query.propertyId = params.propertyId;
|
|
1316
|
+
if (params.status !== void 0) {
|
|
1317
|
+
query.status = Array.isArray(params.status) ? params.status.join(",") : params.status;
|
|
1318
|
+
}
|
|
1319
|
+
if (params.type !== void 0) {
|
|
1320
|
+
query.type = Array.isArray(params.type) ? params.type.join(",") : params.type;
|
|
1321
|
+
}
|
|
1322
|
+
if (params.search !== void 0) query.search = params.search;
|
|
1323
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1324
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1325
|
+
return this._get(this.basePath, query);
|
|
1326
|
+
}
|
|
1327
|
+
/** Update a group booking */
|
|
1328
|
+
update(groupId, input) {
|
|
1329
|
+
return this._patch(this._buildPath(groupId), input);
|
|
1330
|
+
}
|
|
1331
|
+
/** Delete a group booking */
|
|
1332
|
+
delete(groupId) {
|
|
1333
|
+
return this._delete(this._buildPath(groupId));
|
|
1334
|
+
}
|
|
1335
|
+
// ---------------------------------------------------------------------------
|
|
1336
|
+
// Block management
|
|
1337
|
+
// ---------------------------------------------------------------------------
|
|
1338
|
+
/** Create a room block for a group */
|
|
1339
|
+
createBlock(groupId, input) {
|
|
1340
|
+
return this._post(this._buildPath(groupId, "blocks"), input);
|
|
1341
|
+
}
|
|
1342
|
+
/** List blocks for a group */
|
|
1343
|
+
listBlocks(groupId) {
|
|
1344
|
+
return this._get(this._buildPath(groupId, "blocks"));
|
|
1345
|
+
}
|
|
1346
|
+
// ---------------------------------------------------------------------------
|
|
1347
|
+
// Pickup, release, and folio
|
|
1348
|
+
// ---------------------------------------------------------------------------
|
|
1349
|
+
/** Get pickup tracking data for a group */
|
|
1350
|
+
getPickup(groupId) {
|
|
1351
|
+
return this._get(this._buildPath(groupId, "pickup"));
|
|
1352
|
+
}
|
|
1353
|
+
/** Release blocks back to inventory */
|
|
1354
|
+
release(groupId, input) {
|
|
1355
|
+
return this._post(this._buildPath(groupId, "release"), input ?? {});
|
|
1356
|
+
}
|
|
1357
|
+
/** Create a master folio for a group */
|
|
1358
|
+
createFolio(groupId, input) {
|
|
1359
|
+
return this._post(this._buildPath(groupId, "folio"), input ?? {});
|
|
1360
|
+
}
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1042
1363
|
// src/services/guests.ts
|
|
1043
1364
|
var GuestsService = class extends BaseService {
|
|
1044
1365
|
constructor() {
|
|
@@ -1318,6 +1639,184 @@ var GuestsService = class extends BaseService {
|
|
|
1318
1639
|
}
|
|
1319
1640
|
};
|
|
1320
1641
|
|
|
1642
|
+
// src/services/housekeeping.ts
|
|
1643
|
+
var HousekeepingService = class extends BaseService {
|
|
1644
|
+
constructor() {
|
|
1645
|
+
super(...arguments);
|
|
1646
|
+
this.basePath = "/operations/v1/housekeeping";
|
|
1647
|
+
}
|
|
1648
|
+
// ---------------------------------------------------------------------------
|
|
1649
|
+
// Board and space status
|
|
1650
|
+
// ---------------------------------------------------------------------------
|
|
1651
|
+
/** Get the housekeeping board with optional filters */
|
|
1652
|
+
getBoard(params) {
|
|
1653
|
+
if (!params) return this._get(this._buildPath("board"));
|
|
1654
|
+
const query = {};
|
|
1655
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1656
|
+
if (params.floor !== void 0) query.floor = params.floor;
|
|
1657
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1658
|
+
if (params.assignedTo !== void 0) query.assignedTo = params.assignedTo;
|
|
1659
|
+
return this._get(this._buildPath("board"), query);
|
|
1660
|
+
}
|
|
1661
|
+
/** Update the housekeeping status of a space */
|
|
1662
|
+
updateSpaceStatus(spaceId, input) {
|
|
1663
|
+
return this._patch(this._buildPath("spaces", spaceId), input);
|
|
1664
|
+
}
|
|
1665
|
+
// ---------------------------------------------------------------------------
|
|
1666
|
+
// Task CRUD
|
|
1667
|
+
// ---------------------------------------------------------------------------
|
|
1668
|
+
/** Create a housekeeping task */
|
|
1669
|
+
createTask(input) {
|
|
1670
|
+
return this._post(this._buildPath("tasks"), input);
|
|
1671
|
+
}
|
|
1672
|
+
/** List housekeeping tasks with optional filters */
|
|
1673
|
+
listTasks(params) {
|
|
1674
|
+
if (!params) return this._get(this._buildPath("tasks"));
|
|
1675
|
+
const query = {};
|
|
1676
|
+
if (params.spaceId !== void 0) query.spaceId = params.spaceId;
|
|
1677
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1678
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1679
|
+
if (params.assignedTo !== void 0) query.assignedTo = params.assignedTo;
|
|
1680
|
+
if (params.priority !== void 0) query.priority = params.priority;
|
|
1681
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1682
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1683
|
+
return this._get(this._buildPath("tasks"), query);
|
|
1684
|
+
}
|
|
1685
|
+
/** Update a housekeeping task */
|
|
1686
|
+
updateTask(taskId, input) {
|
|
1687
|
+
return this._patch(this._buildPath("tasks", taskId), input);
|
|
1688
|
+
}
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
// src/services/night-audit.ts
|
|
1692
|
+
var NightAuditService = class extends BaseService {
|
|
1693
|
+
constructor() {
|
|
1694
|
+
super(...arguments);
|
|
1695
|
+
this.basePath = "/operations/v1/night-audit";
|
|
1696
|
+
}
|
|
1697
|
+
// ---------------------------------------------------------------------------
|
|
1698
|
+
// Run and history
|
|
1699
|
+
// ---------------------------------------------------------------------------
|
|
1700
|
+
/** Run a night audit for a property */
|
|
1701
|
+
run(input) {
|
|
1702
|
+
return this._post(this._buildPath("run"), input);
|
|
1703
|
+
}
|
|
1704
|
+
/** Get night audit history with optional filters */
|
|
1705
|
+
getHistory(params) {
|
|
1706
|
+
if (!params) return this._get(this._buildPath("history"));
|
|
1707
|
+
const query = {};
|
|
1708
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1709
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1710
|
+
if (params.fromDate !== void 0) query.fromDate = params.fromDate;
|
|
1711
|
+
if (params.toDate !== void 0) query.toDate = params.toDate;
|
|
1712
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1713
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1714
|
+
return this._get(this._buildPath("history"), query);
|
|
1715
|
+
}
|
|
1716
|
+
// ---------------------------------------------------------------------------
|
|
1717
|
+
// Report
|
|
1718
|
+
// ---------------------------------------------------------------------------
|
|
1719
|
+
/** Get the detailed report for a completed night audit */
|
|
1720
|
+
getReport(auditId) {
|
|
1721
|
+
return this._get(this._buildPath(auditId, "report"));
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
// src/services/payments.ts
|
|
1726
|
+
var PaymentsService = class extends BaseService {
|
|
1727
|
+
constructor() {
|
|
1728
|
+
super(...arguments);
|
|
1729
|
+
this.basePath = "/payment/v1";
|
|
1730
|
+
}
|
|
1731
|
+
// ---------------------------------------------------------------------------
|
|
1732
|
+
// Process and refund
|
|
1733
|
+
// ---------------------------------------------------------------------------
|
|
1734
|
+
/** Process a payment for a booking */
|
|
1735
|
+
process(input) {
|
|
1736
|
+
return this._post(this._buildPath("payments"), input);
|
|
1737
|
+
}
|
|
1738
|
+
/** Refund a payment (full or partial) */
|
|
1739
|
+
refund(paymentId, input) {
|
|
1740
|
+
return this._post(this._buildPath("payments", paymentId, "refund"), input ?? {});
|
|
1741
|
+
}
|
|
1742
|
+
// ---------------------------------------------------------------------------
|
|
1743
|
+
// Transactions
|
|
1744
|
+
// ---------------------------------------------------------------------------
|
|
1745
|
+
/** Get a transaction by ID */
|
|
1746
|
+
getTransaction(transactionId) {
|
|
1747
|
+
return this._get(this._buildPath("transactions", transactionId));
|
|
1748
|
+
}
|
|
1749
|
+
/** List transactions with optional filters */
|
|
1750
|
+
listTransactions(params) {
|
|
1751
|
+
if (!params) return this._get(this._buildPath("transactions"));
|
|
1752
|
+
const query = {};
|
|
1753
|
+
if (params.bookingId !== void 0) query.bookingId = params.bookingId;
|
|
1754
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1755
|
+
if (params.provider !== void 0) query.provider = params.provider;
|
|
1756
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1757
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1758
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1759
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1760
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1761
|
+
return this._get(this._buildPath("transactions"), query);
|
|
1762
|
+
}
|
|
1763
|
+
// ---------------------------------------------------------------------------
|
|
1764
|
+
// Payment accounts (stored cards)
|
|
1765
|
+
// ---------------------------------------------------------------------------
|
|
1766
|
+
/** Create a payment account (store a card on file) */
|
|
1767
|
+
createAccount(input) {
|
|
1768
|
+
return this._post(this._buildPath("accounts"), input);
|
|
1769
|
+
}
|
|
1770
|
+
/** Get a payment account by ID */
|
|
1771
|
+
getAccount(accountId) {
|
|
1772
|
+
return this._get(this._buildPath("accounts", accountId));
|
|
1773
|
+
}
|
|
1774
|
+
/** List payment accounts with optional filters */
|
|
1775
|
+
listAccounts(params) {
|
|
1776
|
+
if (!params) return this._get(this._buildPath("accounts"));
|
|
1777
|
+
const query = {};
|
|
1778
|
+
if (params.bookingId !== void 0) query.bookingId = params.bookingId;
|
|
1779
|
+
if (params.guestId !== void 0) query.guestId = params.guestId;
|
|
1780
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1781
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1782
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1783
|
+
return this._get(this._buildPath("accounts"), query);
|
|
1784
|
+
}
|
|
1785
|
+
/** Delete a payment account */
|
|
1786
|
+
deleteAccount(accountId) {
|
|
1787
|
+
return this._delete(this._buildPath("accounts", accountId));
|
|
1788
|
+
}
|
|
1789
|
+
// ---------------------------------------------------------------------------
|
|
1790
|
+
// Authorize and capture
|
|
1791
|
+
// ---------------------------------------------------------------------------
|
|
1792
|
+
/** Authorize a hold on a stored card */
|
|
1793
|
+
authorize(accountId, input) {
|
|
1794
|
+
return this._post(this._buildPath("accounts", accountId, "authorize"), input);
|
|
1795
|
+
}
|
|
1796
|
+
/** Capture a previously authorized hold */
|
|
1797
|
+
capture(accountId, input) {
|
|
1798
|
+
return this._post(this._buildPath("accounts", accountId, "capture"), input);
|
|
1799
|
+
}
|
|
1800
|
+
// ---------------------------------------------------------------------------
|
|
1801
|
+
// Terminal operations
|
|
1802
|
+
// ---------------------------------------------------------------------------
|
|
1803
|
+
/** Initiate a POS terminal payment authorization */
|
|
1804
|
+
terminalAuthorize(input) {
|
|
1805
|
+
return this._post(this._buildPath("terminal", "authorize"), input);
|
|
1806
|
+
}
|
|
1807
|
+
// ---------------------------------------------------------------------------
|
|
1808
|
+
// IRIS operations
|
|
1809
|
+
// ---------------------------------------------------------------------------
|
|
1810
|
+
/** Initiate an IRIS instant bank transfer */
|
|
1811
|
+
irisInitiate(input) {
|
|
1812
|
+
return this._post(this._buildPath("iris", "initiate"), input);
|
|
1813
|
+
}
|
|
1814
|
+
/** Get the status of an IRIS transfer */
|
|
1815
|
+
irisStatus(transferId) {
|
|
1816
|
+
return this._get(this._buildPath("iris", transferId));
|
|
1817
|
+
}
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1321
1820
|
// src/services/properties.ts
|
|
1322
1821
|
var PropertiesService = class extends BaseService {
|
|
1323
1822
|
constructor() {
|
|
@@ -1391,6 +1890,100 @@ var PropertiesService = class extends BaseService {
|
|
|
1391
1890
|
}
|
|
1392
1891
|
};
|
|
1393
1892
|
|
|
1893
|
+
// src/services/rate-plans.ts
|
|
1894
|
+
var RatePlansService = class extends BaseService {
|
|
1895
|
+
constructor() {
|
|
1896
|
+
super(...arguments);
|
|
1897
|
+
this.basePath = "/rate/v1";
|
|
1898
|
+
}
|
|
1899
|
+
// ---------------------------------------------------------------------------
|
|
1900
|
+
// Rate plan CRUD
|
|
1901
|
+
// ---------------------------------------------------------------------------
|
|
1902
|
+
/** List rate plans with optional filters */
|
|
1903
|
+
list(params) {
|
|
1904
|
+
if (!params) return this._get(this._buildPath("plans"));
|
|
1905
|
+
const query = {};
|
|
1906
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
1907
|
+
if (params.categoryId !== void 0) query.categoryId = params.categoryId;
|
|
1908
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1909
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1910
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1911
|
+
return this._get(this._buildPath("plans"), query);
|
|
1912
|
+
}
|
|
1913
|
+
/** Get a rate plan by ID */
|
|
1914
|
+
get(planId) {
|
|
1915
|
+
return this._get(this._buildPath("plans", planId));
|
|
1916
|
+
}
|
|
1917
|
+
/** Create a new rate plan */
|
|
1918
|
+
create(input) {
|
|
1919
|
+
return this._post(this._buildPath("plans"), input);
|
|
1920
|
+
}
|
|
1921
|
+
/** Update a rate plan */
|
|
1922
|
+
update(planId, input) {
|
|
1923
|
+
return this._patch(this._buildPath("plans", planId), input);
|
|
1924
|
+
}
|
|
1925
|
+
/** Delete a rate plan */
|
|
1926
|
+
delete(planId) {
|
|
1927
|
+
return this._delete(this._buildPath("plans", planId));
|
|
1928
|
+
}
|
|
1929
|
+
// ---------------------------------------------------------------------------
|
|
1930
|
+
// Rate period management
|
|
1931
|
+
// ---------------------------------------------------------------------------
|
|
1932
|
+
/** List rate periods for a plan */
|
|
1933
|
+
listPeriods(planId, params) {
|
|
1934
|
+
if (!params) {
|
|
1935
|
+
return this._get(this._buildPath("plans", planId, "periods"));
|
|
1936
|
+
}
|
|
1937
|
+
const query = {};
|
|
1938
|
+
if (params.fromDate !== void 0) query.fromDate = params.fromDate;
|
|
1939
|
+
if (params.toDate !== void 0) query.toDate = params.toDate;
|
|
1940
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1941
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1942
|
+
return this._get(this._buildPath("plans", planId, "periods"), query);
|
|
1943
|
+
}
|
|
1944
|
+
/** Get a rate period by ID */
|
|
1945
|
+
getPeriod(planId, periodId) {
|
|
1946
|
+
return this._get(this._buildPath("plans", planId, "periods", periodId));
|
|
1947
|
+
}
|
|
1948
|
+
/** Create a rate period */
|
|
1949
|
+
createPeriod(planId, input) {
|
|
1950
|
+
return this._post(this._buildPath("plans", planId, "periods"), input);
|
|
1951
|
+
}
|
|
1952
|
+
/** Update a rate period */
|
|
1953
|
+
updatePeriod(planId, periodId, input) {
|
|
1954
|
+
return this._patch(this._buildPath("plans", planId, "periods", periodId), input);
|
|
1955
|
+
}
|
|
1956
|
+
// ---------------------------------------------------------------------------
|
|
1957
|
+
// Restrictions
|
|
1958
|
+
// ---------------------------------------------------------------------------
|
|
1959
|
+
/** Get restrictions for a rate plan */
|
|
1960
|
+
getRestrictions(planId) {
|
|
1961
|
+
return this._get(this._buildPath("plans", planId, "restrictions"));
|
|
1962
|
+
}
|
|
1963
|
+
/** Update restrictions for a rate plan */
|
|
1964
|
+
updateRestrictions(planId, input) {
|
|
1965
|
+
return this._patch(this._buildPath("plans", planId, "restrictions"), input);
|
|
1966
|
+
}
|
|
1967
|
+
// ---------------------------------------------------------------------------
|
|
1968
|
+
// Price calculation
|
|
1969
|
+
// ---------------------------------------------------------------------------
|
|
1970
|
+
/** Calculate price for a stay */
|
|
1971
|
+
calculate(input) {
|
|
1972
|
+
return this._post(this._buildPath("calculate"), input);
|
|
1973
|
+
}
|
|
1974
|
+
// ---------------------------------------------------------------------------
|
|
1975
|
+
// Portfolio operations
|
|
1976
|
+
// ---------------------------------------------------------------------------
|
|
1977
|
+
/** Push rates to portfolio properties */
|
|
1978
|
+
pushToPortfolio(input) {
|
|
1979
|
+
return this._post(this._buildPath("portfolio", "push"), input);
|
|
1980
|
+
}
|
|
1981
|
+
/** Compare rates across portfolio properties */
|
|
1982
|
+
comparePortfolioRates(input) {
|
|
1983
|
+
return this._post(this._buildPath("portfolio", "compare"), input);
|
|
1984
|
+
}
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1394
1987
|
// src/services/spaces.ts
|
|
1395
1988
|
var SpacesService = class extends BaseService {
|
|
1396
1989
|
constructor() {
|
|
@@ -1520,6 +2113,69 @@ var SpacesService = class extends BaseService {
|
|
|
1520
2113
|
}
|
|
1521
2114
|
};
|
|
1522
2115
|
|
|
2116
|
+
// src/services/staff.ts
|
|
2117
|
+
var StaffService = class extends BaseService {
|
|
2118
|
+
constructor() {
|
|
2119
|
+
super(...arguments);
|
|
2120
|
+
this.basePath = "/operations/v1/staff";
|
|
2121
|
+
}
|
|
2122
|
+
// ---------------------------------------------------------------------------
|
|
2123
|
+
// Staff CRUD
|
|
2124
|
+
// ---------------------------------------------------------------------------
|
|
2125
|
+
/** Create a staff member */
|
|
2126
|
+
create(input) {
|
|
2127
|
+
return this._post(this.basePath, input);
|
|
2128
|
+
}
|
|
2129
|
+
/** Get a staff member by ID */
|
|
2130
|
+
get(staffId) {
|
|
2131
|
+
return this._get(this._buildPath(staffId));
|
|
2132
|
+
}
|
|
2133
|
+
/** List staff members with optional filters */
|
|
2134
|
+
list(params) {
|
|
2135
|
+
const query = {};
|
|
2136
|
+
query.propertyId = params.propertyId;
|
|
2137
|
+
if (params.department !== void 0) {
|
|
2138
|
+
query.department = Array.isArray(params.department) ? params.department.join(",") : params.department;
|
|
2139
|
+
}
|
|
2140
|
+
if (params.role !== void 0) {
|
|
2141
|
+
query.role = Array.isArray(params.role) ? params.role.join(",") : params.role;
|
|
2142
|
+
}
|
|
2143
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2144
|
+
if (params.search !== void 0) query.search = params.search;
|
|
2145
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2146
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2147
|
+
return this._get(this.basePath, query);
|
|
2148
|
+
}
|
|
2149
|
+
/** Update a staff member */
|
|
2150
|
+
update(staffId, input) {
|
|
2151
|
+
return this._patch(this._buildPath(staffId), input);
|
|
2152
|
+
}
|
|
2153
|
+
/** Delete a staff member */
|
|
2154
|
+
delete(staffId) {
|
|
2155
|
+
return this._delete(this._buildPath(staffId));
|
|
2156
|
+
}
|
|
2157
|
+
// ---------------------------------------------------------------------------
|
|
2158
|
+
// Shift management
|
|
2159
|
+
// ---------------------------------------------------------------------------
|
|
2160
|
+
/** Create a shift for a staff member */
|
|
2161
|
+
createShift(staffId, input) {
|
|
2162
|
+
return this._post(this._buildPath(staffId, "shifts"), input);
|
|
2163
|
+
}
|
|
2164
|
+
/** List shifts for a staff member */
|
|
2165
|
+
listShifts(staffId, params) {
|
|
2166
|
+
if (!params) return this._get(this._buildPath(staffId, "shifts"));
|
|
2167
|
+
const query = {};
|
|
2168
|
+
if (params.startDate !== void 0) query.startDate = params.startDate;
|
|
2169
|
+
if (params.endDate !== void 0) query.endDate = params.endDate;
|
|
2170
|
+
if (params.shiftType !== void 0) {
|
|
2171
|
+
query.shiftType = Array.isArray(params.shiftType) ? params.shiftType.join(",") : params.shiftType;
|
|
2172
|
+
}
|
|
2173
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2174
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2175
|
+
return this._get(this._buildPath(staffId, "shifts"), query);
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
|
|
1523
2179
|
// src/client.ts
|
|
1524
2180
|
var BookingClient = class {
|
|
1525
2181
|
constructor(config) {
|
|
@@ -1547,16 +2203,51 @@ var BookingClient = class {
|
|
|
1547
2203
|
this._bookings ?? (this._bookings = new BookingsService(this.httpClient));
|
|
1548
2204
|
return this._bookings;
|
|
1549
2205
|
}
|
|
2206
|
+
/** Distribution service — lazy-initialized on first access */
|
|
2207
|
+
get distribution() {
|
|
2208
|
+
this._distribution ?? (this._distribution = new DistributionService(this.httpClient));
|
|
2209
|
+
return this._distribution;
|
|
2210
|
+
}
|
|
2211
|
+
/** Finance service — lazy-initialized on first access */
|
|
2212
|
+
get finance() {
|
|
2213
|
+
this._finance ?? (this._finance = new FinanceService(this.httpClient));
|
|
2214
|
+
return this._finance;
|
|
2215
|
+
}
|
|
2216
|
+
/** Groups service — lazy-initialized on first access */
|
|
2217
|
+
get groups() {
|
|
2218
|
+
this._groups ?? (this._groups = new GroupsService(this.httpClient));
|
|
2219
|
+
return this._groups;
|
|
2220
|
+
}
|
|
1550
2221
|
/** Guests service — lazy-initialized on first access */
|
|
1551
2222
|
get guests() {
|
|
1552
2223
|
this._guests ?? (this._guests = new GuestsService(this.httpClient));
|
|
1553
2224
|
return this._guests;
|
|
1554
2225
|
}
|
|
2226
|
+
/** Housekeeping service — lazy-initialized on first access */
|
|
2227
|
+
get housekeeping() {
|
|
2228
|
+
this._housekeeping ?? (this._housekeeping = new HousekeepingService(this.httpClient));
|
|
2229
|
+
return this._housekeeping;
|
|
2230
|
+
}
|
|
2231
|
+
/** Night audit service — lazy-initialized on first access */
|
|
2232
|
+
get nightAudit() {
|
|
2233
|
+
this._nightAudit ?? (this._nightAudit = new NightAuditService(this.httpClient));
|
|
2234
|
+
return this._nightAudit;
|
|
2235
|
+
}
|
|
2236
|
+
/** Payments service — lazy-initialized on first access */
|
|
2237
|
+
get payments() {
|
|
2238
|
+
this._payments ?? (this._payments = new PaymentsService(this.httpClient));
|
|
2239
|
+
return this._payments;
|
|
2240
|
+
}
|
|
1555
2241
|
/** Properties service — lazy-initialized on first access */
|
|
1556
2242
|
get properties() {
|
|
1557
2243
|
this._properties ?? (this._properties = new PropertiesService(this.httpClient));
|
|
1558
2244
|
return this._properties;
|
|
1559
2245
|
}
|
|
2246
|
+
/** Rate plans service — lazy-initialized on first access */
|
|
2247
|
+
get ratePlans() {
|
|
2248
|
+
this._ratePlans ?? (this._ratePlans = new RatePlansService(this.httpClient));
|
|
2249
|
+
return this._ratePlans;
|
|
2250
|
+
}
|
|
1560
2251
|
/** Categories service — lazy-initialized on first access */
|
|
1561
2252
|
get categories() {
|
|
1562
2253
|
this._categories ?? (this._categories = new CategoriesService(this.httpClient));
|
|
@@ -1567,6 +2258,11 @@ var BookingClient = class {
|
|
|
1567
2258
|
this._spaces ?? (this._spaces = new SpacesService(this.httpClient));
|
|
1568
2259
|
return this._spaces;
|
|
1569
2260
|
}
|
|
2261
|
+
/** Staff service — lazy-initialized on first access */
|
|
2262
|
+
get staff() {
|
|
2263
|
+
this._staff ?? (this._staff = new StaffService(this.httpClient));
|
|
2264
|
+
return this._staff;
|
|
2265
|
+
}
|
|
1570
2266
|
setApiKey(key) {
|
|
1571
2267
|
if (!key || key.trim().length === 0) {
|
|
1572
2268
|
throw new Error("apiKey must be a non-empty string");
|
|
@@ -1684,18 +2380,26 @@ export {
|
|
|
1684
2380
|
CategoriesService,
|
|
1685
2381
|
ConflictError,
|
|
1686
2382
|
DEFAULT_MODULES,
|
|
2383
|
+
DistributionService,
|
|
2384
|
+
FinanceService,
|
|
1687
2385
|
ForbiddenError,
|
|
2386
|
+
GroupsService,
|
|
1688
2387
|
GuestsService,
|
|
2388
|
+
HousekeepingService,
|
|
1689
2389
|
HttpClient,
|
|
2390
|
+
NightAuditService,
|
|
1690
2391
|
NotFoundError,
|
|
1691
2392
|
PROPERTY_MODULES,
|
|
1692
2393
|
PaymentError,
|
|
2394
|
+
PaymentsService,
|
|
1693
2395
|
PropertiesService,
|
|
1694
2396
|
RateLimitError,
|
|
2397
|
+
RatePlansService,
|
|
1695
2398
|
SPACE_STATUSES,
|
|
1696
2399
|
SPACE_TYPES,
|
|
1697
2400
|
ServerError,
|
|
1698
2401
|
SpacesService,
|
|
2402
|
+
StaffService,
|
|
1699
2403
|
TimeoutError,
|
|
1700
2404
|
VERSION,
|
|
1701
2405
|
ValidationError,
|