@atzentis/booking-sdk 0.1.9 → 0.1.11
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 +914 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1975 -50
- package/dist/index.d.ts +1975 -50
- package/dist/index.js +901 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1039,6 +1039,176 @@ var CategoriesService = class extends BaseService {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
1041
|
|
|
1042
|
+
// src/services/concierge.ts
|
|
1043
|
+
var ConciergeService = class extends BaseService {
|
|
1044
|
+
constructor() {
|
|
1045
|
+
super(...arguments);
|
|
1046
|
+
this.basePath = "/concierge/v1";
|
|
1047
|
+
}
|
|
1048
|
+
// ---------------------------------------------------------------------------
|
|
1049
|
+
// Conversations
|
|
1050
|
+
// ---------------------------------------------------------------------------
|
|
1051
|
+
/** Create a new guest conversation */
|
|
1052
|
+
createConversation(input) {
|
|
1053
|
+
return this._post(this._buildPath("conversations"), input);
|
|
1054
|
+
}
|
|
1055
|
+
/** Get a conversation by ID */
|
|
1056
|
+
getConversation(conversationId) {
|
|
1057
|
+
return this._get(this._buildPath("conversations", conversationId));
|
|
1058
|
+
}
|
|
1059
|
+
/** List conversations with optional filters */
|
|
1060
|
+
listConversations(params) {
|
|
1061
|
+
const query = {};
|
|
1062
|
+
query.propertyId = params.propertyId;
|
|
1063
|
+
if (params.guestId !== void 0) query.guestId = params.guestId;
|
|
1064
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1065
|
+
if (params.channel !== void 0) query.channel = params.channel;
|
|
1066
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1067
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1068
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
1069
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
1070
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1071
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1072
|
+
return this._get(this._buildPath("conversations"), query);
|
|
1073
|
+
}
|
|
1074
|
+
// ---------------------------------------------------------------------------
|
|
1075
|
+
// Messages
|
|
1076
|
+
// ---------------------------------------------------------------------------
|
|
1077
|
+
/** Send a message in a conversation */
|
|
1078
|
+
sendMessage(conversationId, input) {
|
|
1079
|
+
return this._post(
|
|
1080
|
+
this._buildPath("conversations", conversationId, "messages"),
|
|
1081
|
+
input
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
// ---------------------------------------------------------------------------
|
|
1085
|
+
// Context & Escalation
|
|
1086
|
+
// ---------------------------------------------------------------------------
|
|
1087
|
+
/** Get the full context for a conversation (property, guest, booking, FAQ) */
|
|
1088
|
+
getContext(conversationId) {
|
|
1089
|
+
return this._get(
|
|
1090
|
+
this._buildPath("conversations", conversationId, "context")
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
/** Escalate a conversation to staff */
|
|
1094
|
+
escalate(conversationId, input) {
|
|
1095
|
+
return this._post(
|
|
1096
|
+
this._buildPath("conversations", conversationId, "escalate"),
|
|
1097
|
+
input ?? {}
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
/** Resolve a conversation */
|
|
1101
|
+
resolve(conversationId, input) {
|
|
1102
|
+
return this._post(
|
|
1103
|
+
this._buildPath("conversations", conversationId, "resolve"),
|
|
1104
|
+
input ?? {}
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
// ---------------------------------------------------------------------------
|
|
1108
|
+
// Templates
|
|
1109
|
+
// ---------------------------------------------------------------------------
|
|
1110
|
+
/** Create a response template */
|
|
1111
|
+
createTemplate(input) {
|
|
1112
|
+
return this._post(this._buildPath("templates"), input);
|
|
1113
|
+
}
|
|
1114
|
+
/** Get a template by ID */
|
|
1115
|
+
getTemplate(templateId) {
|
|
1116
|
+
return this._get(this._buildPath("templates", templateId));
|
|
1117
|
+
}
|
|
1118
|
+
/** List templates with optional filters */
|
|
1119
|
+
listTemplates(params) {
|
|
1120
|
+
const query = {};
|
|
1121
|
+
query.propertyId = params.propertyId;
|
|
1122
|
+
if (params.category !== void 0) query.category = params.category;
|
|
1123
|
+
if (params.language !== void 0) query.language = params.language;
|
|
1124
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
1125
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
1126
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1127
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1128
|
+
return this._get(this._buildPath("templates"), query);
|
|
1129
|
+
}
|
|
1130
|
+
/** Update a template */
|
|
1131
|
+
updateTemplate(templateId, input) {
|
|
1132
|
+
return this._patch(this._buildPath("templates", templateId), input);
|
|
1133
|
+
}
|
|
1134
|
+
/** Delete a template */
|
|
1135
|
+
deleteTemplate(templateId) {
|
|
1136
|
+
return this._delete(this._buildPath("templates", templateId));
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
// src/services/discounts.ts
|
|
1141
|
+
var DiscountsService = class extends BaseService {
|
|
1142
|
+
constructor() {
|
|
1143
|
+
super(...arguments);
|
|
1144
|
+
this.basePath = "/guest/v1";
|
|
1145
|
+
}
|
|
1146
|
+
// ---------------------------------------------------------------------------
|
|
1147
|
+
// Rule CRUD
|
|
1148
|
+
// ---------------------------------------------------------------------------
|
|
1149
|
+
/** Create a discount rule */
|
|
1150
|
+
createRule(input) {
|
|
1151
|
+
return this._post(this._buildPath("discounts"), input);
|
|
1152
|
+
}
|
|
1153
|
+
/** Get a discount rule by ID */
|
|
1154
|
+
getRule(ruleId) {
|
|
1155
|
+
return this._get(this._buildPath("discounts", ruleId));
|
|
1156
|
+
}
|
|
1157
|
+
/** List discount rules with optional filters */
|
|
1158
|
+
listRules(params) {
|
|
1159
|
+
const query = {};
|
|
1160
|
+
query.propertyId = params.propertyId;
|
|
1161
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1162
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1163
|
+
if (params.enabled !== void 0) query.enabled = params.enabled;
|
|
1164
|
+
if (params.validOn !== void 0) query.validOn = params.validOn;
|
|
1165
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
1166
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
1167
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1168
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1169
|
+
return this._get(this._buildPath("discounts"), query);
|
|
1170
|
+
}
|
|
1171
|
+
/** Update a discount rule */
|
|
1172
|
+
updateRule(ruleId, input) {
|
|
1173
|
+
return this._patch(this._buildPath("discounts", ruleId), input);
|
|
1174
|
+
}
|
|
1175
|
+
/** Delete a discount rule */
|
|
1176
|
+
deleteRule(ruleId) {
|
|
1177
|
+
return this._delete(this._buildPath("discounts", ruleId));
|
|
1178
|
+
}
|
|
1179
|
+
// ---------------------------------------------------------------------------
|
|
1180
|
+
// Coupons
|
|
1181
|
+
// ---------------------------------------------------------------------------
|
|
1182
|
+
/** Generate coupon codes for a discount rule */
|
|
1183
|
+
generateCoupons(ruleId, input) {
|
|
1184
|
+
return this._post(this._buildPath("discounts", ruleId, "coupons"), input ?? {});
|
|
1185
|
+
}
|
|
1186
|
+
/** Validate a coupon code against booking context */
|
|
1187
|
+
validateCoupon(input) {
|
|
1188
|
+
return this._post(this._buildPath("discounts", "validate"), input);
|
|
1189
|
+
}
|
|
1190
|
+
// ---------------------------------------------------------------------------
|
|
1191
|
+
// Application
|
|
1192
|
+
// ---------------------------------------------------------------------------
|
|
1193
|
+
/** Apply a discount to a booking */
|
|
1194
|
+
applyDiscount(input) {
|
|
1195
|
+
return this._post(this._buildPath("discounts", "apply"), input);
|
|
1196
|
+
}
|
|
1197
|
+
// ---------------------------------------------------------------------------
|
|
1198
|
+
// Usage tracking
|
|
1199
|
+
// ---------------------------------------------------------------------------
|
|
1200
|
+
/** Get usage statistics and redemption history for a discount rule */
|
|
1201
|
+
getUsage(ruleId, params) {
|
|
1202
|
+
if (!params) return this._get(this._buildPath("discounts", ruleId, "usage"));
|
|
1203
|
+
const query = {};
|
|
1204
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1205
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1206
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1207
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1208
|
+
return this._get(this._buildPath("discounts", ruleId, "usage"), query);
|
|
1209
|
+
}
|
|
1210
|
+
};
|
|
1211
|
+
|
|
1042
1212
|
// src/services/distribution.ts
|
|
1043
1213
|
var DistributionService = class extends BaseService {
|
|
1044
1214
|
constructor() {
|
|
@@ -1292,6 +1462,77 @@ var FinanceService = class extends BaseService {
|
|
|
1292
1462
|
}
|
|
1293
1463
|
};
|
|
1294
1464
|
|
|
1465
|
+
// src/services/fiscal.ts
|
|
1466
|
+
var FiscalService = class extends BaseService {
|
|
1467
|
+
constructor() {
|
|
1468
|
+
super(...arguments);
|
|
1469
|
+
this.basePath = "/fiscal/v1";
|
|
1470
|
+
}
|
|
1471
|
+
// ---------------------------------------------------------------------------
|
|
1472
|
+
// myDATA (Greek fiscal compliance)
|
|
1473
|
+
// ---------------------------------------------------------------------------
|
|
1474
|
+
/** Get the current myDATA integration status */
|
|
1475
|
+
getMyDataStatus() {
|
|
1476
|
+
return this._get(this._buildPath("mydata", "status"));
|
|
1477
|
+
}
|
|
1478
|
+
/** Submit an invoice to the Greek AADE myDATA platform */
|
|
1479
|
+
submitMyData(input) {
|
|
1480
|
+
return this._post(this._buildPath("mydata", "submit"), input);
|
|
1481
|
+
}
|
|
1482
|
+
/** List myDATA submissions with optional filters */
|
|
1483
|
+
listMyDataSubmissions(params) {
|
|
1484
|
+
if (!params) {
|
|
1485
|
+
return this._get(this._buildPath("mydata", "submissions"));
|
|
1486
|
+
}
|
|
1487
|
+
const query = {};
|
|
1488
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1489
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1490
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1491
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1492
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1493
|
+
return this._get(this._buildPath("mydata", "submissions"), query);
|
|
1494
|
+
}
|
|
1495
|
+
/** Get a single myDATA submission by ID */
|
|
1496
|
+
getMyDataSubmission(submissionId) {
|
|
1497
|
+
return this._get(this._buildPath("mydata", "submissions", submissionId));
|
|
1498
|
+
}
|
|
1499
|
+
/** Generate a QR code for a myDATA transaction */
|
|
1500
|
+
getMyDataQr(transactionId) {
|
|
1501
|
+
return this._get(this._buildPath("mydata", "qr", transactionId));
|
|
1502
|
+
}
|
|
1503
|
+
// ---------------------------------------------------------------------------
|
|
1504
|
+
// TSE (German fiscal compliance)
|
|
1505
|
+
// ---------------------------------------------------------------------------
|
|
1506
|
+
/** Get the current TSE device status */
|
|
1507
|
+
getTseStatus() {
|
|
1508
|
+
return this._get(this._buildPath("tse", "status"));
|
|
1509
|
+
}
|
|
1510
|
+
/** List TSE transactions with optional filters */
|
|
1511
|
+
listTseTransactions(params) {
|
|
1512
|
+
if (!params) {
|
|
1513
|
+
return this._get(this._buildPath("tse", "transactions"));
|
|
1514
|
+
}
|
|
1515
|
+
const query = {};
|
|
1516
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1517
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1518
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1519
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1520
|
+
return this._get(this._buildPath("tse", "transactions"), query);
|
|
1521
|
+
}
|
|
1522
|
+
/** Trigger a TSE day closure */
|
|
1523
|
+
tseDayClosure(input) {
|
|
1524
|
+
return this._post(this._buildPath("tse", "day-closure"), input ?? {});
|
|
1525
|
+
}
|
|
1526
|
+
/** Export DSFinV-K data for a date range */
|
|
1527
|
+
tseExportDsfinvk(params) {
|
|
1528
|
+
const query = {};
|
|
1529
|
+
query.from = params.from;
|
|
1530
|
+
query.to = params.to;
|
|
1531
|
+
if (params.format !== void 0) query.format = params.format;
|
|
1532
|
+
return this._get(this._buildPath("tse", "export", "dsfinvk"), query);
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1295
1536
|
// src/services/groups.ts
|
|
1296
1537
|
var GroupsService = class extends BaseService {
|
|
1297
1538
|
constructor() {
|
|
@@ -1688,6 +1929,77 @@ var HousekeepingService = class extends BaseService {
|
|
|
1688
1929
|
}
|
|
1689
1930
|
};
|
|
1690
1931
|
|
|
1932
|
+
// src/services/id-scanning.ts
|
|
1933
|
+
var IdScanningService = class extends BaseService {
|
|
1934
|
+
constructor() {
|
|
1935
|
+
super(...arguments);
|
|
1936
|
+
this.basePath = "/guest/v1/id-scans";
|
|
1937
|
+
}
|
|
1938
|
+
/** Upload a document image for OCR processing */
|
|
1939
|
+
upload(input) {
|
|
1940
|
+
const formData = new FormData();
|
|
1941
|
+
formData.append("guestId", input.guestId);
|
|
1942
|
+
formData.append(
|
|
1943
|
+
"file",
|
|
1944
|
+
input.file instanceof ArrayBuffer ? new Blob([input.file]) : input.file
|
|
1945
|
+
);
|
|
1946
|
+
formData.append("type", input.type);
|
|
1947
|
+
return this._post(this.basePath, formData);
|
|
1948
|
+
}
|
|
1949
|
+
/** Get the OCR result for a scan by ID */
|
|
1950
|
+
getResult(scanId) {
|
|
1951
|
+
return this._get(this._buildPath(scanId));
|
|
1952
|
+
}
|
|
1953
|
+
/** List ID scans with optional filters */
|
|
1954
|
+
list(params) {
|
|
1955
|
+
const query = {};
|
|
1956
|
+
query.guestId = params.guestId;
|
|
1957
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1958
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1959
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1960
|
+
return this._get(this.basePath, query);
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
|
|
1964
|
+
// src/services/intelligence.ts
|
|
1965
|
+
var IntelligenceService = class extends BaseService {
|
|
1966
|
+
constructor() {
|
|
1967
|
+
super(...arguments);
|
|
1968
|
+
this.basePath = "/guest/v1";
|
|
1969
|
+
}
|
|
1970
|
+
// ---------------------------------------------------------------------------
|
|
1971
|
+
// Profile
|
|
1972
|
+
// ---------------------------------------------------------------------------
|
|
1973
|
+
/** Get the intelligence profile for a guest */
|
|
1974
|
+
getProfile(guestId) {
|
|
1975
|
+
return this._get(this._buildPath("profiles", guestId, "intelligence"));
|
|
1976
|
+
}
|
|
1977
|
+
/** Trigger a refresh of the intelligence profile for a guest */
|
|
1978
|
+
refresh(guestId) {
|
|
1979
|
+
return this._post(
|
|
1980
|
+
this._buildPath("profiles", guestId, "intelligence", "refresh"),
|
|
1981
|
+
{}
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1984
|
+
// ---------------------------------------------------------------------------
|
|
1985
|
+
// Events
|
|
1986
|
+
// ---------------------------------------------------------------------------
|
|
1987
|
+
/** Ingest a guest intelligence event for processing */
|
|
1988
|
+
ingestEvent(input) {
|
|
1989
|
+
return this._post(this._buildPath("intelligence", "events"), input);
|
|
1990
|
+
}
|
|
1991
|
+
/** List intelligence events for a guest with optional filters */
|
|
1992
|
+
listEvents(params) {
|
|
1993
|
+
const query = {};
|
|
1994
|
+
query.guestId = params.guestId;
|
|
1995
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1996
|
+
if (params.type !== void 0) query.type = params.type;
|
|
1997
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1998
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1999
|
+
return this._get(this._buildPath("intelligence", "events"), query);
|
|
2000
|
+
}
|
|
2001
|
+
};
|
|
2002
|
+
|
|
1691
2003
|
// src/services/night-audit.ts
|
|
1692
2004
|
var NightAuditService = class extends BaseService {
|
|
1693
2005
|
constructor() {
|
|
@@ -1722,6 +2034,26 @@ var NightAuditService = class extends BaseService {
|
|
|
1722
2034
|
}
|
|
1723
2035
|
};
|
|
1724
2036
|
|
|
2037
|
+
// src/services/notifications.ts
|
|
2038
|
+
var NotificationsService = class extends BaseService {
|
|
2039
|
+
constructor() {
|
|
2040
|
+
super(...arguments);
|
|
2041
|
+
this.basePath = "/notifications/v1";
|
|
2042
|
+
}
|
|
2043
|
+
/** Get notification preferences for a guest */
|
|
2044
|
+
getPreferences(guestId) {
|
|
2045
|
+
return this._get(this._buildPath("preferences", guestId));
|
|
2046
|
+
}
|
|
2047
|
+
/** Update notification preferences for a guest */
|
|
2048
|
+
updatePreferences(guestId, input) {
|
|
2049
|
+
return this._patch(this._buildPath("preferences", guestId), input);
|
|
2050
|
+
}
|
|
2051
|
+
/** Opt a guest out of notifications (all channels or specific ones) */
|
|
2052
|
+
optOut(input) {
|
|
2053
|
+
return this._post(this._buildPath("opt-out"), input);
|
|
2054
|
+
}
|
|
2055
|
+
};
|
|
2056
|
+
|
|
1725
2057
|
// src/services/payments.ts
|
|
1726
2058
|
var PaymentsService = class extends BaseService {
|
|
1727
2059
|
constructor() {
|
|
@@ -1817,6 +2149,77 @@ var PaymentsService = class extends BaseService {
|
|
|
1817
2149
|
}
|
|
1818
2150
|
};
|
|
1819
2151
|
|
|
2152
|
+
// src/services/portfolios.ts
|
|
2153
|
+
var PortfoliosService = class extends BaseService {
|
|
2154
|
+
constructor() {
|
|
2155
|
+
super(...arguments);
|
|
2156
|
+
this.basePath = "/operations/v1/portfolios";
|
|
2157
|
+
}
|
|
2158
|
+
// ---------------------------------------------------------------------------
|
|
2159
|
+
// CRUD
|
|
2160
|
+
// ---------------------------------------------------------------------------
|
|
2161
|
+
/** Create a new portfolio */
|
|
2162
|
+
create(input) {
|
|
2163
|
+
return this._post(this.basePath, input);
|
|
2164
|
+
}
|
|
2165
|
+
/** Get a portfolio by ID including its properties */
|
|
2166
|
+
get(portfolioId) {
|
|
2167
|
+
return this._get(this._buildPath(portfolioId));
|
|
2168
|
+
}
|
|
2169
|
+
/** List portfolios with optional filters */
|
|
2170
|
+
list(params) {
|
|
2171
|
+
if (!params) return this._get(this.basePath);
|
|
2172
|
+
const query = {};
|
|
2173
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2174
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2175
|
+
if (params.search !== void 0) query.search = params.search;
|
|
2176
|
+
return this._get(this.basePath, query);
|
|
2177
|
+
}
|
|
2178
|
+
/** Update a portfolio */
|
|
2179
|
+
update(portfolioId, input) {
|
|
2180
|
+
return this._patch(this._buildPath(portfolioId), input);
|
|
2181
|
+
}
|
|
2182
|
+
/** Delete a portfolio */
|
|
2183
|
+
delete(portfolioId) {
|
|
2184
|
+
return this._delete(this._buildPath(portfolioId));
|
|
2185
|
+
}
|
|
2186
|
+
// ---------------------------------------------------------------------------
|
|
2187
|
+
// Membership
|
|
2188
|
+
// ---------------------------------------------------------------------------
|
|
2189
|
+
/** Add a property to a portfolio */
|
|
2190
|
+
addProperty(portfolioId, input) {
|
|
2191
|
+
return this._post(this._buildPath(portfolioId, "properties"), input);
|
|
2192
|
+
}
|
|
2193
|
+
/** Remove a property from a portfolio */
|
|
2194
|
+
removeProperty(portfolioId, propertyId) {
|
|
2195
|
+
return this._delete(this._buildPath(portfolioId, "properties", propertyId));
|
|
2196
|
+
}
|
|
2197
|
+
// ---------------------------------------------------------------------------
|
|
2198
|
+
// Dashboard
|
|
2199
|
+
// ---------------------------------------------------------------------------
|
|
2200
|
+
/** Get aggregated dashboard data for a portfolio */
|
|
2201
|
+
getDashboard(portfolioId, params) {
|
|
2202
|
+
const path = this._buildPath(portfolioId, "dashboard");
|
|
2203
|
+
if (!params) return this._get(path);
|
|
2204
|
+
const query = {};
|
|
2205
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2206
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2207
|
+
return this._get(path, query);
|
|
2208
|
+
}
|
|
2209
|
+
// ---------------------------------------------------------------------------
|
|
2210
|
+
// Search
|
|
2211
|
+
// ---------------------------------------------------------------------------
|
|
2212
|
+
/** Search for guests, bookings, or all records within a portfolio */
|
|
2213
|
+
search(portfolioId, params) {
|
|
2214
|
+
const query = {};
|
|
2215
|
+
query.query = params.query;
|
|
2216
|
+
if (params.type !== void 0) query.type = params.type;
|
|
2217
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2218
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2219
|
+
return this._get(this._buildPath(portfolioId, "search"), query);
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2222
|
+
|
|
1820
2223
|
// src/services/properties.ts
|
|
1821
2224
|
var PropertiesService = class extends BaseService {
|
|
1822
2225
|
constructor() {
|
|
@@ -1984,6 +2387,261 @@ var RatePlansService = class extends BaseService {
|
|
|
1984
2387
|
}
|
|
1985
2388
|
};
|
|
1986
2389
|
|
|
2390
|
+
// src/services/revenue.ts
|
|
2391
|
+
var RevenueService = class extends BaseService {
|
|
2392
|
+
constructor() {
|
|
2393
|
+
super(...arguments);
|
|
2394
|
+
this.basePath = "/revenue/v1";
|
|
2395
|
+
}
|
|
2396
|
+
// ---------------------------------------------------------------------------
|
|
2397
|
+
// Dashboard
|
|
2398
|
+
// ---------------------------------------------------------------------------
|
|
2399
|
+
/** Get the revenue dashboard with KPIs, occupancy, and revenue breakdown */
|
|
2400
|
+
getDashboard(params) {
|
|
2401
|
+
const query = {};
|
|
2402
|
+
query.propertyId = params.propertyId;
|
|
2403
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2404
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2405
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2406
|
+
return this._get(this._buildPath("dashboard"), query);
|
|
2407
|
+
}
|
|
2408
|
+
/** Get individual KPI metrics with optional granularity breakdown */
|
|
2409
|
+
getKPIs(params) {
|
|
2410
|
+
const query = {};
|
|
2411
|
+
query.propertyId = params.propertyId;
|
|
2412
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2413
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2414
|
+
if (params.metrics !== void 0) query.metrics = params.metrics.join(",");
|
|
2415
|
+
if (params.granularity !== void 0) query.granularity = params.granularity;
|
|
2416
|
+
return this._get(this._buildPath("kpis"), query);
|
|
2417
|
+
}
|
|
2418
|
+
// ---------------------------------------------------------------------------
|
|
2419
|
+
// Rate suggestions
|
|
2420
|
+
// ---------------------------------------------------------------------------
|
|
2421
|
+
/** List AI-generated rate suggestions with optional filters */
|
|
2422
|
+
listSuggestions(params) {
|
|
2423
|
+
const query = {};
|
|
2424
|
+
query.propertyId = params.propertyId;
|
|
2425
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2426
|
+
if (params.ratePlanId !== void 0) query.ratePlanId = params.ratePlanId;
|
|
2427
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2428
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2429
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2430
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2431
|
+
return this._get(this._buildPath("suggestions"), query);
|
|
2432
|
+
}
|
|
2433
|
+
/** Apply a rate suggestion, updating the associated rate plan */
|
|
2434
|
+
applySuggestion(suggestionId) {
|
|
2435
|
+
return this._post(this._buildPath("suggestions", suggestionId, "apply"), {});
|
|
2436
|
+
}
|
|
2437
|
+
/** Dismiss a rate suggestion with an optional reason */
|
|
2438
|
+
dismissSuggestion(suggestionId, input) {
|
|
2439
|
+
return this._post(
|
|
2440
|
+
this._buildPath("suggestions", suggestionId, "dismiss"),
|
|
2441
|
+
input ?? {}
|
|
2442
|
+
);
|
|
2443
|
+
}
|
|
2444
|
+
// ---------------------------------------------------------------------------
|
|
2445
|
+
// Competitors
|
|
2446
|
+
// ---------------------------------------------------------------------------
|
|
2447
|
+
/** List competitors tracked for a property */
|
|
2448
|
+
listCompetitors(params) {
|
|
2449
|
+
const query = {};
|
|
2450
|
+
query.propertyId = params.propertyId;
|
|
2451
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2452
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2453
|
+
return this._get(this._buildPath("competitors"), query);
|
|
2454
|
+
}
|
|
2455
|
+
/** Get rate data scraped for a competitor over a date range */
|
|
2456
|
+
getCompetitorRates(competitorId, params) {
|
|
2457
|
+
const query = {};
|
|
2458
|
+
if (params !== void 0) {
|
|
2459
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2460
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2461
|
+
if (params.source !== void 0) query.source = params.source;
|
|
2462
|
+
}
|
|
2463
|
+
return this._get(
|
|
2464
|
+
this._buildPath("competitors", competitorId, "rates"),
|
|
2465
|
+
query
|
|
2466
|
+
);
|
|
2467
|
+
}
|
|
2468
|
+
/** Add a competitor to track for a property */
|
|
2469
|
+
addCompetitor(input) {
|
|
2470
|
+
return this._post(this._buildPath("competitors"), input);
|
|
2471
|
+
}
|
|
2472
|
+
// ---------------------------------------------------------------------------
|
|
2473
|
+
// Reports
|
|
2474
|
+
// ---------------------------------------------------------------------------
|
|
2475
|
+
/** Get a detailed revenue report with optional comparison period */
|
|
2476
|
+
getRevenueReport(params) {
|
|
2477
|
+
const query = {};
|
|
2478
|
+
query.propertyId = params.propertyId;
|
|
2479
|
+
query.from = params.from;
|
|
2480
|
+
query.to = params.to;
|
|
2481
|
+
if (params.groupBy !== void 0) query.groupBy = params.groupBy;
|
|
2482
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2483
|
+
return this._get(this._buildPath("reports", "revenue"), query);
|
|
2484
|
+
}
|
|
2485
|
+
/** Get a revenue forecast for a future date range */
|
|
2486
|
+
getForecast(params) {
|
|
2487
|
+
const query = {};
|
|
2488
|
+
query.propertyId = params.propertyId;
|
|
2489
|
+
query.from = params.from;
|
|
2490
|
+
query.to = params.to;
|
|
2491
|
+
if (params.model !== void 0) query.model = params.model;
|
|
2492
|
+
return this._get(this._buildPath("reports", "forecast"), query);
|
|
2493
|
+
}
|
|
2494
|
+
/** Get a pace report comparing current bookings against a prior period */
|
|
2495
|
+
getPaceReport(params) {
|
|
2496
|
+
const query = {};
|
|
2497
|
+
query.propertyId = params.propertyId;
|
|
2498
|
+
query.from = params.from;
|
|
2499
|
+
query.to = params.to;
|
|
2500
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2501
|
+
if (params.granularity !== void 0) query.granularity = params.granularity;
|
|
2502
|
+
return this._get(this._buildPath("reports", "pace"), query);
|
|
2503
|
+
}
|
|
2504
|
+
// ---------------------------------------------------------------------------
|
|
2505
|
+
// Portfolio
|
|
2506
|
+
// ---------------------------------------------------------------------------
|
|
2507
|
+
/** Get a portfolio-level dashboard with aggregated KPIs */
|
|
2508
|
+
getPortfolioDashboard(params) {
|
|
2509
|
+
const query = {};
|
|
2510
|
+
query.portfolioId = params.portfolioId;
|
|
2511
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2512
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2513
|
+
return this._get(this._buildPath("portfolio", "dashboard"), query);
|
|
2514
|
+
}
|
|
2515
|
+
/** Get a per-property breakdown of revenue metrics across a portfolio */
|
|
2516
|
+
getPortfolioBreakdown(params) {
|
|
2517
|
+
const query = {};
|
|
2518
|
+
query.portfolioId = params.portfolioId;
|
|
2519
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2520
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2521
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
2522
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
2523
|
+
return this._get(this._buildPath("portfolio", "breakdown"), query);
|
|
2524
|
+
}
|
|
2525
|
+
/** Get a revenue forecast for all properties in a portfolio */
|
|
2526
|
+
getPortfolioForecast(params) {
|
|
2527
|
+
const query = {};
|
|
2528
|
+
query.portfolioId = params.portfolioId;
|
|
2529
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2530
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2531
|
+
if (params.model !== void 0) query.model = params.model;
|
|
2532
|
+
return this._get(this._buildPath("portfolio", "forecast"), query);
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
|
|
2536
|
+
// src/services/reviews.ts
|
|
2537
|
+
var ReviewsService = class extends BaseService {
|
|
2538
|
+
constructor() {
|
|
2539
|
+
super(...arguments);
|
|
2540
|
+
this.basePath = "/guest/v1";
|
|
2541
|
+
}
|
|
2542
|
+
// ---------------------------------------------------------------------------
|
|
2543
|
+
// Review CRUD
|
|
2544
|
+
// ---------------------------------------------------------------------------
|
|
2545
|
+
/** Create a review */
|
|
2546
|
+
createReview(input) {
|
|
2547
|
+
return this._post(this._buildPath("reviews"), input);
|
|
2548
|
+
}
|
|
2549
|
+
/** Get a review by ID */
|
|
2550
|
+
getReview(reviewId) {
|
|
2551
|
+
return this._get(this._buildPath("reviews", reviewId));
|
|
2552
|
+
}
|
|
2553
|
+
/** List reviews with optional filters */
|
|
2554
|
+
listReviews(params) {
|
|
2555
|
+
const query = {};
|
|
2556
|
+
query.propertyId = params.propertyId;
|
|
2557
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2558
|
+
if (params.guestId !== void 0) query.guestId = params.guestId;
|
|
2559
|
+
if (params.bookingId !== void 0) query.bookingId = params.bookingId;
|
|
2560
|
+
if (params.minRating !== void 0) query.minRating = params.minRating;
|
|
2561
|
+
if (params.maxRating !== void 0) query.maxRating = params.maxRating;
|
|
2562
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2563
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2564
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
2565
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
2566
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2567
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2568
|
+
return this._get(this._buildPath("reviews"), query);
|
|
2569
|
+
}
|
|
2570
|
+
/** Update a review */
|
|
2571
|
+
updateReview(reviewId, input) {
|
|
2572
|
+
return this._patch(this._buildPath("reviews", reviewId), input);
|
|
2573
|
+
}
|
|
2574
|
+
/** Delete a review */
|
|
2575
|
+
deleteReview(reviewId) {
|
|
2576
|
+
return this._delete(this._buildPath("reviews", reviewId));
|
|
2577
|
+
}
|
|
2578
|
+
// ---------------------------------------------------------------------------
|
|
2579
|
+
// Moderation
|
|
2580
|
+
// ---------------------------------------------------------------------------
|
|
2581
|
+
/** Moderate a review (approve, reject, or flag) */
|
|
2582
|
+
moderateReview(reviewId, input) {
|
|
2583
|
+
return this._post(this._buildPath("reviews", reviewId, "moderate"), input);
|
|
2584
|
+
}
|
|
2585
|
+
// ---------------------------------------------------------------------------
|
|
2586
|
+
// Owner responses
|
|
2587
|
+
// ---------------------------------------------------------------------------
|
|
2588
|
+
/** Create an owner response to a review */
|
|
2589
|
+
createResponse(reviewId, input) {
|
|
2590
|
+
return this._post(this._buildPath("reviews", reviewId, "response"), input);
|
|
2591
|
+
}
|
|
2592
|
+
/** Update an owner response */
|
|
2593
|
+
updateResponse(reviewId, input) {
|
|
2594
|
+
return this._patch(this._buildPath("reviews", reviewId, "response"), input);
|
|
2595
|
+
}
|
|
2596
|
+
/** Delete an owner response */
|
|
2597
|
+
deleteResponse(reviewId) {
|
|
2598
|
+
return this._delete(this._buildPath("reviews", reviewId, "response"));
|
|
2599
|
+
}
|
|
2600
|
+
// ---------------------------------------------------------------------------
|
|
2601
|
+
// Analytics
|
|
2602
|
+
// ---------------------------------------------------------------------------
|
|
2603
|
+
/** Get review analytics for a property */
|
|
2604
|
+
getAnalytics(params) {
|
|
2605
|
+
const query = {};
|
|
2606
|
+
query.propertyId = params.propertyId;
|
|
2607
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2608
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2609
|
+
if (params.period !== void 0) query.period = params.period;
|
|
2610
|
+
return this._get(this._buildPath("reviews", "analytics"), query);
|
|
2611
|
+
}
|
|
2612
|
+
// ---------------------------------------------------------------------------
|
|
2613
|
+
// Review requests
|
|
2614
|
+
// ---------------------------------------------------------------------------
|
|
2615
|
+
/** Send a review request to a guest */
|
|
2616
|
+
sendReviewRequest(input) {
|
|
2617
|
+
return this._post(this._buildPath("reviews", "request"), input);
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2621
|
+
// src/services/settings.ts
|
|
2622
|
+
var SettingsService = class extends BaseService {
|
|
2623
|
+
constructor() {
|
|
2624
|
+
super(...arguments);
|
|
2625
|
+
this.basePath = "/settings/v1";
|
|
2626
|
+
}
|
|
2627
|
+
/** Get property-level settings */
|
|
2628
|
+
getPropertySettings() {
|
|
2629
|
+
return this._get(this._buildPath("property"));
|
|
2630
|
+
}
|
|
2631
|
+
/** Update property-level settings */
|
|
2632
|
+
updatePropertySettings(input) {
|
|
2633
|
+
return this._patch(this._buildPath("property"), input);
|
|
2634
|
+
}
|
|
2635
|
+
/** Get fiscal compliance settings (myDATA and TSE) */
|
|
2636
|
+
getFiscalSettings() {
|
|
2637
|
+
return this._get(this._buildPath("fiscal"));
|
|
2638
|
+
}
|
|
2639
|
+
/** Update fiscal compliance settings (myDATA and TSE) */
|
|
2640
|
+
updateFiscalSettings(input) {
|
|
2641
|
+
return this._patch(this._buildPath("fiscal"), input);
|
|
2642
|
+
}
|
|
2643
|
+
};
|
|
2644
|
+
|
|
1987
2645
|
// src/services/spaces.ts
|
|
1988
2646
|
var SpacesService = class extends BaseService {
|
|
1989
2647
|
constructor() {
|
|
@@ -2176,6 +2834,171 @@ var StaffService = class extends BaseService {
|
|
|
2176
2834
|
}
|
|
2177
2835
|
};
|
|
2178
2836
|
|
|
2837
|
+
// src/services/supply.ts
|
|
2838
|
+
var SupplyService = class extends BaseService {
|
|
2839
|
+
constructor() {
|
|
2840
|
+
super(...arguments);
|
|
2841
|
+
this.basePath = "/operations/v1";
|
|
2842
|
+
}
|
|
2843
|
+
// ---------------------------------------------------------------------------
|
|
2844
|
+
// Item CRUD
|
|
2845
|
+
// ---------------------------------------------------------------------------
|
|
2846
|
+
/** Create a supply item */
|
|
2847
|
+
createItem(input) {
|
|
2848
|
+
return this._post(this._buildPath("supply-items"), input);
|
|
2849
|
+
}
|
|
2850
|
+
/** Get a supply item by ID */
|
|
2851
|
+
getItem(itemId) {
|
|
2852
|
+
return this._get(this._buildPath("supply-items", itemId));
|
|
2853
|
+
}
|
|
2854
|
+
/** List supply items with optional filters */
|
|
2855
|
+
listItems(params) {
|
|
2856
|
+
const query = {};
|
|
2857
|
+
query.propertyId = params.propertyId;
|
|
2858
|
+
if (params.category !== void 0) query.category = params.category;
|
|
2859
|
+
if (params.search !== void 0) query.search = params.search;
|
|
2860
|
+
if (params.lowStockOnly !== void 0) query.lowStockOnly = params.lowStockOnly;
|
|
2861
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2862
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2863
|
+
return this._get(this._buildPath("supply-items"), query);
|
|
2864
|
+
}
|
|
2865
|
+
/** Update a supply item */
|
|
2866
|
+
updateItem(itemId, input) {
|
|
2867
|
+
return this._patch(this._buildPath("supply-items", itemId), input);
|
|
2868
|
+
}
|
|
2869
|
+
/** Delete a supply item */
|
|
2870
|
+
deleteItem(itemId) {
|
|
2871
|
+
return this._delete(this._buildPath("supply-items", itemId));
|
|
2872
|
+
}
|
|
2873
|
+
// ---------------------------------------------------------------------------
|
|
2874
|
+
// Stock levels
|
|
2875
|
+
// ---------------------------------------------------------------------------
|
|
2876
|
+
/** Get the current stock level for a supply item */
|
|
2877
|
+
getLevel(itemId) {
|
|
2878
|
+
return this._get(this._buildPath("supply-levels", itemId));
|
|
2879
|
+
}
|
|
2880
|
+
/** List stock levels with optional filters */
|
|
2881
|
+
listLevels(params) {
|
|
2882
|
+
const query = {};
|
|
2883
|
+
query.propertyId = params.propertyId;
|
|
2884
|
+
if (params.category !== void 0) query.category = params.category;
|
|
2885
|
+
if (params.lowStockOnly !== void 0) query.lowStockOnly = params.lowStockOnly;
|
|
2886
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2887
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2888
|
+
return this._get(this._buildPath("supply-levels"), query);
|
|
2889
|
+
}
|
|
2890
|
+
/** Update a stock level manually */
|
|
2891
|
+
updateLevel(itemId, input) {
|
|
2892
|
+
return this._patch(this._buildPath("supply-levels", itemId), input);
|
|
2893
|
+
}
|
|
2894
|
+
// ---------------------------------------------------------------------------
|
|
2895
|
+
// Movements
|
|
2896
|
+
// ---------------------------------------------------------------------------
|
|
2897
|
+
/** Record a stock movement */
|
|
2898
|
+
createMovement(input) {
|
|
2899
|
+
return this._post(this._buildPath("supply-movements"), input);
|
|
2900
|
+
}
|
|
2901
|
+
/** List supply movements with optional filters */
|
|
2902
|
+
listMovements(params) {
|
|
2903
|
+
const query = {};
|
|
2904
|
+
query.propertyId = params.propertyId;
|
|
2905
|
+
if (params.itemId !== void 0) query.itemId = params.itemId;
|
|
2906
|
+
if (params.type !== void 0) query.type = params.type;
|
|
2907
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2908
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2909
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2910
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2911
|
+
return this._get(this._buildPath("supply-movements"), query);
|
|
2912
|
+
}
|
|
2913
|
+
// ---------------------------------------------------------------------------
|
|
2914
|
+
// Low-stock alerts
|
|
2915
|
+
// ---------------------------------------------------------------------------
|
|
2916
|
+
/** List items whose stock is at or below reorder threshold */
|
|
2917
|
+
listLowStock(params) {
|
|
2918
|
+
const query = {};
|
|
2919
|
+
query.propertyId = params.propertyId;
|
|
2920
|
+
if (params.category !== void 0) query.category = params.category;
|
|
2921
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2922
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2923
|
+
return this._get(this._buildPath("supply-items", "low-stock"), query);
|
|
2924
|
+
}
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2927
|
+
// src/services/tasks.ts
|
|
2928
|
+
var TasksService = class extends BaseService {
|
|
2929
|
+
constructor() {
|
|
2930
|
+
super(...arguments);
|
|
2931
|
+
this.basePath = "/operations/v1/tasks";
|
|
2932
|
+
}
|
|
2933
|
+
/** Create an operational task */
|
|
2934
|
+
create(input) {
|
|
2935
|
+
return this._post(this.basePath, input);
|
|
2936
|
+
}
|
|
2937
|
+
/** List operational tasks with optional filters */
|
|
2938
|
+
list(params) {
|
|
2939
|
+
if (!params) return this._get(this.basePath);
|
|
2940
|
+
const query = {};
|
|
2941
|
+
if (params.propertyId !== void 0) query.propertyId = params.propertyId;
|
|
2942
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2943
|
+
if (params.priority !== void 0) query.priority = params.priority;
|
|
2944
|
+
if (params.assignedTo !== void 0) query.assignedTo = params.assignedTo;
|
|
2945
|
+
if (params.category !== void 0) query.category = params.category;
|
|
2946
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2947
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2948
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2949
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2950
|
+
return this._get(this.basePath, query);
|
|
2951
|
+
}
|
|
2952
|
+
/** Update an operational task */
|
|
2953
|
+
update(taskId, input) {
|
|
2954
|
+
return this._patch(this._buildPath(taskId), input);
|
|
2955
|
+
}
|
|
2956
|
+
};
|
|
2957
|
+
|
|
2958
|
+
// src/services/webhooks.ts
|
|
2959
|
+
var WebhooksService = class extends BaseService {
|
|
2960
|
+
constructor() {
|
|
2961
|
+
super(...arguments);
|
|
2962
|
+
this.basePath = "/webhooks/v1";
|
|
2963
|
+
}
|
|
2964
|
+
/** Create a new webhook subscription */
|
|
2965
|
+
createSubscription(input) {
|
|
2966
|
+
return this._post(this._buildPath("subscriptions"), input);
|
|
2967
|
+
}
|
|
2968
|
+
/** List webhook subscriptions with optional filters */
|
|
2969
|
+
listSubscriptions(params) {
|
|
2970
|
+
if (!params) {
|
|
2971
|
+
return this._get(this._buildPath("subscriptions"));
|
|
2972
|
+
}
|
|
2973
|
+
const query = {};
|
|
2974
|
+
if (params.active !== void 0) query.active = params.active;
|
|
2975
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2976
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2977
|
+
return this._get(this._buildPath("subscriptions"), query);
|
|
2978
|
+
}
|
|
2979
|
+
/** Update a webhook subscription */
|
|
2980
|
+
updateSubscription(subscriptionId, input) {
|
|
2981
|
+
return this._patch(
|
|
2982
|
+
this._buildPath("subscriptions", subscriptionId),
|
|
2983
|
+
input
|
|
2984
|
+
);
|
|
2985
|
+
}
|
|
2986
|
+
/** List webhook delivery attempts with optional filters */
|
|
2987
|
+
listDeliveries(params) {
|
|
2988
|
+
if (!params) {
|
|
2989
|
+
return this._get(this._buildPath("deliveries"));
|
|
2990
|
+
}
|
|
2991
|
+
const query = {};
|
|
2992
|
+
if (params.subscriptionId !== void 0) query.subscriptionId = params.subscriptionId;
|
|
2993
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2994
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2995
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2996
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2997
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2998
|
+
return this._get(this._buildPath("deliveries"), query);
|
|
2999
|
+
}
|
|
3000
|
+
};
|
|
3001
|
+
|
|
2179
3002
|
// src/client.ts
|
|
2180
3003
|
var BookingClient = class {
|
|
2181
3004
|
constructor(config) {
|
|
@@ -2203,6 +3026,11 @@ var BookingClient = class {
|
|
|
2203
3026
|
this._bookings ?? (this._bookings = new BookingsService(this.httpClient));
|
|
2204
3027
|
return this._bookings;
|
|
2205
3028
|
}
|
|
3029
|
+
/** Concierge service — lazy-initialized on first access */
|
|
3030
|
+
get concierge() {
|
|
3031
|
+
this._concierge ?? (this._concierge = new ConciergeService(this.httpClient));
|
|
3032
|
+
return this._concierge;
|
|
3033
|
+
}
|
|
2206
3034
|
/** Distribution service — lazy-initialized on first access */
|
|
2207
3035
|
get distribution() {
|
|
2208
3036
|
this._distribution ?? (this._distribution = new DistributionService(this.httpClient));
|
|
@@ -2213,6 +3041,11 @@ var BookingClient = class {
|
|
|
2213
3041
|
this._finance ?? (this._finance = new FinanceService(this.httpClient));
|
|
2214
3042
|
return this._finance;
|
|
2215
3043
|
}
|
|
3044
|
+
/** Fiscal service — lazy-initialized on first access */
|
|
3045
|
+
get fiscal() {
|
|
3046
|
+
this._fiscal ?? (this._fiscal = new FiscalService(this.httpClient));
|
|
3047
|
+
return this._fiscal;
|
|
3048
|
+
}
|
|
2216
3049
|
/** Groups service — lazy-initialized on first access */
|
|
2217
3050
|
get groups() {
|
|
2218
3051
|
this._groups ?? (this._groups = new GroupsService(this.httpClient));
|
|
@@ -2228,16 +3061,36 @@ var BookingClient = class {
|
|
|
2228
3061
|
this._housekeeping ?? (this._housekeeping = new HousekeepingService(this.httpClient));
|
|
2229
3062
|
return this._housekeeping;
|
|
2230
3063
|
}
|
|
3064
|
+
/** ID scanning service — lazy-initialized on first access */
|
|
3065
|
+
get idScanning() {
|
|
3066
|
+
this._idScanning ?? (this._idScanning = new IdScanningService(this.httpClient));
|
|
3067
|
+
return this._idScanning;
|
|
3068
|
+
}
|
|
3069
|
+
/** Intelligence service — lazy-initialized on first access */
|
|
3070
|
+
get intelligence() {
|
|
3071
|
+
this._intelligence ?? (this._intelligence = new IntelligenceService(this.httpClient));
|
|
3072
|
+
return this._intelligence;
|
|
3073
|
+
}
|
|
2231
3074
|
/** Night audit service — lazy-initialized on first access */
|
|
2232
3075
|
get nightAudit() {
|
|
2233
3076
|
this._nightAudit ?? (this._nightAudit = new NightAuditService(this.httpClient));
|
|
2234
3077
|
return this._nightAudit;
|
|
2235
3078
|
}
|
|
3079
|
+
/** Notifications service — lazy-initialized on first access */
|
|
3080
|
+
get notifications() {
|
|
3081
|
+
this._notifications ?? (this._notifications = new NotificationsService(this.httpClient));
|
|
3082
|
+
return this._notifications;
|
|
3083
|
+
}
|
|
2236
3084
|
/** Payments service — lazy-initialized on first access */
|
|
2237
3085
|
get payments() {
|
|
2238
3086
|
this._payments ?? (this._payments = new PaymentsService(this.httpClient));
|
|
2239
3087
|
return this._payments;
|
|
2240
3088
|
}
|
|
3089
|
+
/** Portfolios service — lazy-initialized on first access */
|
|
3090
|
+
get portfolios() {
|
|
3091
|
+
this._portfolios ?? (this._portfolios = new PortfoliosService(this.httpClient));
|
|
3092
|
+
return this._portfolios;
|
|
3093
|
+
}
|
|
2241
3094
|
/** Properties service — lazy-initialized on first access */
|
|
2242
3095
|
get properties() {
|
|
2243
3096
|
this._properties ?? (this._properties = new PropertiesService(this.httpClient));
|
|
@@ -2248,11 +3101,31 @@ var BookingClient = class {
|
|
|
2248
3101
|
this._ratePlans ?? (this._ratePlans = new RatePlansService(this.httpClient));
|
|
2249
3102
|
return this._ratePlans;
|
|
2250
3103
|
}
|
|
3104
|
+
/** Revenue service — lazy-initialized on first access */
|
|
3105
|
+
get revenue() {
|
|
3106
|
+
this._revenue ?? (this._revenue = new RevenueService(this.httpClient));
|
|
3107
|
+
return this._revenue;
|
|
3108
|
+
}
|
|
2251
3109
|
/** Categories service — lazy-initialized on first access */
|
|
2252
3110
|
get categories() {
|
|
2253
3111
|
this._categories ?? (this._categories = new CategoriesService(this.httpClient));
|
|
2254
3112
|
return this._categories;
|
|
2255
3113
|
}
|
|
3114
|
+
/** Discounts service — lazy-initialized on first access */
|
|
3115
|
+
get discounts() {
|
|
3116
|
+
this._discounts ?? (this._discounts = new DiscountsService(this.httpClient));
|
|
3117
|
+
return this._discounts;
|
|
3118
|
+
}
|
|
3119
|
+
/** Reviews service — lazy-initialized on first access */
|
|
3120
|
+
get reviews() {
|
|
3121
|
+
this._reviews ?? (this._reviews = new ReviewsService(this.httpClient));
|
|
3122
|
+
return this._reviews;
|
|
3123
|
+
}
|
|
3124
|
+
/** Settings service — lazy-initialized on first access */
|
|
3125
|
+
get settings() {
|
|
3126
|
+
this._settings ?? (this._settings = new SettingsService(this.httpClient));
|
|
3127
|
+
return this._settings;
|
|
3128
|
+
}
|
|
2256
3129
|
/** Spaces service — lazy-initialized on first access */
|
|
2257
3130
|
get spaces() {
|
|
2258
3131
|
this._spaces ?? (this._spaces = new SpacesService(this.httpClient));
|
|
@@ -2263,6 +3136,21 @@ var BookingClient = class {
|
|
|
2263
3136
|
this._staff ?? (this._staff = new StaffService(this.httpClient));
|
|
2264
3137
|
return this._staff;
|
|
2265
3138
|
}
|
|
3139
|
+
/** Supply service — lazy-initialized on first access */
|
|
3140
|
+
get supply() {
|
|
3141
|
+
this._supply ?? (this._supply = new SupplyService(this.httpClient));
|
|
3142
|
+
return this._supply;
|
|
3143
|
+
}
|
|
3144
|
+
/** Tasks service — lazy-initialized on first access */
|
|
3145
|
+
get tasks() {
|
|
3146
|
+
this._tasks ?? (this._tasks = new TasksService(this.httpClient));
|
|
3147
|
+
return this._tasks;
|
|
3148
|
+
}
|
|
3149
|
+
/** Webhooks service — lazy-initialized on first access */
|
|
3150
|
+
get webhooks() {
|
|
3151
|
+
this._webhooks ?? (this._webhooks = new WebhooksService(this.httpClient));
|
|
3152
|
+
return this._webhooks;
|
|
3153
|
+
}
|
|
2266
3154
|
setApiKey(key) {
|
|
2267
3155
|
if (!key || key.trim().length === 0) {
|
|
2268
3156
|
throw new Error("apiKey must be a non-empty string");
|
|
@@ -2378,31 +3266,44 @@ export {
|
|
|
2378
3266
|
BookingError,
|
|
2379
3267
|
BookingsService,
|
|
2380
3268
|
CategoriesService,
|
|
3269
|
+
ConciergeService,
|
|
2381
3270
|
ConflictError,
|
|
2382
3271
|
DEFAULT_MODULES,
|
|
3272
|
+
DiscountsService,
|
|
2383
3273
|
DistributionService,
|
|
2384
3274
|
FinanceService,
|
|
3275
|
+
FiscalService,
|
|
2385
3276
|
ForbiddenError,
|
|
2386
3277
|
GroupsService,
|
|
2387
3278
|
GuestsService,
|
|
2388
3279
|
HousekeepingService,
|
|
2389
3280
|
HttpClient,
|
|
3281
|
+
IdScanningService,
|
|
3282
|
+
IntelligenceService,
|
|
2390
3283
|
NightAuditService,
|
|
2391
3284
|
NotFoundError,
|
|
3285
|
+
NotificationsService,
|
|
2392
3286
|
PROPERTY_MODULES,
|
|
2393
3287
|
PaymentError,
|
|
2394
3288
|
PaymentsService,
|
|
3289
|
+
PortfoliosService,
|
|
2395
3290
|
PropertiesService,
|
|
2396
3291
|
RateLimitError,
|
|
2397
3292
|
RatePlansService,
|
|
3293
|
+
RevenueService,
|
|
3294
|
+
ReviewsService,
|
|
2398
3295
|
SPACE_STATUSES,
|
|
2399
3296
|
SPACE_TYPES,
|
|
2400
3297
|
ServerError,
|
|
3298
|
+
SettingsService,
|
|
2401
3299
|
SpacesService,
|
|
2402
3300
|
StaffService,
|
|
3301
|
+
SupplyService,
|
|
3302
|
+
TasksService,
|
|
2403
3303
|
TimeoutError,
|
|
2404
3304
|
VERSION,
|
|
2405
3305
|
ValidationError,
|
|
3306
|
+
WebhooksService,
|
|
2406
3307
|
bookingClientConfigSchema,
|
|
2407
3308
|
createErrorFromResponse,
|
|
2408
3309
|
firstPage,
|