@atzentis/booking-sdk 0.1.8 → 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.js CHANGED
@@ -1270,6 +1270,94 @@ var FinanceService = class extends BaseService {
1270
1270
  if (params.propertyId !== void 0) query.propertyId = params.propertyId;
1271
1271
  return this._get(this._buildPath("accounting", "vat"), query);
1272
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
+ }
1273
1361
  };
1274
1362
 
1275
1363
  // src/services/guests.ts
@@ -1551,6 +1639,89 @@ var GuestsService = class extends BaseService {
1551
1639
  }
1552
1640
  };
1553
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
+
1554
1725
  // src/services/payments.ts
1555
1726
  var PaymentsService = class extends BaseService {
1556
1727
  constructor() {
@@ -1719,6 +1890,100 @@ var PropertiesService = class extends BaseService {
1719
1890
  }
1720
1891
  };
1721
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
+
1722
1987
  // src/services/spaces.ts
1723
1988
  var SpacesService = class extends BaseService {
1724
1989
  constructor() {
@@ -1848,6 +2113,69 @@ var SpacesService = class extends BaseService {
1848
2113
  }
1849
2114
  };
1850
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
+
1851
2179
  // src/client.ts
1852
2180
  var BookingClient = class {
1853
2181
  constructor(config) {
@@ -1885,11 +2213,26 @@ var BookingClient = class {
1885
2213
  this._finance ?? (this._finance = new FinanceService(this.httpClient));
1886
2214
  return this._finance;
1887
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
+ }
1888
2221
  /** Guests service — lazy-initialized on first access */
1889
2222
  get guests() {
1890
2223
  this._guests ?? (this._guests = new GuestsService(this.httpClient));
1891
2224
  return this._guests;
1892
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
+ }
1893
2236
  /** Payments service — lazy-initialized on first access */
1894
2237
  get payments() {
1895
2238
  this._payments ?? (this._payments = new PaymentsService(this.httpClient));
@@ -1900,6 +2243,11 @@ var BookingClient = class {
1900
2243
  this._properties ?? (this._properties = new PropertiesService(this.httpClient));
1901
2244
  return this._properties;
1902
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
+ }
1903
2251
  /** Categories service — lazy-initialized on first access */
1904
2252
  get categories() {
1905
2253
  this._categories ?? (this._categories = new CategoriesService(this.httpClient));
@@ -1910,6 +2258,11 @@ var BookingClient = class {
1910
2258
  this._spaces ?? (this._spaces = new SpacesService(this.httpClient));
1911
2259
  return this._spaces;
1912
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
+ }
1913
2266
  setApiKey(key) {
1914
2267
  if (!key || key.trim().length === 0) {
1915
2268
  throw new Error("apiKey must be a non-empty string");
@@ -2030,18 +2383,23 @@ export {
2030
2383
  DistributionService,
2031
2384
  FinanceService,
2032
2385
  ForbiddenError,
2386
+ GroupsService,
2033
2387
  GuestsService,
2388
+ HousekeepingService,
2034
2389
  HttpClient,
2390
+ NightAuditService,
2035
2391
  NotFoundError,
2036
2392
  PROPERTY_MODULES,
2037
2393
  PaymentError,
2038
2394
  PaymentsService,
2039
2395
  PropertiesService,
2040
2396
  RateLimitError,
2397
+ RatePlansService,
2041
2398
  SPACE_STATUSES,
2042
2399
  SPACE_TYPES,
2043
2400
  ServerError,
2044
2401
  SpacesService,
2402
+ StaffService,
2045
2403
  TimeoutError,
2046
2404
  VERSION,
2047
2405
  ValidationError,