@atzentis/booking-sdk 0.1.10 → 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 +608 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1215 -1
- package/dist/index.d.ts +1215 -1
- package/dist/index.js +599 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,28 +35,36 @@ __export(index_exports, {
|
|
|
35
35
|
BookingError: () => BookingError,
|
|
36
36
|
BookingsService: () => BookingsService,
|
|
37
37
|
CategoriesService: () => CategoriesService,
|
|
38
|
+
ConciergeService: () => ConciergeService,
|
|
38
39
|
ConflictError: () => ConflictError,
|
|
39
40
|
DEFAULT_MODULES: () => DEFAULT_MODULES,
|
|
40
41
|
DiscountsService: () => DiscountsService,
|
|
41
42
|
DistributionService: () => DistributionService,
|
|
42
43
|
FinanceService: () => FinanceService,
|
|
44
|
+
FiscalService: () => FiscalService,
|
|
43
45
|
ForbiddenError: () => ForbiddenError,
|
|
44
46
|
GroupsService: () => GroupsService,
|
|
45
47
|
GuestsService: () => GuestsService,
|
|
46
48
|
HousekeepingService: () => HousekeepingService,
|
|
47
49
|
HttpClient: () => HttpClient,
|
|
50
|
+
IdScanningService: () => IdScanningService,
|
|
51
|
+
IntelligenceService: () => IntelligenceService,
|
|
48
52
|
NightAuditService: () => NightAuditService,
|
|
49
53
|
NotFoundError: () => NotFoundError,
|
|
54
|
+
NotificationsService: () => NotificationsService,
|
|
50
55
|
PROPERTY_MODULES: () => PROPERTY_MODULES,
|
|
51
56
|
PaymentError: () => PaymentError,
|
|
52
57
|
PaymentsService: () => PaymentsService,
|
|
58
|
+
PortfoliosService: () => PortfoliosService,
|
|
53
59
|
PropertiesService: () => PropertiesService,
|
|
54
60
|
RateLimitError: () => RateLimitError,
|
|
55
61
|
RatePlansService: () => RatePlansService,
|
|
62
|
+
RevenueService: () => RevenueService,
|
|
56
63
|
ReviewsService: () => ReviewsService,
|
|
57
64
|
SPACE_STATUSES: () => SPACE_STATUSES,
|
|
58
65
|
SPACE_TYPES: () => SPACE_TYPES,
|
|
59
66
|
ServerError: () => ServerError,
|
|
67
|
+
SettingsService: () => SettingsService,
|
|
60
68
|
SpacesService: () => SpacesService,
|
|
61
69
|
StaffService: () => StaffService,
|
|
62
70
|
SupplyService: () => SupplyService,
|
|
@@ -64,6 +72,7 @@ __export(index_exports, {
|
|
|
64
72
|
TimeoutError: () => TimeoutError,
|
|
65
73
|
VERSION: () => VERSION,
|
|
66
74
|
ValidationError: () => ValidationError,
|
|
75
|
+
WebhooksService: () => WebhooksService,
|
|
67
76
|
bookingClientConfigSchema: () => bookingClientConfigSchema,
|
|
68
77
|
createErrorFromResponse: () => createErrorFromResponse,
|
|
69
78
|
firstPage: () => firstPage,
|
|
@@ -1104,6 +1113,104 @@ var CategoriesService = class extends BaseService {
|
|
|
1104
1113
|
}
|
|
1105
1114
|
};
|
|
1106
1115
|
|
|
1116
|
+
// src/services/concierge.ts
|
|
1117
|
+
var ConciergeService = class extends BaseService {
|
|
1118
|
+
constructor() {
|
|
1119
|
+
super(...arguments);
|
|
1120
|
+
this.basePath = "/concierge/v1";
|
|
1121
|
+
}
|
|
1122
|
+
// ---------------------------------------------------------------------------
|
|
1123
|
+
// Conversations
|
|
1124
|
+
// ---------------------------------------------------------------------------
|
|
1125
|
+
/** Create a new guest conversation */
|
|
1126
|
+
createConversation(input) {
|
|
1127
|
+
return this._post(this._buildPath("conversations"), input);
|
|
1128
|
+
}
|
|
1129
|
+
/** Get a conversation by ID */
|
|
1130
|
+
getConversation(conversationId) {
|
|
1131
|
+
return this._get(this._buildPath("conversations", conversationId));
|
|
1132
|
+
}
|
|
1133
|
+
/** List conversations with optional filters */
|
|
1134
|
+
listConversations(params) {
|
|
1135
|
+
const query = {};
|
|
1136
|
+
query.propertyId = params.propertyId;
|
|
1137
|
+
if (params.guestId !== void 0) query.guestId = params.guestId;
|
|
1138
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1139
|
+
if (params.channel !== void 0) query.channel = params.channel;
|
|
1140
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1141
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1142
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
1143
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
1144
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1145
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1146
|
+
return this._get(this._buildPath("conversations"), query);
|
|
1147
|
+
}
|
|
1148
|
+
// ---------------------------------------------------------------------------
|
|
1149
|
+
// Messages
|
|
1150
|
+
// ---------------------------------------------------------------------------
|
|
1151
|
+
/** Send a message in a conversation */
|
|
1152
|
+
sendMessage(conversationId, input) {
|
|
1153
|
+
return this._post(
|
|
1154
|
+
this._buildPath("conversations", conversationId, "messages"),
|
|
1155
|
+
input
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
// ---------------------------------------------------------------------------
|
|
1159
|
+
// Context & Escalation
|
|
1160
|
+
// ---------------------------------------------------------------------------
|
|
1161
|
+
/** Get the full context for a conversation (property, guest, booking, FAQ) */
|
|
1162
|
+
getContext(conversationId) {
|
|
1163
|
+
return this._get(
|
|
1164
|
+
this._buildPath("conversations", conversationId, "context")
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
/** Escalate a conversation to staff */
|
|
1168
|
+
escalate(conversationId, input) {
|
|
1169
|
+
return this._post(
|
|
1170
|
+
this._buildPath("conversations", conversationId, "escalate"),
|
|
1171
|
+
input ?? {}
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
/** Resolve a conversation */
|
|
1175
|
+
resolve(conversationId, input) {
|
|
1176
|
+
return this._post(
|
|
1177
|
+
this._buildPath("conversations", conversationId, "resolve"),
|
|
1178
|
+
input ?? {}
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
// ---------------------------------------------------------------------------
|
|
1182
|
+
// Templates
|
|
1183
|
+
// ---------------------------------------------------------------------------
|
|
1184
|
+
/** Create a response template */
|
|
1185
|
+
createTemplate(input) {
|
|
1186
|
+
return this._post(this._buildPath("templates"), input);
|
|
1187
|
+
}
|
|
1188
|
+
/** Get a template by ID */
|
|
1189
|
+
getTemplate(templateId) {
|
|
1190
|
+
return this._get(this._buildPath("templates", templateId));
|
|
1191
|
+
}
|
|
1192
|
+
/** List templates with optional filters */
|
|
1193
|
+
listTemplates(params) {
|
|
1194
|
+
const query = {};
|
|
1195
|
+
query.propertyId = params.propertyId;
|
|
1196
|
+
if (params.category !== void 0) query.category = params.category;
|
|
1197
|
+
if (params.language !== void 0) query.language = params.language;
|
|
1198
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
1199
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
1200
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1201
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1202
|
+
return this._get(this._buildPath("templates"), query);
|
|
1203
|
+
}
|
|
1204
|
+
/** Update a template */
|
|
1205
|
+
updateTemplate(templateId, input) {
|
|
1206
|
+
return this._patch(this._buildPath("templates", templateId), input);
|
|
1207
|
+
}
|
|
1208
|
+
/** Delete a template */
|
|
1209
|
+
deleteTemplate(templateId) {
|
|
1210
|
+
return this._delete(this._buildPath("templates", templateId));
|
|
1211
|
+
}
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1107
1214
|
// src/services/discounts.ts
|
|
1108
1215
|
var DiscountsService = class extends BaseService {
|
|
1109
1216
|
constructor() {
|
|
@@ -1429,6 +1536,77 @@ var FinanceService = class extends BaseService {
|
|
|
1429
1536
|
}
|
|
1430
1537
|
};
|
|
1431
1538
|
|
|
1539
|
+
// src/services/fiscal.ts
|
|
1540
|
+
var FiscalService = class extends BaseService {
|
|
1541
|
+
constructor() {
|
|
1542
|
+
super(...arguments);
|
|
1543
|
+
this.basePath = "/fiscal/v1";
|
|
1544
|
+
}
|
|
1545
|
+
// ---------------------------------------------------------------------------
|
|
1546
|
+
// myDATA (Greek fiscal compliance)
|
|
1547
|
+
// ---------------------------------------------------------------------------
|
|
1548
|
+
/** Get the current myDATA integration status */
|
|
1549
|
+
getMyDataStatus() {
|
|
1550
|
+
return this._get(this._buildPath("mydata", "status"));
|
|
1551
|
+
}
|
|
1552
|
+
/** Submit an invoice to the Greek AADE myDATA platform */
|
|
1553
|
+
submitMyData(input) {
|
|
1554
|
+
return this._post(this._buildPath("mydata", "submit"), input);
|
|
1555
|
+
}
|
|
1556
|
+
/** List myDATA submissions with optional filters */
|
|
1557
|
+
listMyDataSubmissions(params) {
|
|
1558
|
+
if (!params) {
|
|
1559
|
+
return this._get(this._buildPath("mydata", "submissions"));
|
|
1560
|
+
}
|
|
1561
|
+
const query = {};
|
|
1562
|
+
if (params.status !== void 0) query.status = params.status;
|
|
1563
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1564
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1565
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1566
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1567
|
+
return this._get(this._buildPath("mydata", "submissions"), query);
|
|
1568
|
+
}
|
|
1569
|
+
/** Get a single myDATA submission by ID */
|
|
1570
|
+
getMyDataSubmission(submissionId) {
|
|
1571
|
+
return this._get(this._buildPath("mydata", "submissions", submissionId));
|
|
1572
|
+
}
|
|
1573
|
+
/** Generate a QR code for a myDATA transaction */
|
|
1574
|
+
getMyDataQr(transactionId) {
|
|
1575
|
+
return this._get(this._buildPath("mydata", "qr", transactionId));
|
|
1576
|
+
}
|
|
1577
|
+
// ---------------------------------------------------------------------------
|
|
1578
|
+
// TSE (German fiscal compliance)
|
|
1579
|
+
// ---------------------------------------------------------------------------
|
|
1580
|
+
/** Get the current TSE device status */
|
|
1581
|
+
getTseStatus() {
|
|
1582
|
+
return this._get(this._buildPath("tse", "status"));
|
|
1583
|
+
}
|
|
1584
|
+
/** List TSE transactions with optional filters */
|
|
1585
|
+
listTseTransactions(params) {
|
|
1586
|
+
if (!params) {
|
|
1587
|
+
return this._get(this._buildPath("tse", "transactions"));
|
|
1588
|
+
}
|
|
1589
|
+
const query = {};
|
|
1590
|
+
if (params.from !== void 0) query.from = params.from;
|
|
1591
|
+
if (params.to !== void 0) query.to = params.to;
|
|
1592
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
1593
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
1594
|
+
return this._get(this._buildPath("tse", "transactions"), query);
|
|
1595
|
+
}
|
|
1596
|
+
/** Trigger a TSE day closure */
|
|
1597
|
+
tseDayClosure(input) {
|
|
1598
|
+
return this._post(this._buildPath("tse", "day-closure"), input ?? {});
|
|
1599
|
+
}
|
|
1600
|
+
/** Export DSFinV-K data for a date range */
|
|
1601
|
+
tseExportDsfinvk(params) {
|
|
1602
|
+
const query = {};
|
|
1603
|
+
query.from = params.from;
|
|
1604
|
+
query.to = params.to;
|
|
1605
|
+
if (params.format !== void 0) query.format = params.format;
|
|
1606
|
+
return this._get(this._buildPath("tse", "export", "dsfinvk"), query);
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1432
1610
|
// src/services/groups.ts
|
|
1433
1611
|
var GroupsService = class extends BaseService {
|
|
1434
1612
|
constructor() {
|
|
@@ -1825,6 +2003,77 @@ var HousekeepingService = class extends BaseService {
|
|
|
1825
2003
|
}
|
|
1826
2004
|
};
|
|
1827
2005
|
|
|
2006
|
+
// src/services/id-scanning.ts
|
|
2007
|
+
var IdScanningService = class extends BaseService {
|
|
2008
|
+
constructor() {
|
|
2009
|
+
super(...arguments);
|
|
2010
|
+
this.basePath = "/guest/v1/id-scans";
|
|
2011
|
+
}
|
|
2012
|
+
/** Upload a document image for OCR processing */
|
|
2013
|
+
upload(input) {
|
|
2014
|
+
const formData = new FormData();
|
|
2015
|
+
formData.append("guestId", input.guestId);
|
|
2016
|
+
formData.append(
|
|
2017
|
+
"file",
|
|
2018
|
+
input.file instanceof ArrayBuffer ? new Blob([input.file]) : input.file
|
|
2019
|
+
);
|
|
2020
|
+
formData.append("type", input.type);
|
|
2021
|
+
return this._post(this.basePath, formData);
|
|
2022
|
+
}
|
|
2023
|
+
/** Get the OCR result for a scan by ID */
|
|
2024
|
+
getResult(scanId) {
|
|
2025
|
+
return this._get(this._buildPath(scanId));
|
|
2026
|
+
}
|
|
2027
|
+
/** List ID scans with optional filters */
|
|
2028
|
+
list(params) {
|
|
2029
|
+
const query = {};
|
|
2030
|
+
query.guestId = params.guestId;
|
|
2031
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2032
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2033
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2034
|
+
return this._get(this.basePath, query);
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
|
|
2038
|
+
// src/services/intelligence.ts
|
|
2039
|
+
var IntelligenceService = class extends BaseService {
|
|
2040
|
+
constructor() {
|
|
2041
|
+
super(...arguments);
|
|
2042
|
+
this.basePath = "/guest/v1";
|
|
2043
|
+
}
|
|
2044
|
+
// ---------------------------------------------------------------------------
|
|
2045
|
+
// Profile
|
|
2046
|
+
// ---------------------------------------------------------------------------
|
|
2047
|
+
/** Get the intelligence profile for a guest */
|
|
2048
|
+
getProfile(guestId) {
|
|
2049
|
+
return this._get(this._buildPath("profiles", guestId, "intelligence"));
|
|
2050
|
+
}
|
|
2051
|
+
/** Trigger a refresh of the intelligence profile for a guest */
|
|
2052
|
+
refresh(guestId) {
|
|
2053
|
+
return this._post(
|
|
2054
|
+
this._buildPath("profiles", guestId, "intelligence", "refresh"),
|
|
2055
|
+
{}
|
|
2056
|
+
);
|
|
2057
|
+
}
|
|
2058
|
+
// ---------------------------------------------------------------------------
|
|
2059
|
+
// Events
|
|
2060
|
+
// ---------------------------------------------------------------------------
|
|
2061
|
+
/** Ingest a guest intelligence event for processing */
|
|
2062
|
+
ingestEvent(input) {
|
|
2063
|
+
return this._post(this._buildPath("intelligence", "events"), input);
|
|
2064
|
+
}
|
|
2065
|
+
/** List intelligence events for a guest with optional filters */
|
|
2066
|
+
listEvents(params) {
|
|
2067
|
+
const query = {};
|
|
2068
|
+
query.guestId = params.guestId;
|
|
2069
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2070
|
+
if (params.type !== void 0) query.type = params.type;
|
|
2071
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2072
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2073
|
+
return this._get(this._buildPath("intelligence", "events"), query);
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
|
|
1828
2077
|
// src/services/night-audit.ts
|
|
1829
2078
|
var NightAuditService = class extends BaseService {
|
|
1830
2079
|
constructor() {
|
|
@@ -1859,6 +2108,26 @@ var NightAuditService = class extends BaseService {
|
|
|
1859
2108
|
}
|
|
1860
2109
|
};
|
|
1861
2110
|
|
|
2111
|
+
// src/services/notifications.ts
|
|
2112
|
+
var NotificationsService = class extends BaseService {
|
|
2113
|
+
constructor() {
|
|
2114
|
+
super(...arguments);
|
|
2115
|
+
this.basePath = "/notifications/v1";
|
|
2116
|
+
}
|
|
2117
|
+
/** Get notification preferences for a guest */
|
|
2118
|
+
getPreferences(guestId) {
|
|
2119
|
+
return this._get(this._buildPath("preferences", guestId));
|
|
2120
|
+
}
|
|
2121
|
+
/** Update notification preferences for a guest */
|
|
2122
|
+
updatePreferences(guestId, input) {
|
|
2123
|
+
return this._patch(this._buildPath("preferences", guestId), input);
|
|
2124
|
+
}
|
|
2125
|
+
/** Opt a guest out of notifications (all channels or specific ones) */
|
|
2126
|
+
optOut(input) {
|
|
2127
|
+
return this._post(this._buildPath("opt-out"), input);
|
|
2128
|
+
}
|
|
2129
|
+
};
|
|
2130
|
+
|
|
1862
2131
|
// src/services/payments.ts
|
|
1863
2132
|
var PaymentsService = class extends BaseService {
|
|
1864
2133
|
constructor() {
|
|
@@ -1954,6 +2223,77 @@ var PaymentsService = class extends BaseService {
|
|
|
1954
2223
|
}
|
|
1955
2224
|
};
|
|
1956
2225
|
|
|
2226
|
+
// src/services/portfolios.ts
|
|
2227
|
+
var PortfoliosService = class extends BaseService {
|
|
2228
|
+
constructor() {
|
|
2229
|
+
super(...arguments);
|
|
2230
|
+
this.basePath = "/operations/v1/portfolios";
|
|
2231
|
+
}
|
|
2232
|
+
// ---------------------------------------------------------------------------
|
|
2233
|
+
// CRUD
|
|
2234
|
+
// ---------------------------------------------------------------------------
|
|
2235
|
+
/** Create a new portfolio */
|
|
2236
|
+
create(input) {
|
|
2237
|
+
return this._post(this.basePath, input);
|
|
2238
|
+
}
|
|
2239
|
+
/** Get a portfolio by ID including its properties */
|
|
2240
|
+
get(portfolioId) {
|
|
2241
|
+
return this._get(this._buildPath(portfolioId));
|
|
2242
|
+
}
|
|
2243
|
+
/** List portfolios with optional filters */
|
|
2244
|
+
list(params) {
|
|
2245
|
+
if (!params) return this._get(this.basePath);
|
|
2246
|
+
const query = {};
|
|
2247
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2248
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2249
|
+
if (params.search !== void 0) query.search = params.search;
|
|
2250
|
+
return this._get(this.basePath, query);
|
|
2251
|
+
}
|
|
2252
|
+
/** Update a portfolio */
|
|
2253
|
+
update(portfolioId, input) {
|
|
2254
|
+
return this._patch(this._buildPath(portfolioId), input);
|
|
2255
|
+
}
|
|
2256
|
+
/** Delete a portfolio */
|
|
2257
|
+
delete(portfolioId) {
|
|
2258
|
+
return this._delete(this._buildPath(portfolioId));
|
|
2259
|
+
}
|
|
2260
|
+
// ---------------------------------------------------------------------------
|
|
2261
|
+
// Membership
|
|
2262
|
+
// ---------------------------------------------------------------------------
|
|
2263
|
+
/** Add a property to a portfolio */
|
|
2264
|
+
addProperty(portfolioId, input) {
|
|
2265
|
+
return this._post(this._buildPath(portfolioId, "properties"), input);
|
|
2266
|
+
}
|
|
2267
|
+
/** Remove a property from a portfolio */
|
|
2268
|
+
removeProperty(portfolioId, propertyId) {
|
|
2269
|
+
return this._delete(this._buildPath(portfolioId, "properties", propertyId));
|
|
2270
|
+
}
|
|
2271
|
+
// ---------------------------------------------------------------------------
|
|
2272
|
+
// Dashboard
|
|
2273
|
+
// ---------------------------------------------------------------------------
|
|
2274
|
+
/** Get aggregated dashboard data for a portfolio */
|
|
2275
|
+
getDashboard(portfolioId, params) {
|
|
2276
|
+
const path = this._buildPath(portfolioId, "dashboard");
|
|
2277
|
+
if (!params) return this._get(path);
|
|
2278
|
+
const query = {};
|
|
2279
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2280
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2281
|
+
return this._get(path, query);
|
|
2282
|
+
}
|
|
2283
|
+
// ---------------------------------------------------------------------------
|
|
2284
|
+
// Search
|
|
2285
|
+
// ---------------------------------------------------------------------------
|
|
2286
|
+
/** Search for guests, bookings, or all records within a portfolio */
|
|
2287
|
+
search(portfolioId, params) {
|
|
2288
|
+
const query = {};
|
|
2289
|
+
query.query = params.query;
|
|
2290
|
+
if (params.type !== void 0) query.type = params.type;
|
|
2291
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2292
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2293
|
+
return this._get(this._buildPath(portfolioId, "search"), query);
|
|
2294
|
+
}
|
|
2295
|
+
};
|
|
2296
|
+
|
|
1957
2297
|
// src/services/properties.ts
|
|
1958
2298
|
var PropertiesService = class extends BaseService {
|
|
1959
2299
|
constructor() {
|
|
@@ -2121,6 +2461,152 @@ var RatePlansService = class extends BaseService {
|
|
|
2121
2461
|
}
|
|
2122
2462
|
};
|
|
2123
2463
|
|
|
2464
|
+
// src/services/revenue.ts
|
|
2465
|
+
var RevenueService = class extends BaseService {
|
|
2466
|
+
constructor() {
|
|
2467
|
+
super(...arguments);
|
|
2468
|
+
this.basePath = "/revenue/v1";
|
|
2469
|
+
}
|
|
2470
|
+
// ---------------------------------------------------------------------------
|
|
2471
|
+
// Dashboard
|
|
2472
|
+
// ---------------------------------------------------------------------------
|
|
2473
|
+
/** Get the revenue dashboard with KPIs, occupancy, and revenue breakdown */
|
|
2474
|
+
getDashboard(params) {
|
|
2475
|
+
const query = {};
|
|
2476
|
+
query.propertyId = params.propertyId;
|
|
2477
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2478
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2479
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2480
|
+
return this._get(this._buildPath("dashboard"), query);
|
|
2481
|
+
}
|
|
2482
|
+
/** Get individual KPI metrics with optional granularity breakdown */
|
|
2483
|
+
getKPIs(params) {
|
|
2484
|
+
const query = {};
|
|
2485
|
+
query.propertyId = params.propertyId;
|
|
2486
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2487
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2488
|
+
if (params.metrics !== void 0) query.metrics = params.metrics.join(",");
|
|
2489
|
+
if (params.granularity !== void 0) query.granularity = params.granularity;
|
|
2490
|
+
return this._get(this._buildPath("kpis"), query);
|
|
2491
|
+
}
|
|
2492
|
+
// ---------------------------------------------------------------------------
|
|
2493
|
+
// Rate suggestions
|
|
2494
|
+
// ---------------------------------------------------------------------------
|
|
2495
|
+
/** List AI-generated rate suggestions with optional filters */
|
|
2496
|
+
listSuggestions(params) {
|
|
2497
|
+
const query = {};
|
|
2498
|
+
query.propertyId = params.propertyId;
|
|
2499
|
+
if (params.status !== void 0) query.status = params.status;
|
|
2500
|
+
if (params.ratePlanId !== void 0) query.ratePlanId = params.ratePlanId;
|
|
2501
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2502
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2503
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2504
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2505
|
+
return this._get(this._buildPath("suggestions"), query);
|
|
2506
|
+
}
|
|
2507
|
+
/** Apply a rate suggestion, updating the associated rate plan */
|
|
2508
|
+
applySuggestion(suggestionId) {
|
|
2509
|
+
return this._post(this._buildPath("suggestions", suggestionId, "apply"), {});
|
|
2510
|
+
}
|
|
2511
|
+
/** Dismiss a rate suggestion with an optional reason */
|
|
2512
|
+
dismissSuggestion(suggestionId, input) {
|
|
2513
|
+
return this._post(
|
|
2514
|
+
this._buildPath("suggestions", suggestionId, "dismiss"),
|
|
2515
|
+
input ?? {}
|
|
2516
|
+
);
|
|
2517
|
+
}
|
|
2518
|
+
// ---------------------------------------------------------------------------
|
|
2519
|
+
// Competitors
|
|
2520
|
+
// ---------------------------------------------------------------------------
|
|
2521
|
+
/** List competitors tracked for a property */
|
|
2522
|
+
listCompetitors(params) {
|
|
2523
|
+
const query = {};
|
|
2524
|
+
query.propertyId = params.propertyId;
|
|
2525
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
2526
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
2527
|
+
return this._get(this._buildPath("competitors"), query);
|
|
2528
|
+
}
|
|
2529
|
+
/** Get rate data scraped for a competitor over a date range */
|
|
2530
|
+
getCompetitorRates(competitorId, params) {
|
|
2531
|
+
const query = {};
|
|
2532
|
+
if (params !== void 0) {
|
|
2533
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2534
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2535
|
+
if (params.source !== void 0) query.source = params.source;
|
|
2536
|
+
}
|
|
2537
|
+
return this._get(
|
|
2538
|
+
this._buildPath("competitors", competitorId, "rates"),
|
|
2539
|
+
query
|
|
2540
|
+
);
|
|
2541
|
+
}
|
|
2542
|
+
/** Add a competitor to track for a property */
|
|
2543
|
+
addCompetitor(input) {
|
|
2544
|
+
return this._post(this._buildPath("competitors"), input);
|
|
2545
|
+
}
|
|
2546
|
+
// ---------------------------------------------------------------------------
|
|
2547
|
+
// Reports
|
|
2548
|
+
// ---------------------------------------------------------------------------
|
|
2549
|
+
/** Get a detailed revenue report with optional comparison period */
|
|
2550
|
+
getRevenueReport(params) {
|
|
2551
|
+
const query = {};
|
|
2552
|
+
query.propertyId = params.propertyId;
|
|
2553
|
+
query.from = params.from;
|
|
2554
|
+
query.to = params.to;
|
|
2555
|
+
if (params.groupBy !== void 0) query.groupBy = params.groupBy;
|
|
2556
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2557
|
+
return this._get(this._buildPath("reports", "revenue"), query);
|
|
2558
|
+
}
|
|
2559
|
+
/** Get a revenue forecast for a future date range */
|
|
2560
|
+
getForecast(params) {
|
|
2561
|
+
const query = {};
|
|
2562
|
+
query.propertyId = params.propertyId;
|
|
2563
|
+
query.from = params.from;
|
|
2564
|
+
query.to = params.to;
|
|
2565
|
+
if (params.model !== void 0) query.model = params.model;
|
|
2566
|
+
return this._get(this._buildPath("reports", "forecast"), query);
|
|
2567
|
+
}
|
|
2568
|
+
/** Get a pace report comparing current bookings against a prior period */
|
|
2569
|
+
getPaceReport(params) {
|
|
2570
|
+
const query = {};
|
|
2571
|
+
query.propertyId = params.propertyId;
|
|
2572
|
+
query.from = params.from;
|
|
2573
|
+
query.to = params.to;
|
|
2574
|
+
if (params.compareWith !== void 0) query.compareWith = params.compareWith;
|
|
2575
|
+
if (params.granularity !== void 0) query.granularity = params.granularity;
|
|
2576
|
+
return this._get(this._buildPath("reports", "pace"), query);
|
|
2577
|
+
}
|
|
2578
|
+
// ---------------------------------------------------------------------------
|
|
2579
|
+
// Portfolio
|
|
2580
|
+
// ---------------------------------------------------------------------------
|
|
2581
|
+
/** Get a portfolio-level dashboard with aggregated KPIs */
|
|
2582
|
+
getPortfolioDashboard(params) {
|
|
2583
|
+
const query = {};
|
|
2584
|
+
query.portfolioId = params.portfolioId;
|
|
2585
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2586
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2587
|
+
return this._get(this._buildPath("portfolio", "dashboard"), query);
|
|
2588
|
+
}
|
|
2589
|
+
/** Get a per-property breakdown of revenue metrics across a portfolio */
|
|
2590
|
+
getPortfolioBreakdown(params) {
|
|
2591
|
+
const query = {};
|
|
2592
|
+
query.portfolioId = params.portfolioId;
|
|
2593
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2594
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2595
|
+
if (params.sortBy !== void 0) query.sortBy = params.sortBy;
|
|
2596
|
+
if (params.sortOrder !== void 0) query.sortOrder = params.sortOrder;
|
|
2597
|
+
return this._get(this._buildPath("portfolio", "breakdown"), query);
|
|
2598
|
+
}
|
|
2599
|
+
/** Get a revenue forecast for all properties in a portfolio */
|
|
2600
|
+
getPortfolioForecast(params) {
|
|
2601
|
+
const query = {};
|
|
2602
|
+
query.portfolioId = params.portfolioId;
|
|
2603
|
+
if (params.from !== void 0) query.from = params.from;
|
|
2604
|
+
if (params.to !== void 0) query.to = params.to;
|
|
2605
|
+
if (params.model !== void 0) query.model = params.model;
|
|
2606
|
+
return this._get(this._buildPath("portfolio", "forecast"), query);
|
|
2607
|
+
}
|
|
2608
|
+
};
|
|
2609
|
+
|
|
2124
2610
|
// src/services/reviews.ts
|
|
2125
2611
|
var ReviewsService = class extends BaseService {
|
|
2126
2612
|
constructor() {
|
|
@@ -2206,6 +2692,30 @@ var ReviewsService = class extends BaseService {
|
|
|
2206
2692
|
}
|
|
2207
2693
|
};
|
|
2208
2694
|
|
|
2695
|
+
// src/services/settings.ts
|
|
2696
|
+
var SettingsService = class extends BaseService {
|
|
2697
|
+
constructor() {
|
|
2698
|
+
super(...arguments);
|
|
2699
|
+
this.basePath = "/settings/v1";
|
|
2700
|
+
}
|
|
2701
|
+
/** Get property-level settings */
|
|
2702
|
+
getPropertySettings() {
|
|
2703
|
+
return this._get(this._buildPath("property"));
|
|
2704
|
+
}
|
|
2705
|
+
/** Update property-level settings */
|
|
2706
|
+
updatePropertySettings(input) {
|
|
2707
|
+
return this._patch(this._buildPath("property"), input);
|
|
2708
|
+
}
|
|
2709
|
+
/** Get fiscal compliance settings (myDATA and TSE) */
|
|
2710
|
+
getFiscalSettings() {
|
|
2711
|
+
return this._get(this._buildPath("fiscal"));
|
|
2712
|
+
}
|
|
2713
|
+
/** Update fiscal compliance settings (myDATA and TSE) */
|
|
2714
|
+
updateFiscalSettings(input) {
|
|
2715
|
+
return this._patch(this._buildPath("fiscal"), input);
|
|
2716
|
+
}
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2209
2719
|
// src/services/spaces.ts
|
|
2210
2720
|
var SpacesService = class extends BaseService {
|
|
2211
2721
|
constructor() {
|
|
@@ -2519,6 +3029,50 @@ var TasksService = class extends BaseService {
|
|
|
2519
3029
|
}
|
|
2520
3030
|
};
|
|
2521
3031
|
|
|
3032
|
+
// src/services/webhooks.ts
|
|
3033
|
+
var WebhooksService = class extends BaseService {
|
|
3034
|
+
constructor() {
|
|
3035
|
+
super(...arguments);
|
|
3036
|
+
this.basePath = "/webhooks/v1";
|
|
3037
|
+
}
|
|
3038
|
+
/** Create a new webhook subscription */
|
|
3039
|
+
createSubscription(input) {
|
|
3040
|
+
return this._post(this._buildPath("subscriptions"), input);
|
|
3041
|
+
}
|
|
3042
|
+
/** List webhook subscriptions with optional filters */
|
|
3043
|
+
listSubscriptions(params) {
|
|
3044
|
+
if (!params) {
|
|
3045
|
+
return this._get(this._buildPath("subscriptions"));
|
|
3046
|
+
}
|
|
3047
|
+
const query = {};
|
|
3048
|
+
if (params.active !== void 0) query.active = params.active;
|
|
3049
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
3050
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
3051
|
+
return this._get(this._buildPath("subscriptions"), query);
|
|
3052
|
+
}
|
|
3053
|
+
/** Update a webhook subscription */
|
|
3054
|
+
updateSubscription(subscriptionId, input) {
|
|
3055
|
+
return this._patch(
|
|
3056
|
+
this._buildPath("subscriptions", subscriptionId),
|
|
3057
|
+
input
|
|
3058
|
+
);
|
|
3059
|
+
}
|
|
3060
|
+
/** List webhook delivery attempts with optional filters */
|
|
3061
|
+
listDeliveries(params) {
|
|
3062
|
+
if (!params) {
|
|
3063
|
+
return this._get(this._buildPath("deliveries"));
|
|
3064
|
+
}
|
|
3065
|
+
const query = {};
|
|
3066
|
+
if (params.subscriptionId !== void 0) query.subscriptionId = params.subscriptionId;
|
|
3067
|
+
if (params.status !== void 0) query.status = params.status;
|
|
3068
|
+
if (params.from !== void 0) query.from = params.from;
|
|
3069
|
+
if (params.to !== void 0) query.to = params.to;
|
|
3070
|
+
if (params.limit !== void 0) query.limit = params.limit;
|
|
3071
|
+
if (params.cursor !== void 0) query.cursor = params.cursor;
|
|
3072
|
+
return this._get(this._buildPath("deliveries"), query);
|
|
3073
|
+
}
|
|
3074
|
+
};
|
|
3075
|
+
|
|
2522
3076
|
// src/client.ts
|
|
2523
3077
|
var BookingClient = class {
|
|
2524
3078
|
constructor(config) {
|
|
@@ -2546,6 +3100,11 @@ var BookingClient = class {
|
|
|
2546
3100
|
this._bookings ?? (this._bookings = new BookingsService(this.httpClient));
|
|
2547
3101
|
return this._bookings;
|
|
2548
3102
|
}
|
|
3103
|
+
/** Concierge service — lazy-initialized on first access */
|
|
3104
|
+
get concierge() {
|
|
3105
|
+
this._concierge ?? (this._concierge = new ConciergeService(this.httpClient));
|
|
3106
|
+
return this._concierge;
|
|
3107
|
+
}
|
|
2549
3108
|
/** Distribution service — lazy-initialized on first access */
|
|
2550
3109
|
get distribution() {
|
|
2551
3110
|
this._distribution ?? (this._distribution = new DistributionService(this.httpClient));
|
|
@@ -2556,6 +3115,11 @@ var BookingClient = class {
|
|
|
2556
3115
|
this._finance ?? (this._finance = new FinanceService(this.httpClient));
|
|
2557
3116
|
return this._finance;
|
|
2558
3117
|
}
|
|
3118
|
+
/** Fiscal service — lazy-initialized on first access */
|
|
3119
|
+
get fiscal() {
|
|
3120
|
+
this._fiscal ?? (this._fiscal = new FiscalService(this.httpClient));
|
|
3121
|
+
return this._fiscal;
|
|
3122
|
+
}
|
|
2559
3123
|
/** Groups service — lazy-initialized on first access */
|
|
2560
3124
|
get groups() {
|
|
2561
3125
|
this._groups ?? (this._groups = new GroupsService(this.httpClient));
|
|
@@ -2571,16 +3135,36 @@ var BookingClient = class {
|
|
|
2571
3135
|
this._housekeeping ?? (this._housekeeping = new HousekeepingService(this.httpClient));
|
|
2572
3136
|
return this._housekeeping;
|
|
2573
3137
|
}
|
|
3138
|
+
/** ID scanning service — lazy-initialized on first access */
|
|
3139
|
+
get idScanning() {
|
|
3140
|
+
this._idScanning ?? (this._idScanning = new IdScanningService(this.httpClient));
|
|
3141
|
+
return this._idScanning;
|
|
3142
|
+
}
|
|
3143
|
+
/** Intelligence service — lazy-initialized on first access */
|
|
3144
|
+
get intelligence() {
|
|
3145
|
+
this._intelligence ?? (this._intelligence = new IntelligenceService(this.httpClient));
|
|
3146
|
+
return this._intelligence;
|
|
3147
|
+
}
|
|
2574
3148
|
/** Night audit service — lazy-initialized on first access */
|
|
2575
3149
|
get nightAudit() {
|
|
2576
3150
|
this._nightAudit ?? (this._nightAudit = new NightAuditService(this.httpClient));
|
|
2577
3151
|
return this._nightAudit;
|
|
2578
3152
|
}
|
|
3153
|
+
/** Notifications service — lazy-initialized on first access */
|
|
3154
|
+
get notifications() {
|
|
3155
|
+
this._notifications ?? (this._notifications = new NotificationsService(this.httpClient));
|
|
3156
|
+
return this._notifications;
|
|
3157
|
+
}
|
|
2579
3158
|
/** Payments service — lazy-initialized on first access */
|
|
2580
3159
|
get payments() {
|
|
2581
3160
|
this._payments ?? (this._payments = new PaymentsService(this.httpClient));
|
|
2582
3161
|
return this._payments;
|
|
2583
3162
|
}
|
|
3163
|
+
/** Portfolios service — lazy-initialized on first access */
|
|
3164
|
+
get portfolios() {
|
|
3165
|
+
this._portfolios ?? (this._portfolios = new PortfoliosService(this.httpClient));
|
|
3166
|
+
return this._portfolios;
|
|
3167
|
+
}
|
|
2584
3168
|
/** Properties service — lazy-initialized on first access */
|
|
2585
3169
|
get properties() {
|
|
2586
3170
|
this._properties ?? (this._properties = new PropertiesService(this.httpClient));
|
|
@@ -2591,6 +3175,11 @@ var BookingClient = class {
|
|
|
2591
3175
|
this._ratePlans ?? (this._ratePlans = new RatePlansService(this.httpClient));
|
|
2592
3176
|
return this._ratePlans;
|
|
2593
3177
|
}
|
|
3178
|
+
/** Revenue service — lazy-initialized on first access */
|
|
3179
|
+
get revenue() {
|
|
3180
|
+
this._revenue ?? (this._revenue = new RevenueService(this.httpClient));
|
|
3181
|
+
return this._revenue;
|
|
3182
|
+
}
|
|
2594
3183
|
/** Categories service — lazy-initialized on first access */
|
|
2595
3184
|
get categories() {
|
|
2596
3185
|
this._categories ?? (this._categories = new CategoriesService(this.httpClient));
|
|
@@ -2606,6 +3195,11 @@ var BookingClient = class {
|
|
|
2606
3195
|
this._reviews ?? (this._reviews = new ReviewsService(this.httpClient));
|
|
2607
3196
|
return this._reviews;
|
|
2608
3197
|
}
|
|
3198
|
+
/** Settings service — lazy-initialized on first access */
|
|
3199
|
+
get settings() {
|
|
3200
|
+
this._settings ?? (this._settings = new SettingsService(this.httpClient));
|
|
3201
|
+
return this._settings;
|
|
3202
|
+
}
|
|
2609
3203
|
/** Spaces service — lazy-initialized on first access */
|
|
2610
3204
|
get spaces() {
|
|
2611
3205
|
this._spaces ?? (this._spaces = new SpacesService(this.httpClient));
|
|
@@ -2626,6 +3220,11 @@ var BookingClient = class {
|
|
|
2626
3220
|
this._tasks ?? (this._tasks = new TasksService(this.httpClient));
|
|
2627
3221
|
return this._tasks;
|
|
2628
3222
|
}
|
|
3223
|
+
/** Webhooks service — lazy-initialized on first access */
|
|
3224
|
+
get webhooks() {
|
|
3225
|
+
this._webhooks ?? (this._webhooks = new WebhooksService(this.httpClient));
|
|
3226
|
+
return this._webhooks;
|
|
3227
|
+
}
|
|
2629
3228
|
setApiKey(key) {
|
|
2630
3229
|
if (!key || key.trim().length === 0) {
|
|
2631
3230
|
throw new Error("apiKey must be a non-empty string");
|
|
@@ -2742,28 +3341,36 @@ var VERSION = "0.1.0";
|
|
|
2742
3341
|
BookingError,
|
|
2743
3342
|
BookingsService,
|
|
2744
3343
|
CategoriesService,
|
|
3344
|
+
ConciergeService,
|
|
2745
3345
|
ConflictError,
|
|
2746
3346
|
DEFAULT_MODULES,
|
|
2747
3347
|
DiscountsService,
|
|
2748
3348
|
DistributionService,
|
|
2749
3349
|
FinanceService,
|
|
3350
|
+
FiscalService,
|
|
2750
3351
|
ForbiddenError,
|
|
2751
3352
|
GroupsService,
|
|
2752
3353
|
GuestsService,
|
|
2753
3354
|
HousekeepingService,
|
|
2754
3355
|
HttpClient,
|
|
3356
|
+
IdScanningService,
|
|
3357
|
+
IntelligenceService,
|
|
2755
3358
|
NightAuditService,
|
|
2756
3359
|
NotFoundError,
|
|
3360
|
+
NotificationsService,
|
|
2757
3361
|
PROPERTY_MODULES,
|
|
2758
3362
|
PaymentError,
|
|
2759
3363
|
PaymentsService,
|
|
3364
|
+
PortfoliosService,
|
|
2760
3365
|
PropertiesService,
|
|
2761
3366
|
RateLimitError,
|
|
2762
3367
|
RatePlansService,
|
|
3368
|
+
RevenueService,
|
|
2763
3369
|
ReviewsService,
|
|
2764
3370
|
SPACE_STATUSES,
|
|
2765
3371
|
SPACE_TYPES,
|
|
2766
3372
|
ServerError,
|
|
3373
|
+
SettingsService,
|
|
2767
3374
|
SpacesService,
|
|
2768
3375
|
StaffService,
|
|
2769
3376
|
SupplyService,
|
|
@@ -2771,6 +3378,7 @@ var VERSION = "0.1.0";
|
|
|
2771
3378
|
TimeoutError,
|
|
2772
3379
|
VERSION,
|
|
2773
3380
|
ValidationError,
|
|
3381
|
+
WebhooksService,
|
|
2774
3382
|
bookingClientConfigSchema,
|
|
2775
3383
|
createErrorFromResponse,
|
|
2776
3384
|
firstPage,
|