@torrow/sdk-client 0.2.0 → 0.3.0
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/README.md +5 -1
- package/dist/index.d.ts +279 -50
- package/dist/index.js +1093 -341
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,7 +36,10 @@ function pickApiCode(body) {
|
|
|
36
36
|
return void 0;
|
|
37
37
|
}
|
|
38
38
|
const c = body.code;
|
|
39
|
-
|
|
39
|
+
if (typeof c === "string") {
|
|
40
|
+
return c;
|
|
41
|
+
}
|
|
42
|
+
return typeof c === "number" && Number.isFinite(c) ? String(c) : void 0;
|
|
40
43
|
}
|
|
41
44
|
function pickTraceIdentifier(body) {
|
|
42
45
|
if (body === null || typeof body !== "object") {
|
|
@@ -61,6 +64,7 @@ var TorrowHttpError = class _TorrowHttpError extends Error {
|
|
|
61
64
|
status;
|
|
62
65
|
body;
|
|
63
66
|
apiErrorName;
|
|
67
|
+
/** Код ошибки API строкой: числовой `TorrowErrorClient.code` приводится к строке (`"311293"`). */
|
|
64
68
|
code;
|
|
65
69
|
requestId;
|
|
66
70
|
/**
|
|
@@ -371,6 +375,15 @@ function encodePathSegment(id) {
|
|
|
371
375
|
return encodeURIComponent(id);
|
|
372
376
|
}
|
|
373
377
|
|
|
378
|
+
// ../../src/resources/common/item-update-id.ts
|
|
379
|
+
function requireItemUpdateId(body, itemName) {
|
|
380
|
+
const id = body.id;
|
|
381
|
+
if (!id?.trim() || id !== id.trim()) {
|
|
382
|
+
throw new TypeError(`${itemName} update requires a non-empty, normalized body.id`);
|
|
383
|
+
}
|
|
384
|
+
return id;
|
|
385
|
+
}
|
|
386
|
+
|
|
374
387
|
// ../../src/resources/common/discriminator.ts
|
|
375
388
|
var Discriminator = /* @__PURE__ */ ((Discriminator2) => {
|
|
376
389
|
Discriminator2["ActionHistoryInfo"] = "ActionHistoryInfo";
|
|
@@ -440,13 +453,18 @@ function applyItemCreateDefaults(body, discriminator) {
|
|
|
440
453
|
}
|
|
441
454
|
|
|
442
455
|
// ../../src/util/torrow-id.ts
|
|
443
|
-
import { randomBytes } from "crypto";
|
|
444
456
|
var TORROW_OBJECT_ID_HEX_LENGTH = 24;
|
|
445
457
|
var OBJECT_ID_HEX_LENGTH = TORROW_OBJECT_ID_HEX_LENGTH;
|
|
446
458
|
var RID_HEX_PATTERN = /^[0-9a-fA-F]{24}$/;
|
|
447
459
|
var TORROW_ID_HEX_PATTERN = /^[0-9a-fA-F]+$/;
|
|
448
460
|
function generateRid() {
|
|
449
|
-
|
|
461
|
+
const bytes = new Uint8Array(12);
|
|
462
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
463
|
+
let hex = "";
|
|
464
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
465
|
+
hex += bytes[i].toString(16).padStart(2, "0");
|
|
466
|
+
}
|
|
467
|
+
return hex;
|
|
450
468
|
}
|
|
451
469
|
function isValidRid(value) {
|
|
452
470
|
return typeof value === "string" && RID_HEX_PATTERN.test(value);
|
|
@@ -1324,11 +1342,12 @@ var CalendarsFacade = class extends TorrowItemFacade {
|
|
|
1324
1342
|
signal: options?.signal
|
|
1325
1343
|
});
|
|
1326
1344
|
}
|
|
1327
|
-
/** `PUT /api/v1/calendars/{
|
|
1328
|
-
update(body,
|
|
1345
|
+
/** `PUT /api/v1/calendars/{body.id}` */
|
|
1346
|
+
update(body, options) {
|
|
1347
|
+
const itemId = requireItemUpdateId(body, "Calendar");
|
|
1329
1348
|
return this.http.requestJson({
|
|
1330
1349
|
method: "PUT",
|
|
1331
|
-
path: `${BASE}/${encodePathSegment(
|
|
1350
|
+
path: `${BASE}/${encodePathSegment(itemId)}`,
|
|
1332
1351
|
query: {
|
|
1333
1352
|
checkVersion: options?.checkVersion,
|
|
1334
1353
|
isNeedAnnouncement: options?.isNeedAnnouncement,
|
|
@@ -1466,12 +1485,39 @@ var CaseTypeValues = {
|
|
|
1466
1485
|
State: "State"
|
|
1467
1486
|
};
|
|
1468
1487
|
|
|
1469
|
-
// ../../src/resources/cases/
|
|
1488
|
+
// ../../src/resources/cases/case-requests.ts
|
|
1470
1489
|
var BASE2 = "/api/v1/cases";
|
|
1490
|
+
function getCase(http, torrowId, options) {
|
|
1491
|
+
return http.requestJson({
|
|
1492
|
+
method: "GET",
|
|
1493
|
+
path: `${BASE2}/${encodePathSegment(torrowId)}`,
|
|
1494
|
+
query: {
|
|
1495
|
+
profileId: options?.profileId,
|
|
1496
|
+
caseParticipantProfileId: options?.caseParticipantProfileId,
|
|
1497
|
+
versionToCheck: options?.versionToCheck,
|
|
1498
|
+
includeDeleted: options?.includeDeleted,
|
|
1499
|
+
includeChildTypes: options?.includeChildTypes,
|
|
1500
|
+
securityToken: options?.securityToken,
|
|
1501
|
+
caseParticipantId: options?.caseParticipantId
|
|
1502
|
+
},
|
|
1503
|
+
signal: options?.signal
|
|
1504
|
+
});
|
|
1505
|
+
}
|
|
1506
|
+
function cancelCaseParticipation(http, torrowId, body, options) {
|
|
1507
|
+
return http.requestJson({
|
|
1508
|
+
method: "PUT",
|
|
1509
|
+
path: `${BASE2}/${encodePathSegment(torrowId)}/caseparticipation/cancelcaseparticipation`,
|
|
1510
|
+
body,
|
|
1511
|
+
signal: options?.signal
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
// ../../src/resources/cases/CasesFacade.ts
|
|
1516
|
+
var BASE3 = "/api/v1/cases";
|
|
1471
1517
|
var CasesFacade = class extends TorrowItemFacade {
|
|
1472
1518
|
itemObjectTypeCode = TorrowObjectTypeCode.Case;
|
|
1473
1519
|
constructor(http) {
|
|
1474
|
-
super(http,
|
|
1520
|
+
super(http, BASE3);
|
|
1475
1521
|
}
|
|
1476
1522
|
/** Id события до `createWithOptions` / `createCaseItem` / presigned upload. */
|
|
1477
1523
|
generateCaseId(ownerTorrowId) {
|
|
@@ -1489,7 +1535,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1489
1535
|
};
|
|
1490
1536
|
return this.http.requestJson({
|
|
1491
1537
|
method: "PUT",
|
|
1492
|
-
path:
|
|
1538
|
+
path: BASE3,
|
|
1493
1539
|
query: {
|
|
1494
1540
|
parentId: options?.parentId,
|
|
1495
1541
|
profileId: options?.profileId
|
|
@@ -1506,7 +1552,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1506
1552
|
const payload = this.withCreateDefaults(body);
|
|
1507
1553
|
return this.http.requestJson({
|
|
1508
1554
|
method: "POST",
|
|
1509
|
-
path:
|
|
1555
|
+
path: BASE3,
|
|
1510
1556
|
query: {
|
|
1511
1557
|
parentId: options?.parentId,
|
|
1512
1558
|
profileId: options?.profileId,
|
|
@@ -1520,11 +1566,12 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1520
1566
|
signal: options?.signal
|
|
1521
1567
|
});
|
|
1522
1568
|
}
|
|
1523
|
-
/** `PUT /api/v1/cases/{
|
|
1524
|
-
update(body,
|
|
1569
|
+
/** `PUT /api/v1/cases/{body.id}` */
|
|
1570
|
+
update(body, options) {
|
|
1571
|
+
const itemId = requireItemUpdateId(body, "Case");
|
|
1525
1572
|
return this.http.requestJson({
|
|
1526
1573
|
method: "PUT",
|
|
1527
|
-
path: `${
|
|
1574
|
+
path: `${BASE3}/${encodePathSegment(itemId)}`,
|
|
1528
1575
|
query: {
|
|
1529
1576
|
profileId: options?.profileId,
|
|
1530
1577
|
checkVersion: options?.checkVersion,
|
|
@@ -1555,7 +1602,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1555
1602
|
async delete(torrowId, options) {
|
|
1556
1603
|
const resp = await this.http.requestJson({
|
|
1557
1604
|
method: "DELETE",
|
|
1558
|
-
path: `${
|
|
1605
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}`,
|
|
1559
1606
|
query: {
|
|
1560
1607
|
cascade: options.cascade,
|
|
1561
1608
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -1568,27 +1615,14 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1568
1615
|
}
|
|
1569
1616
|
/** `GET /api/v1/cases/{torrowId}` */
|
|
1570
1617
|
getById(torrowId, options) {
|
|
1571
|
-
return this.http
|
|
1572
|
-
method: "GET",
|
|
1573
|
-
path: `${BASE2}/${encodePathSegment(torrowId)}`,
|
|
1574
|
-
query: {
|
|
1575
|
-
profileId: options?.profileId,
|
|
1576
|
-
caseParticipantProfileId: options?.caseParticipantProfileId,
|
|
1577
|
-
versionToCheck: options?.versionToCheck,
|
|
1578
|
-
includeDeleted: options?.includeDeleted,
|
|
1579
|
-
includeChildTypes: options?.includeChildTypes,
|
|
1580
|
-
securityToken: options?.securityToken,
|
|
1581
|
-
caseParticipantId: options?.caseParticipantId
|
|
1582
|
-
},
|
|
1583
|
-
signal: options?.signal
|
|
1584
|
-
});
|
|
1618
|
+
return getCase(this.http, torrowId, options);
|
|
1585
1619
|
}
|
|
1586
1620
|
/** `GET /api/v1/cases/personallist` */
|
|
1587
1621
|
listPersonal(options) {
|
|
1588
1622
|
const { signal, ...rest } = options ?? {};
|
|
1589
1623
|
return this.http.requestJson({
|
|
1590
1624
|
method: "GET",
|
|
1591
|
-
path: `${
|
|
1625
|
+
path: `${BASE3}/personallist`,
|
|
1592
1626
|
query: { ...rest },
|
|
1593
1627
|
signal
|
|
1594
1628
|
});
|
|
@@ -1597,7 +1631,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1597
1631
|
includeToGroups(body, options) {
|
|
1598
1632
|
return this.http.requestJson({
|
|
1599
1633
|
method: "PUT",
|
|
1600
|
-
path: `${
|
|
1634
|
+
path: `${BASE3}/include/togroups`,
|
|
1601
1635
|
body,
|
|
1602
1636
|
signal: options?.signal
|
|
1603
1637
|
});
|
|
@@ -1606,7 +1640,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1606
1640
|
excludeFromGroups(body, options) {
|
|
1607
1641
|
return this.http.requestJson({
|
|
1608
1642
|
method: "PUT",
|
|
1609
|
-
path: `${
|
|
1643
|
+
path: `${BASE3}/exclude/fromgroups`,
|
|
1610
1644
|
body,
|
|
1611
1645
|
signal: options?.signal
|
|
1612
1646
|
});
|
|
@@ -1615,7 +1649,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1615
1649
|
getByUniqueName(uniqueName, options) {
|
|
1616
1650
|
return this.http.requestJson({
|
|
1617
1651
|
method: "GET",
|
|
1618
|
-
path: `${
|
|
1652
|
+
path: `${BASE3}/uniquename/${encodePathSegment(uniqueName)}`,
|
|
1619
1653
|
query: { profileId: options?.profileId },
|
|
1620
1654
|
signal: options?.signal
|
|
1621
1655
|
});
|
|
@@ -1624,7 +1658,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1624
1658
|
listResources(torrowId, query, options) {
|
|
1625
1659
|
return this.http.requestJson({
|
|
1626
1660
|
method: "GET",
|
|
1627
|
-
path: `${
|
|
1661
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/resources`,
|
|
1628
1662
|
query: { ...query ?? {} },
|
|
1629
1663
|
signal: options?.signal
|
|
1630
1664
|
});
|
|
@@ -1633,7 +1667,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1633
1667
|
listCaseParticipants(torrowId, query, options) {
|
|
1634
1668
|
return this.http.requestJson({
|
|
1635
1669
|
method: "GET",
|
|
1636
|
-
path: `${
|
|
1670
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants`,
|
|
1637
1671
|
query: { ...query ?? {} },
|
|
1638
1672
|
signal: options?.signal
|
|
1639
1673
|
});
|
|
@@ -1642,7 +1676,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1642
1676
|
getCaseParticipantById(torrowId, caseParticipantId, options) {
|
|
1643
1677
|
return this.http.requestJson({
|
|
1644
1678
|
method: "GET",
|
|
1645
|
-
path: `${
|
|
1679
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/${encodePathSegment(caseParticipantId)}`,
|
|
1646
1680
|
query: { securityToken: options?.securityToken },
|
|
1647
1681
|
signal: options?.signal
|
|
1648
1682
|
});
|
|
@@ -1651,7 +1685,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1651
1685
|
getCaseParticipantsCount(torrowId, query, options) {
|
|
1652
1686
|
return this.http.requestJson({
|
|
1653
1687
|
method: "GET",
|
|
1654
|
-
path: `${
|
|
1688
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/count`,
|
|
1655
1689
|
query: { ...query ?? {} },
|
|
1656
1690
|
signal: options?.signal
|
|
1657
1691
|
});
|
|
@@ -1660,7 +1694,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1660
1694
|
getCaseParticipantsNonAnonymousCount(torrowId, query, options) {
|
|
1661
1695
|
return this.http.requestJson({
|
|
1662
1696
|
method: "GET",
|
|
1663
|
-
path: `${
|
|
1697
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/nonanonymous`,
|
|
1664
1698
|
query: { ...query ?? {} },
|
|
1665
1699
|
signal: options?.signal
|
|
1666
1700
|
});
|
|
@@ -1669,7 +1703,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1669
1703
|
patchCaseParticipantFields(torrowId, caseParticipantId, body, options) {
|
|
1670
1704
|
return this.http.requestJson({
|
|
1671
1705
|
method: "PATCH",
|
|
1672
|
-
path: `${
|
|
1706
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/${encodePathSegment(caseParticipantId)}/fields`,
|
|
1673
1707
|
query: {
|
|
1674
1708
|
userMessage: options?.userMessage,
|
|
1675
1709
|
versionToCheck: options?.versionToCheck,
|
|
@@ -1683,7 +1717,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1683
1717
|
confirmCaseParticipantParticipation(torrowId, caseParticipantId, options) {
|
|
1684
1718
|
return this.http.requestJson({
|
|
1685
1719
|
method: "PATCH",
|
|
1686
|
-
path: `${
|
|
1720
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/${encodePathSegment(caseParticipantId)}/confirmparticipation`,
|
|
1687
1721
|
query: {
|
|
1688
1722
|
userMessage: options?.userMessage,
|
|
1689
1723
|
profileId: options?.profileId,
|
|
@@ -1698,7 +1732,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1698
1732
|
caseParticipationCheckIn(torrowId, body, options) {
|
|
1699
1733
|
return this.http.requestJson({
|
|
1700
1734
|
method: "PUT",
|
|
1701
|
-
path: `${
|
|
1735
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipation/checkin`,
|
|
1702
1736
|
body,
|
|
1703
1737
|
signal: options?.signal
|
|
1704
1738
|
});
|
|
@@ -1707,7 +1741,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1707
1741
|
bookResourcesForMe(torrowId, body, options) {
|
|
1708
1742
|
return this.http.requestJson({
|
|
1709
1743
|
method: "PUT",
|
|
1710
|
-
path: `${
|
|
1744
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipation/bookresourcesforme`,
|
|
1711
1745
|
query: { profileId: options?.profileId },
|
|
1712
1746
|
body,
|
|
1713
1747
|
signal: options?.signal
|
|
@@ -1717,7 +1751,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1717
1751
|
bookResourcesForOthers(torrowId, body, options) {
|
|
1718
1752
|
return this.http.requestJson({
|
|
1719
1753
|
method: "PUT",
|
|
1720
|
-
path: `${
|
|
1754
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipation/bookresourcesforother`,
|
|
1721
1755
|
body,
|
|
1722
1756
|
signal: options?.signal
|
|
1723
1757
|
});
|
|
@@ -1726,7 +1760,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1726
1760
|
approveMoneyReceive(torrowId, body, options) {
|
|
1727
1761
|
return this.http.requestJson({
|
|
1728
1762
|
method: "PUT",
|
|
1729
|
-
path: `${
|
|
1763
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/approvemoneyreceive`,
|
|
1730
1764
|
body,
|
|
1731
1765
|
signal: options?.signal
|
|
1732
1766
|
});
|
|
@@ -1735,7 +1769,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1735
1769
|
rejectMoneyReceive(torrowId, body, options) {
|
|
1736
1770
|
return this.http.requestJson({
|
|
1737
1771
|
method: "PUT",
|
|
1738
|
-
path: `${
|
|
1772
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipants/rejectmoneyreceive`,
|
|
1739
1773
|
body,
|
|
1740
1774
|
signal: options?.signal
|
|
1741
1775
|
});
|
|
@@ -1744,25 +1778,20 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1744
1778
|
approveCaseParticipation(torrowId, body, options) {
|
|
1745
1779
|
return this.http.requestJson({
|
|
1746
1780
|
method: "PUT",
|
|
1747
|
-
path: `${
|
|
1781
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/caseparticipation/approvecaseparticipation`,
|
|
1748
1782
|
body,
|
|
1749
1783
|
signal: options?.signal
|
|
1750
1784
|
});
|
|
1751
1785
|
}
|
|
1752
1786
|
/** `PUT /api/v1/cases/{torrowId}/caseparticipation/cancelcaseparticipation` */
|
|
1753
1787
|
cancelCaseParticipation(torrowId, body, options) {
|
|
1754
|
-
return this.http
|
|
1755
|
-
method: "PUT",
|
|
1756
|
-
path: `${BASE2}/${encodePathSegment(torrowId)}/caseparticipation/cancelcaseparticipation`,
|
|
1757
|
-
body,
|
|
1758
|
-
signal: options?.signal
|
|
1759
|
-
});
|
|
1788
|
+
return cancelCaseParticipation(this.http, torrowId, body, options);
|
|
1760
1789
|
}
|
|
1761
1790
|
/** `POST /api/v1/cases/{torrowId}/reject` */
|
|
1762
1791
|
rejectCase(torrowId, options) {
|
|
1763
1792
|
return this.http.requestJson({
|
|
1764
1793
|
method: "POST",
|
|
1765
|
-
path: `${
|
|
1794
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/reject`,
|
|
1766
1795
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1767
1796
|
signal: options?.signal
|
|
1768
1797
|
});
|
|
@@ -1771,7 +1800,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1771
1800
|
declineWork(torrowId, options) {
|
|
1772
1801
|
return this.http.requestJson({
|
|
1773
1802
|
method: "POST",
|
|
1774
|
-
path: `${
|
|
1803
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/declinework`,
|
|
1775
1804
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1776
1805
|
signal: options?.signal
|
|
1777
1806
|
});
|
|
@@ -1780,7 +1809,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1780
1809
|
planCase(torrowId, options) {
|
|
1781
1810
|
return this.http.requestJson({
|
|
1782
1811
|
method: "POST",
|
|
1783
|
-
path: `${
|
|
1812
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/plan`,
|
|
1784
1813
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1785
1814
|
signal: options?.signal
|
|
1786
1815
|
});
|
|
@@ -1789,7 +1818,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1789
1818
|
takeInWork(torrowId, options) {
|
|
1790
1819
|
return this.http.requestJson({
|
|
1791
1820
|
method: "POST",
|
|
1792
|
-
path: `${
|
|
1821
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/takeinwork`,
|
|
1793
1822
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1794
1823
|
signal: options?.signal
|
|
1795
1824
|
});
|
|
@@ -1798,7 +1827,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1798
1827
|
completeCase(torrowId, options) {
|
|
1799
1828
|
return this.http.requestJson({
|
|
1800
1829
|
method: "POST",
|
|
1801
|
-
path: `${
|
|
1830
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/complete`,
|
|
1802
1831
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1803
1832
|
signal: options?.signal
|
|
1804
1833
|
});
|
|
@@ -1807,7 +1836,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1807
1836
|
acceptCase(torrowId, options) {
|
|
1808
1837
|
return this.http.requestJson({
|
|
1809
1838
|
method: "POST",
|
|
1810
|
-
path: `${
|
|
1839
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/accept`,
|
|
1811
1840
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1812
1841
|
signal: options?.signal
|
|
1813
1842
|
});
|
|
@@ -1816,7 +1845,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1816
1845
|
returnToVerification(torrowId, options) {
|
|
1817
1846
|
return this.http.requestJson({
|
|
1818
1847
|
method: "POST",
|
|
1819
|
-
path: `${
|
|
1848
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/returntoverification`,
|
|
1820
1849
|
query: { profileId: options?.profileId, userMessage: options?.userMessage },
|
|
1821
1850
|
signal: options?.signal
|
|
1822
1851
|
});
|
|
@@ -1825,7 +1854,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1825
1854
|
cancelCase(torrowId, options) {
|
|
1826
1855
|
return this.http.requestJson({
|
|
1827
1856
|
method: "POST",
|
|
1828
|
-
path: `${
|
|
1857
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/cancel`,
|
|
1829
1858
|
query: {
|
|
1830
1859
|
profileId: options?.profileId,
|
|
1831
1860
|
userMessage: options?.userMessage,
|
|
@@ -1838,7 +1867,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
1838
1867
|
patchCase(torrowId, body, options) {
|
|
1839
1868
|
return this.http.requestJson({
|
|
1840
1869
|
method: "POST",
|
|
1841
|
-
path: `${
|
|
1870
|
+
path: `${BASE3}/${encodePathSegment(torrowId)}/patch`,
|
|
1842
1871
|
body,
|
|
1843
1872
|
signal: options?.signal
|
|
1844
1873
|
});
|
|
@@ -1951,7 +1980,7 @@ function normalizeContactVisitCardFieldsForWrite(body) {
|
|
|
1951
1980
|
}
|
|
1952
1981
|
|
|
1953
1982
|
// ../../src/resources/contacts/ContactsFacade.ts
|
|
1954
|
-
var
|
|
1983
|
+
var BASE4 = "/api/v1/contacts";
|
|
1955
1984
|
var CONTACT_SOCIAL_OPTS = {
|
|
1956
1985
|
imagePutUrlSecurityToken: true,
|
|
1957
1986
|
withPhotoEndpoints: true
|
|
@@ -1959,7 +1988,7 @@ var CONTACT_SOCIAL_OPTS = {
|
|
|
1959
1988
|
var ContactsFacade = class extends TorrowItemFacade {
|
|
1960
1989
|
itemObjectTypeCode = TorrowObjectTypeCode.Contact;
|
|
1961
1990
|
constructor(http) {
|
|
1962
|
-
super(http,
|
|
1991
|
+
super(http, BASE4, CONTACT_SOCIAL_OPTS);
|
|
1963
1992
|
}
|
|
1964
1993
|
/** Id контакта до `create` / presigned upload. */
|
|
1965
1994
|
generateContactId(ownerTorrowId) {
|
|
@@ -1970,7 +1999,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
1970
1999
|
const payload = this.withCreateDefaults(body);
|
|
1971
2000
|
return this.http.requestJson({
|
|
1972
2001
|
method: "POST",
|
|
1973
|
-
path:
|
|
2002
|
+
path: BASE4,
|
|
1974
2003
|
query: {
|
|
1975
2004
|
parentId: options?.parentId,
|
|
1976
2005
|
profileId: options?.profileId
|
|
@@ -1986,15 +2015,16 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
1986
2015
|
normalizeContactVisitCardFieldsForWrite(payload);
|
|
1987
2016
|
return payload;
|
|
1988
2017
|
}
|
|
1989
|
-
/** `PUT /api/v1/contacts/{
|
|
1990
|
-
update(body,
|
|
2018
|
+
/** `PUT /api/v1/contacts/{body.id}` */
|
|
2019
|
+
update(body, options) {
|
|
2020
|
+
const itemId = requireItemUpdateId(body, "Contact");
|
|
1991
2021
|
const payload = { ...body };
|
|
1992
2022
|
normalizeContactStructuredArrayRidsForWrite(payload);
|
|
1993
2023
|
normalizeContactCommunicationsForWrite(payload);
|
|
1994
2024
|
normalizeContactVisitCardFieldsForWrite(payload);
|
|
1995
2025
|
return this.http.requestJson({
|
|
1996
2026
|
method: "PUT",
|
|
1997
|
-
path: `${
|
|
2027
|
+
path: `${BASE4}/${encodePathSegment(itemId)}`,
|
|
1998
2028
|
query: {
|
|
1999
2029
|
checkVersion: options?.checkVersion,
|
|
2000
2030
|
isNeedAnnouncement: options?.isNeedAnnouncement,
|
|
@@ -2008,7 +2038,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2008
2038
|
getById(torrowId, options) {
|
|
2009
2039
|
return this.http.requestJson({
|
|
2010
2040
|
method: "GET",
|
|
2011
|
-
path: `${
|
|
2041
|
+
path: `${BASE4}/${encodePathSegment(torrowId)}`,
|
|
2012
2042
|
query: {
|
|
2013
2043
|
versionToCheck: options?.versionToCheck,
|
|
2014
2044
|
includeDeleted: options?.includeDeleted,
|
|
@@ -2025,7 +2055,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2025
2055
|
async delete(torrowId, options) {
|
|
2026
2056
|
const resp = await this.http.requestJson({
|
|
2027
2057
|
method: "DELETE",
|
|
2028
|
-
path: `${
|
|
2058
|
+
path: `${BASE4}/${encodePathSegment(torrowId)}`,
|
|
2029
2059
|
query: {
|
|
2030
2060
|
cascade: options.cascade,
|
|
2031
2061
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -2041,7 +2071,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2041
2071
|
const { signal, securityToken, ...rest } = options ?? {};
|
|
2042
2072
|
return this.http.requestJson({
|
|
2043
2073
|
method: "GET",
|
|
2044
|
-
path: `${
|
|
2074
|
+
path: `${BASE4}/personallist`,
|
|
2045
2075
|
query: { ...rest, securityToken },
|
|
2046
2076
|
signal
|
|
2047
2077
|
});
|
|
@@ -2051,7 +2081,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2051
2081
|
const { signal, ...queryOpts } = options ?? {};
|
|
2052
2082
|
return this.http.requestJson({
|
|
2053
2083
|
method: "PUT",
|
|
2054
|
-
path: `${
|
|
2084
|
+
path: `${BASE4}/${encodePathSegment(contactId)}/timetable`,
|
|
2055
2085
|
query: buildTimetableQuery(queryOpts),
|
|
2056
2086
|
body,
|
|
2057
2087
|
signal
|
|
@@ -2061,7 +2091,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2061
2091
|
async getTimetableStatistics(body, options) {
|
|
2062
2092
|
const resp = await this.http.requestJson({
|
|
2063
2093
|
method: "POST",
|
|
2064
|
-
path: `${
|
|
2094
|
+
path: `${BASE4}/timetable/statistics`,
|
|
2065
2095
|
body,
|
|
2066
2096
|
signal: options?.signal
|
|
2067
2097
|
});
|
|
@@ -2071,7 +2101,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2071
2101
|
async sendCommunicationCode(body, options) {
|
|
2072
2102
|
const resp = await this.http.requestJson({
|
|
2073
2103
|
method: "POST",
|
|
2074
|
-
path: `${
|
|
2104
|
+
path: `${BASE4}/communication/sendcode`,
|
|
2075
2105
|
body,
|
|
2076
2106
|
signal: options?.signal
|
|
2077
2107
|
});
|
|
@@ -2081,7 +2111,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2081
2111
|
verifyCommunicationCode(body, options) {
|
|
2082
2112
|
return this.http.requestJson({
|
|
2083
2113
|
method: "POST",
|
|
2084
|
-
path: `${
|
|
2114
|
+
path: `${BASE4}/communication/verify`,
|
|
2085
2115
|
body,
|
|
2086
2116
|
signal: options?.signal
|
|
2087
2117
|
});
|
|
@@ -2090,7 +2120,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2090
2120
|
invite(torrowId, body, options) {
|
|
2091
2121
|
return this.http.requestJson({
|
|
2092
2122
|
method: "POST",
|
|
2093
|
-
path: `${
|
|
2123
|
+
path: `${BASE4}/${encodePathSegment(torrowId)}/invite`,
|
|
2094
2124
|
query: { communicationId: options?.communicationId },
|
|
2095
2125
|
body,
|
|
2096
2126
|
signal: options?.signal
|
|
@@ -2100,7 +2130,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2100
2130
|
listActivityStatuses(itemIds, options) {
|
|
2101
2131
|
return this.http.requestJson({
|
|
2102
2132
|
method: "POST",
|
|
2103
|
-
path: `${
|
|
2133
|
+
path: `${BASE4}/activitystatuslist`,
|
|
2104
2134
|
body: itemIds,
|
|
2105
2135
|
signal: options?.signal
|
|
2106
2136
|
});
|
|
@@ -2109,7 +2139,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2109
2139
|
async updateContactProperties(contactId, body, options) {
|
|
2110
2140
|
const resp = await this.http.requestJson({
|
|
2111
2141
|
method: "PUT",
|
|
2112
|
-
path: `${
|
|
2142
|
+
path: `${BASE4}/${encodePathSegment(contactId)}/contactproperties`,
|
|
2113
2143
|
body,
|
|
2114
2144
|
signal: options?.signal
|
|
2115
2145
|
});
|
|
@@ -2118,11 +2148,11 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
2118
2148
|
};
|
|
2119
2149
|
|
|
2120
2150
|
// ../../src/resources/contexts/ContextsFacade.ts
|
|
2121
|
-
var
|
|
2151
|
+
var BASE5 = "/api/v1/contexts";
|
|
2122
2152
|
var ContextsFacade = class extends TorrowItemFacade {
|
|
2123
2153
|
itemObjectTypeCode = TorrowObjectTypeCode.Context;
|
|
2124
2154
|
constructor(http) {
|
|
2125
|
-
super(http,
|
|
2155
|
+
super(http, BASE5, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
2126
2156
|
}
|
|
2127
2157
|
/** Id контекста до `create` / presigned upload. */
|
|
2128
2158
|
generateContextId(ownerTorrowId) {
|
|
@@ -2133,17 +2163,18 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
2133
2163
|
const payload = applyItemCreateDefaults(body, "ContextItem" /* ContextItem */);
|
|
2134
2164
|
return this.http.requestJson({
|
|
2135
2165
|
method: "POST",
|
|
2136
|
-
path:
|
|
2166
|
+
path: BASE5,
|
|
2137
2167
|
query: { profileId: options?.profileId },
|
|
2138
2168
|
body: payload,
|
|
2139
2169
|
signal: options?.signal
|
|
2140
2170
|
});
|
|
2141
2171
|
}
|
|
2142
|
-
/** `PUT /api/v1/contexts/{
|
|
2143
|
-
update(body,
|
|
2172
|
+
/** `PUT /api/v1/contexts/{body.id}` */
|
|
2173
|
+
update(body, options) {
|
|
2174
|
+
const itemId = requireItemUpdateId(body, "Context");
|
|
2144
2175
|
return this.http.requestJson({
|
|
2145
2176
|
method: "PUT",
|
|
2146
|
-
path: `${
|
|
2177
|
+
path: `${BASE5}/${encodePathSegment(itemId)}`,
|
|
2147
2178
|
query: {
|
|
2148
2179
|
checkVersion: options?.checkVersion,
|
|
2149
2180
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -2156,7 +2187,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
2156
2187
|
async delete(torrowId, options) {
|
|
2157
2188
|
const resp = await this.http.requestJson({
|
|
2158
2189
|
method: "DELETE",
|
|
2159
|
-
path: `${
|
|
2190
|
+
path: `${BASE5}/${encodePathSegment(torrowId)}`,
|
|
2160
2191
|
query: {
|
|
2161
2192
|
cascade: options.cascade,
|
|
2162
2193
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -2171,7 +2202,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
2171
2202
|
getById(torrowId, options) {
|
|
2172
2203
|
return this.http.requestJson({
|
|
2173
2204
|
method: "GET",
|
|
2174
|
-
path: `${
|
|
2205
|
+
path: `${BASE5}/${encodePathSegment(torrowId)}`,
|
|
2175
2206
|
query: {
|
|
2176
2207
|
versionToCheck: options?.versionToCheck,
|
|
2177
2208
|
includeDeleted: options?.includeDeleted,
|
|
@@ -2186,7 +2217,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
2186
2217
|
const { signal, ...rest } = options ?? {};
|
|
2187
2218
|
return this.http.requestJson({
|
|
2188
2219
|
method: "GET",
|
|
2189
|
-
path: `${
|
|
2220
|
+
path: `${BASE5}/personallist`,
|
|
2190
2221
|
query: { ...rest },
|
|
2191
2222
|
signal
|
|
2192
2223
|
});
|
|
@@ -2218,12 +2249,12 @@ var ImagePreviewSizeValues = {
|
|
|
2218
2249
|
};
|
|
2219
2250
|
|
|
2220
2251
|
// ../../src/resources/notes/NotesFacade.ts
|
|
2221
|
-
var
|
|
2252
|
+
var BASE6 = "/api/v1/notes";
|
|
2222
2253
|
var DEFAULT_NOTE_NAME = "Untitled note";
|
|
2223
2254
|
var NotesFacade = class extends TorrowItemFacade {
|
|
2224
2255
|
itemObjectTypeCode = TorrowObjectTypeCode.Note;
|
|
2225
2256
|
constructor(http) {
|
|
2226
|
-
super(http,
|
|
2257
|
+
super(http, BASE6, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
2227
2258
|
}
|
|
2228
2259
|
/** Id заметки до `create` / presigned upload (`ownerTorrowId` — profileId и т.п.). */
|
|
2229
2260
|
generateNoteId(ownerTorrowId) {
|
|
@@ -2234,7 +2265,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2234
2265
|
const payload = this.withCreateDefaults(body);
|
|
2235
2266
|
return this.http.requestJson({
|
|
2236
2267
|
method: "POST",
|
|
2237
|
-
path:
|
|
2268
|
+
path: BASE6,
|
|
2238
2269
|
query: {
|
|
2239
2270
|
parentId: options?.parentId,
|
|
2240
2271
|
profileId: options?.profileId
|
|
@@ -2243,11 +2274,12 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2243
2274
|
signal: options?.signal
|
|
2244
2275
|
});
|
|
2245
2276
|
}
|
|
2246
|
-
/** `PUT /api/v1/notes/{
|
|
2247
|
-
update(body,
|
|
2277
|
+
/** `PUT /api/v1/notes/{body.id}` */
|
|
2278
|
+
update(body, options) {
|
|
2279
|
+
const itemId = requireItemUpdateId(body, "Note");
|
|
2248
2280
|
return this.http.requestJson({
|
|
2249
2281
|
method: "PUT",
|
|
2250
|
-
path: `${
|
|
2282
|
+
path: `${BASE6}/${encodePathSegment(itemId)}`,
|
|
2251
2283
|
query: {
|
|
2252
2284
|
checkVersion: options?.checkVersion,
|
|
2253
2285
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -2264,7 +2296,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2264
2296
|
async delete(torrowId, options) {
|
|
2265
2297
|
const resp = await this.http.requestJson({
|
|
2266
2298
|
method: "DELETE",
|
|
2267
|
-
path: `${
|
|
2299
|
+
path: `${BASE6}/${encodePathSegment(torrowId)}`,
|
|
2268
2300
|
query: {
|
|
2269
2301
|
cascade: options.cascade,
|
|
2270
2302
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -2279,7 +2311,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2279
2311
|
getById(torrowId, options) {
|
|
2280
2312
|
return this.http.requestJson({
|
|
2281
2313
|
method: "GET",
|
|
2282
|
-
path: `${
|
|
2314
|
+
path: `${BASE6}/${encodePathSegment(torrowId)}`,
|
|
2283
2315
|
query: {
|
|
2284
2316
|
versionToCheck: options?.versionToCheck,
|
|
2285
2317
|
includeDeleted: options?.includeDeleted,
|
|
@@ -2294,7 +2326,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2294
2326
|
const { signal, ...rest } = options ?? {};
|
|
2295
2327
|
return this.http.requestJson({
|
|
2296
2328
|
method: "GET",
|
|
2297
|
-
path: `${
|
|
2329
|
+
path: `${BASE6}/personallist`,
|
|
2298
2330
|
query: { ...rest },
|
|
2299
2331
|
signal
|
|
2300
2332
|
});
|
|
@@ -2303,7 +2335,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2303
2335
|
getFileInfo(torrowId, fileId, options) {
|
|
2304
2336
|
return this.http.requestJson({
|
|
2305
2337
|
method: "GET",
|
|
2306
|
-
path: `${
|
|
2338
|
+
path: `${BASE6}/${encodePathSegment(torrowId)}/file/info`,
|
|
2307
2339
|
query: { fileId },
|
|
2308
2340
|
signal: options?.signal
|
|
2309
2341
|
});
|
|
@@ -2312,7 +2344,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
2312
2344
|
async getFilePutUrl(torrowId, fileId, fileName, fileSize, options) {
|
|
2313
2345
|
const resp = await this.http.requestJson({
|
|
2314
2346
|
method: "GET",
|
|
2315
|
-
path: `${
|
|
2347
|
+
path: `${BASE6}/${encodePathSegment(torrowId)}/file/puturl`,
|
|
2316
2348
|
query: {
|
|
2317
2349
|
fileId,
|
|
2318
2350
|
fileName,
|
|
@@ -2838,13 +2870,18 @@ var UsageTypeValues = {
|
|
|
2838
2870
|
Payment: "Payment",
|
|
2839
2871
|
Ticket: "Ticket"
|
|
2840
2872
|
};
|
|
2873
|
+
var UsageConditionTypeValues = {
|
|
2874
|
+
None: "None",
|
|
2875
|
+
Exclusion: "Exclusion",
|
|
2876
|
+
Additional: "Additional"
|
|
2877
|
+
};
|
|
2841
2878
|
|
|
2842
2879
|
// ../../src/resources/resources/ResourcesFacade.ts
|
|
2843
|
-
var
|
|
2880
|
+
var BASE7 = "/api/v1/resources";
|
|
2844
2881
|
var ResourcesFacade = class extends TorrowItemFacade {
|
|
2845
2882
|
itemObjectTypeCode = TorrowObjectTypeCode.Resource;
|
|
2846
2883
|
constructor(http) {
|
|
2847
|
-
super(http,
|
|
2884
|
+
super(http, BASE7, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
2848
2885
|
}
|
|
2849
2886
|
/** Id ресурса до `create` / presigned upload. */
|
|
2850
2887
|
generateResourceId(ownerTorrowId) {
|
|
@@ -2870,7 +2907,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2870
2907
|
const payload = this.withCreateDefaults(body);
|
|
2871
2908
|
return this.http.requestJson({
|
|
2872
2909
|
method: "POST",
|
|
2873
|
-
path:
|
|
2910
|
+
path: BASE7,
|
|
2874
2911
|
query: {
|
|
2875
2912
|
parentId: options?.parentId,
|
|
2876
2913
|
profileId: options?.profileId
|
|
@@ -2879,11 +2916,12 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2879
2916
|
signal: options?.signal
|
|
2880
2917
|
}).then((item) => this.toSdkResourceItem(item));
|
|
2881
2918
|
}
|
|
2882
|
-
/** `PUT /api/v1/resources/{
|
|
2883
|
-
update(body,
|
|
2919
|
+
/** `PUT /api/v1/resources/{body.id}`. Требует непустой `id` в теле ресурса. */
|
|
2920
|
+
update(body, options) {
|
|
2921
|
+
const resourceId = requireItemUpdateId(body, "Resource");
|
|
2884
2922
|
return this.http.requestJson({
|
|
2885
2923
|
method: "PUT",
|
|
2886
|
-
path: `${
|
|
2924
|
+
path: `${BASE7}/${encodePathSegment(resourceId)}`,
|
|
2887
2925
|
query: {
|
|
2888
2926
|
profileId: options?.profileId,
|
|
2889
2927
|
checkVersion: options?.checkVersion,
|
|
@@ -2904,7 +2942,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2904
2942
|
async delete(torrowId, options) {
|
|
2905
2943
|
const resp = await this.http.requestJson({
|
|
2906
2944
|
method: "DELETE",
|
|
2907
|
-
path: `${
|
|
2945
|
+
path: `${BASE7}/${encodePathSegment(torrowId)}`,
|
|
2908
2946
|
query: {
|
|
2909
2947
|
cascade: options.cascade,
|
|
2910
2948
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -2919,7 +2957,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2919
2957
|
getById(torrowId, options) {
|
|
2920
2958
|
return this.http.requestJson({
|
|
2921
2959
|
method: "GET",
|
|
2922
|
-
path: `${
|
|
2960
|
+
path: `${BASE7}/${encodePathSegment(torrowId)}`,
|
|
2923
2961
|
query: {
|
|
2924
2962
|
versionToCheck: options?.versionToCheck,
|
|
2925
2963
|
includeDeleted: options?.includeDeleted,
|
|
@@ -2978,7 +3016,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2978
3016
|
const { signal, ...rest } = options ?? {};
|
|
2979
3017
|
return this.http.requestJson({
|
|
2980
3018
|
method: "GET",
|
|
2981
|
-
path: `${
|
|
3019
|
+
path: `${BASE7}/personallist`,
|
|
2982
3020
|
query: { ...rest },
|
|
2983
3021
|
signal
|
|
2984
3022
|
}).then((items) => items.map((item) => this.toSdkResourceItem(item)));
|
|
@@ -2990,7 +3028,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
2990
3028
|
const { signal, ...queryOpts } = options ?? {};
|
|
2991
3029
|
return this.http.requestJson({
|
|
2992
3030
|
method: "PUT",
|
|
2993
|
-
path: `${
|
|
3031
|
+
path: `${BASE7}/${encodePathSegment(resourceId)}/timetable`,
|
|
2994
3032
|
query: buildTimetableQuery(queryOpts),
|
|
2995
3033
|
body,
|
|
2996
3034
|
signal
|
|
@@ -3003,7 +3041,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
3003
3041
|
const { signal, from, to, serviceId } = options;
|
|
3004
3042
|
return this.http.requestJson({
|
|
3005
3043
|
method: "GET",
|
|
3006
|
-
path: `${
|
|
3044
|
+
path: `${BASE7}/${encodePathSegment(resourceId)}/workload`,
|
|
3007
3045
|
query: {
|
|
3008
3046
|
From: from,
|
|
3009
3047
|
To: to,
|
|
@@ -3016,7 +3054,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
3016
3054
|
pickOrder(resourceId, body, options) {
|
|
3017
3055
|
return this.http.requestJson({
|
|
3018
3056
|
method: "POST",
|
|
3019
|
-
path: `${
|
|
3057
|
+
path: `${BASE7}/${encodePathSegment(resourceId)}/pickorder`,
|
|
3020
3058
|
body,
|
|
3021
3059
|
signal: options?.signal
|
|
3022
3060
|
});
|
|
@@ -3025,7 +3063,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
3025
3063
|
returnOrder(resourceId, body, options) {
|
|
3026
3064
|
return this.http.requestJson({
|
|
3027
3065
|
method: "POST",
|
|
3028
|
-
path: `${
|
|
3066
|
+
path: `${BASE7}/${encodePathSegment(resourceId)}/returnorder`,
|
|
3029
3067
|
body,
|
|
3030
3068
|
signal: options?.signal
|
|
3031
3069
|
});
|
|
@@ -3034,7 +3072,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
3034
3072
|
async getTimetableStatistics(body, options) {
|
|
3035
3073
|
const resp = await this.http.requestJson({
|
|
3036
3074
|
method: "POST",
|
|
3037
|
-
path: `${
|
|
3075
|
+
path: `${BASE7}/timetable/statistics`,
|
|
3038
3076
|
body,
|
|
3039
3077
|
signal: options?.signal
|
|
3040
3078
|
});
|
|
@@ -3042,23 +3080,65 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
3042
3080
|
}
|
|
3043
3081
|
};
|
|
3044
3082
|
|
|
3083
|
+
// ../../src/resources/services/service-requests.ts
|
|
3084
|
+
var BASE8 = "/api/v1/services";
|
|
3085
|
+
function toSdkServiceItem(service) {
|
|
3086
|
+
return {
|
|
3087
|
+
...service,
|
|
3088
|
+
behaviorSettings: parseServiceImplicitTagParams(service.tags)
|
|
3089
|
+
};
|
|
3090
|
+
}
|
|
3091
|
+
async function getService(http, torrowId, options) {
|
|
3092
|
+
const item = await http.requestJson({
|
|
3093
|
+
method: "GET",
|
|
3094
|
+
path: `${BASE8}/${encodePathSegment(torrowId)}`,
|
|
3095
|
+
query: {
|
|
3096
|
+
profileId: options?.profileId,
|
|
3097
|
+
versionToCheck: options?.versionToCheck,
|
|
3098
|
+
includeDeleted: options?.includeDeleted,
|
|
3099
|
+
includeChildTypes: options?.includeChildTypes,
|
|
3100
|
+
securityToken: options?.securityToken
|
|
3101
|
+
},
|
|
3102
|
+
signal: options?.signal
|
|
3103
|
+
});
|
|
3104
|
+
return toSdkServiceItem(item);
|
|
3105
|
+
}
|
|
3106
|
+
function getServiceResources(http, serviceId, body, options) {
|
|
3107
|
+
return http.requestJson({
|
|
3108
|
+
method: "POST",
|
|
3109
|
+
path: `${BASE8}/${encodePathSegment(serviceId)}/resources`,
|
|
3110
|
+
body,
|
|
3111
|
+
signal: options?.signal
|
|
3112
|
+
});
|
|
3113
|
+
}
|
|
3114
|
+
function getCheckInSchedule(http, serviceId, body, options) {
|
|
3115
|
+
return http.requestJson({
|
|
3116
|
+
method: "POST",
|
|
3117
|
+
path: `${BASE8}/${encodePathSegment(serviceId)}/checkinschedule`,
|
|
3118
|
+
body,
|
|
3119
|
+
signal: options?.signal
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
function createOrder(http, serviceId, body, options) {
|
|
3123
|
+
return http.requestJson({
|
|
3124
|
+
method: "POST",
|
|
3125
|
+
path: `${BASE8}/${encodePathSegment(serviceId)}/order`,
|
|
3126
|
+
body,
|
|
3127
|
+
signal: options?.signal
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3045
3131
|
// ../../src/resources/services/ServicesFacade.ts
|
|
3046
|
-
var
|
|
3132
|
+
var BASE9 = "/api/v1/services";
|
|
3047
3133
|
var ServicesFacade = class extends TorrowItemFacade {
|
|
3048
3134
|
itemObjectTypeCode = TorrowObjectTypeCode.Service;
|
|
3049
3135
|
constructor(http) {
|
|
3050
|
-
super(http,
|
|
3136
|
+
super(http, BASE9, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
3051
3137
|
}
|
|
3052
3138
|
/** Id услуги до `create` / presigned upload. */
|
|
3053
3139
|
generateServiceId(ownerTorrowId) {
|
|
3054
3140
|
return this.generateItemId(ownerTorrowId);
|
|
3055
3141
|
}
|
|
3056
|
-
toSdkServiceItem(service) {
|
|
3057
|
-
return {
|
|
3058
|
-
...service,
|
|
3059
|
-
behaviorSettings: parseServiceImplicitTagParams(service.tags)
|
|
3060
|
-
};
|
|
3061
|
-
}
|
|
3062
3142
|
toApiServiceItem(service) {
|
|
3063
3143
|
const { behaviorSettings, ...rest } = service;
|
|
3064
3144
|
const apiBase = rest;
|
|
@@ -3073,20 +3153,21 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3073
3153
|
const payload = applyItemCreateDefaults(body, "ServiceItem" /* ServiceItem */);
|
|
3074
3154
|
return this.http.requestJson({
|
|
3075
3155
|
method: "POST",
|
|
3076
|
-
path:
|
|
3156
|
+
path: BASE9,
|
|
3077
3157
|
query: {
|
|
3078
3158
|
parentId: options?.parentId,
|
|
3079
3159
|
profileId: options?.profileId
|
|
3080
3160
|
},
|
|
3081
3161
|
body: this.toApiServiceItem(payload),
|
|
3082
3162
|
signal: options?.signal
|
|
3083
|
-
}).then((item) =>
|
|
3163
|
+
}).then((item) => toSdkServiceItem(item));
|
|
3084
3164
|
}
|
|
3085
|
-
/** `PUT /api/v1/services/{
|
|
3086
|
-
update(body,
|
|
3165
|
+
/** `PUT /api/v1/services/{body.id}` */
|
|
3166
|
+
update(body, options) {
|
|
3167
|
+
const itemId = requireItemUpdateId(body, "Service");
|
|
3087
3168
|
return this.http.requestJson({
|
|
3088
3169
|
method: "PUT",
|
|
3089
|
-
path: `${
|
|
3170
|
+
path: `${BASE9}/${encodePathSegment(itemId)}`,
|
|
3090
3171
|
query: {
|
|
3091
3172
|
profileId: options?.profileId,
|
|
3092
3173
|
checkVersion: options?.checkVersion,
|
|
@@ -3094,13 +3175,13 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3094
3175
|
},
|
|
3095
3176
|
body: this.toApiServiceItem(body),
|
|
3096
3177
|
signal: options?.signal
|
|
3097
|
-
}).then((item) =>
|
|
3178
|
+
}).then((item) => toSdkServiceItem(item));
|
|
3098
3179
|
}
|
|
3099
3180
|
/** `DELETE /api/v1/services/{torrowId}` */
|
|
3100
3181
|
async delete(torrowId, options) {
|
|
3101
3182
|
const resp = await this.http.requestJson({
|
|
3102
3183
|
method: "DELETE",
|
|
3103
|
-
path: `${
|
|
3184
|
+
path: `${BASE9}/${encodePathSegment(torrowId)}`,
|
|
3104
3185
|
query: {
|
|
3105
3186
|
cascade: options.cascade,
|
|
3106
3187
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -3113,18 +3194,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3113
3194
|
}
|
|
3114
3195
|
/** `GET /api/v1/services/{torrowId}` */
|
|
3115
3196
|
getById(torrowId, options) {
|
|
3116
|
-
return this.http
|
|
3117
|
-
method: "GET",
|
|
3118
|
-
path: `${BASE7}/${encodePathSegment(torrowId)}`,
|
|
3119
|
-
query: {
|
|
3120
|
-
profileId: options?.profileId,
|
|
3121
|
-
versionToCheck: options?.versionToCheck,
|
|
3122
|
-
includeDeleted: options?.includeDeleted,
|
|
3123
|
-
includeChildTypes: options?.includeChildTypes,
|
|
3124
|
-
securityToken: options?.securityToken
|
|
3125
|
-
},
|
|
3126
|
-
signal: options?.signal
|
|
3127
|
-
}).then((item) => this.toSdkServiceItem(item));
|
|
3197
|
+
return getService(this.http, torrowId, options);
|
|
3128
3198
|
}
|
|
3129
3199
|
/** Внутренний helper: получить типизированные настройки поведения услуги из `service.tags`. */
|
|
3130
3200
|
getBehaviorSettingsFromService(service) {
|
|
@@ -3184,22 +3254,17 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3184
3254
|
* Типичные отказы: нет слота, услуга недоступна по времени, подписка/баланс — разбирай тело `TorrowHttpError` (`name` / `code`); эталон UX — `torrow-apps` `CreateOrderTask`.
|
|
3185
3255
|
*/
|
|
3186
3256
|
createOrder(serviceId, body, options) {
|
|
3187
|
-
return this.http
|
|
3188
|
-
method: "POST",
|
|
3189
|
-
path: `${BASE7}/${encodePathSegment(serviceId)}/order`,
|
|
3190
|
-
body,
|
|
3191
|
-
signal: options?.signal
|
|
3192
|
-
});
|
|
3257
|
+
return createOrder(this.http, serviceId, body, options);
|
|
3193
3258
|
}
|
|
3194
3259
|
/**
|
|
3195
|
-
*
|
|
3196
|
-
*
|
|
3260
|
+
* События/заказы и занятость услуги — `PUT /api/v1/services/{serviceId}/timetable`.
|
|
3261
|
+
* Не вычисляет свободные слоты записи: для них используй `getCheckInSchedule` с `type: "FreeTimeSlots"`.
|
|
3197
3262
|
*/
|
|
3198
3263
|
getTimetable(serviceId, body, options) {
|
|
3199
3264
|
const { signal, ...queryOpts } = options ?? {};
|
|
3200
3265
|
return this.http.requestJson({
|
|
3201
3266
|
method: "PUT",
|
|
3202
|
-
path: `${
|
|
3267
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/timetable`,
|
|
3203
3268
|
query: buildTimetableQuery(queryOpts),
|
|
3204
3269
|
body,
|
|
3205
3270
|
signal
|
|
@@ -3212,7 +3277,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3212
3277
|
getWorkloadInfo(body, options) {
|
|
3213
3278
|
return this.http.requestJson({
|
|
3214
3279
|
method: "PUT",
|
|
3215
|
-
path: `${
|
|
3280
|
+
path: `${BASE9}/workloadinfo`,
|
|
3216
3281
|
body,
|
|
3217
3282
|
signal: options?.signal
|
|
3218
3283
|
});
|
|
@@ -3221,38 +3286,31 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3221
3286
|
async getTimetableStatistics(body, options) {
|
|
3222
3287
|
const resp = await this.http.requestJson({
|
|
3223
3288
|
method: "POST",
|
|
3224
|
-
path: `${
|
|
3289
|
+
path: `${BASE9}/timetable/statistics`,
|
|
3225
3290
|
body,
|
|
3226
3291
|
signal: options?.signal
|
|
3227
3292
|
});
|
|
3228
3293
|
return unwrapTimetableStatisticsList(resp);
|
|
3229
3294
|
}
|
|
3230
|
-
/**
|
|
3295
|
+
/**
|
|
3296
|
+
* Расчёт доступности записи — `POST /api/v1/services/{id}/checkinschedule`.
|
|
3297
|
+
* `type: "FreeTimeSlots"` возвращает выбираемые свободные слоты; `AsIs` — исходные периоды нагрузки.
|
|
3298
|
+
*/
|
|
3231
3299
|
getCheckInSchedule(serviceId, body, options) {
|
|
3232
|
-
return this.http
|
|
3233
|
-
method: "POST",
|
|
3234
|
-
path: `${BASE7}/${encodePathSegment(serviceId)}/checkinschedule`,
|
|
3235
|
-
body,
|
|
3236
|
-
signal: options?.signal
|
|
3237
|
-
});
|
|
3300
|
+
return getCheckInSchedule(this.http, serviceId, body, options);
|
|
3238
3301
|
}
|
|
3239
3302
|
/** Пересчёт расписания чекина — `PUT /api/v1/services/{id}/recheckinschedule`. */
|
|
3240
3303
|
getReCheckInSchedule(serviceId, body, options) {
|
|
3241
3304
|
return this.http.requestJson({
|
|
3242
3305
|
method: "PUT",
|
|
3243
|
-
path: `${
|
|
3306
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/recheckinschedule`,
|
|
3244
3307
|
body,
|
|
3245
3308
|
signal: options?.signal
|
|
3246
3309
|
});
|
|
3247
3310
|
}
|
|
3248
3311
|
/** Доступные ресурсы группы для шага «Ресурс» — `POST /api/v1/services/{serviceId}/resources`. */
|
|
3249
3312
|
getServiceResources(serviceId, body, options) {
|
|
3250
|
-
return this.http
|
|
3251
|
-
method: "POST",
|
|
3252
|
-
path: `${BASE7}/${encodePathSegment(serviceId)}/resources`,
|
|
3253
|
-
body,
|
|
3254
|
-
signal: options?.signal
|
|
3255
|
-
});
|
|
3313
|
+
return getServiceResources(this.http, serviceId, body, options);
|
|
3256
3314
|
}
|
|
3257
3315
|
/**
|
|
3258
3316
|
* Ресурсы с детализацией (в т.ч. гарантированные количества) — `POST .../resourceswithdetalization`.
|
|
@@ -3261,7 +3319,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3261
3319
|
getServiceResourcesWithDetalization(serviceId, body, options) {
|
|
3262
3320
|
return this.http.requestJson({
|
|
3263
3321
|
method: "POST",
|
|
3264
|
-
path: `${
|
|
3322
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/resourceswithdetalization`,
|
|
3265
3323
|
body,
|
|
3266
3324
|
signal: options?.signal
|
|
3267
3325
|
});
|
|
@@ -3271,16 +3329,16 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3271
3329
|
const { signal, ...rest } = options ?? {};
|
|
3272
3330
|
return this.http.requestJson({
|
|
3273
3331
|
method: "GET",
|
|
3274
|
-
path: `${
|
|
3332
|
+
path: `${BASE9}/personallist`,
|
|
3275
3333
|
query: { ...rest },
|
|
3276
3334
|
signal
|
|
3277
|
-
}).then((items) => items.map((item) =>
|
|
3335
|
+
}).then((items) => items.map((item) => toSdkServiceItem(item)));
|
|
3278
3336
|
}
|
|
3279
3337
|
/** `POST /api/v1/services/{serviceId}/session` — создать сессию записи (тело `CaseItem`). */
|
|
3280
3338
|
createSession(serviceId, body, options) {
|
|
3281
3339
|
return this.http.requestJson({
|
|
3282
3340
|
method: "POST",
|
|
3283
|
-
path: `${
|
|
3341
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/session`,
|
|
3284
3342
|
query: { profileId: options?.profileId },
|
|
3285
3343
|
body,
|
|
3286
3344
|
signal: options?.signal
|
|
@@ -3290,7 +3348,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3290
3348
|
refreshSession(serviceId, options) {
|
|
3291
3349
|
return this.http.requestJson({
|
|
3292
3350
|
method: "PUT",
|
|
3293
|
-
path: `${
|
|
3351
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/session`,
|
|
3294
3352
|
query: { caseId: options?.caseId, profileId: options?.profileId },
|
|
3295
3353
|
signal: options?.signal
|
|
3296
3354
|
});
|
|
@@ -3299,7 +3357,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3299
3357
|
patchUpdateOrder(serviceId, body, options) {
|
|
3300
3358
|
return this.http.requestJson({
|
|
3301
3359
|
method: "PATCH",
|
|
3302
|
-
path: `${
|
|
3360
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/updateorder`,
|
|
3303
3361
|
body,
|
|
3304
3362
|
signal: options?.signal
|
|
3305
3363
|
});
|
|
@@ -3308,7 +3366,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3308
3366
|
patchUpdateOrder2(serviceId, body, options) {
|
|
3309
3367
|
return this.http.requestJson({
|
|
3310
3368
|
method: "PATCH",
|
|
3311
|
-
path: `${
|
|
3369
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/updateorder2`,
|
|
3312
3370
|
body,
|
|
3313
3371
|
signal: options?.signal
|
|
3314
3372
|
});
|
|
@@ -3317,7 +3375,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3317
3375
|
changeOrderService(serviceId, body, options) {
|
|
3318
3376
|
return this.http.requestJson({
|
|
3319
3377
|
method: "PUT",
|
|
3320
|
-
path: `${
|
|
3378
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/changeorderservice`,
|
|
3321
3379
|
body,
|
|
3322
3380
|
signal: options?.signal
|
|
3323
3381
|
});
|
|
@@ -3326,21 +3384,30 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
3326
3384
|
patchUpdateOrderInfo(serviceId, body, options) {
|
|
3327
3385
|
return this.http.requestJson({
|
|
3328
3386
|
method: "PATCH",
|
|
3329
|
-
path: `${
|
|
3387
|
+
path: `${BASE9}/${encodePathSegment(serviceId)}/updateorderinfo`,
|
|
3330
3388
|
body,
|
|
3331
3389
|
signal: options?.signal
|
|
3332
3390
|
});
|
|
3333
3391
|
}
|
|
3334
3392
|
};
|
|
3335
3393
|
|
|
3394
|
+
// ../../src/util/base64.ts
|
|
3395
|
+
function utf8ToBase64(value) {
|
|
3396
|
+
const bytes = new TextEncoder().encode(value);
|
|
3397
|
+
let binary = "";
|
|
3398
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
3399
|
+
binary += String.fromCharCode(bytes[i]);
|
|
3400
|
+
}
|
|
3401
|
+
return btoa(binary);
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3336
3404
|
// ../../src/resources/auth/AuthFacade.ts
|
|
3337
|
-
|
|
3338
|
-
var BASE8 = "/api/v1/auth";
|
|
3405
|
+
var BASE10 = "/api/v1/auth";
|
|
3339
3406
|
function authFacadeDefaultHeaders(config) {
|
|
3340
3407
|
const merged = { ...config.defaultHeaders ?? {} };
|
|
3341
3408
|
const basic = config.authIdentityBasic;
|
|
3342
3409
|
if (basic?.username && basic.password !== void 0 && basic.password !== "") {
|
|
3343
|
-
merged.Authorization = `Basic ${
|
|
3410
|
+
merged.Authorization = `Basic ${utf8ToBase64(`${basic.username}:${basic.password}`)}`;
|
|
3344
3411
|
}
|
|
3345
3412
|
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
3346
3413
|
}
|
|
@@ -3358,7 +3425,7 @@ var AuthFacade = class {
|
|
|
3358
3425
|
refresh(body, options) {
|
|
3359
3426
|
return this.anonHttp.requestJson({
|
|
3360
3427
|
method: "POST",
|
|
3361
|
-
path: `${
|
|
3428
|
+
path: `${BASE10}/refresh`,
|
|
3362
3429
|
body,
|
|
3363
3430
|
signal: options?.signal
|
|
3364
3431
|
});
|
|
@@ -3367,7 +3434,7 @@ var AuthFacade = class {
|
|
|
3367
3434
|
requestToken(body, options) {
|
|
3368
3435
|
return this.anonHttp.requestJson({
|
|
3369
3436
|
method: "POST",
|
|
3370
|
-
path: `${
|
|
3437
|
+
path: `${BASE10}/token`,
|
|
3371
3438
|
body,
|
|
3372
3439
|
signal: options?.signal
|
|
3373
3440
|
});
|
|
@@ -3376,7 +3443,7 @@ var AuthFacade = class {
|
|
|
3376
3443
|
revoke(body, options) {
|
|
3377
3444
|
return this.anonHttp.requestJson({
|
|
3378
3445
|
method: "POST",
|
|
3379
|
-
path: `${
|
|
3446
|
+
path: `${BASE10}/revoke`,
|
|
3380
3447
|
body,
|
|
3381
3448
|
signal: options?.signal
|
|
3382
3449
|
});
|
|
@@ -3385,7 +3452,7 @@ var AuthFacade = class {
|
|
|
3385
3452
|
sendCode(body, options) {
|
|
3386
3453
|
return this.anonHttp.requestJson({
|
|
3387
3454
|
method: "POST",
|
|
3388
|
-
path: `${
|
|
3455
|
+
path: `${BASE10}/sendcode`,
|
|
3389
3456
|
body,
|
|
3390
3457
|
signal: options?.signal
|
|
3391
3458
|
});
|
|
@@ -3394,7 +3461,7 @@ var AuthFacade = class {
|
|
|
3394
3461
|
createSession(body, options) {
|
|
3395
3462
|
return this.anonHttp.requestJson({
|
|
3396
3463
|
method: "POST",
|
|
3397
|
-
path: `${
|
|
3464
|
+
path: `${BASE10}/session`,
|
|
3398
3465
|
body,
|
|
3399
3466
|
signal: options?.signal
|
|
3400
3467
|
});
|
|
@@ -3427,7 +3494,7 @@ function prepareUserProfileItemForAdd(body) {
|
|
|
3427
3494
|
}
|
|
3428
3495
|
|
|
3429
3496
|
// ../../src/resources/user-profiles/ProfilesFacade.ts
|
|
3430
|
-
var
|
|
3497
|
+
var BASE11 = "/api/v1/user/profiles";
|
|
3431
3498
|
var ProfilesFacade = class {
|
|
3432
3499
|
constructor(http) {
|
|
3433
3500
|
this.http = http;
|
|
@@ -3439,7 +3506,7 @@ var ProfilesFacade = class {
|
|
|
3439
3506
|
* @throws Если тело ответа не объект или **`profileList`** не массив при наличии поля.
|
|
3440
3507
|
*/
|
|
3441
3508
|
async list(options) {
|
|
3442
|
-
const resp = await this.http.requestJson({ method: "GET", path:
|
|
3509
|
+
const resp = await this.http.requestJson({ method: "GET", path: BASE11, signal: options?.signal });
|
|
3443
3510
|
if (resp === null || typeof resp !== "object") {
|
|
3444
3511
|
throw new Error("GET /api/v1/user/profiles: expected a JSON object body");
|
|
3445
3512
|
}
|
|
@@ -3459,7 +3526,7 @@ var ProfilesFacade = class {
|
|
|
3459
3526
|
const payload = prepareUserProfileItemForAdd(body);
|
|
3460
3527
|
const resp = await this.http.requestJson({
|
|
3461
3528
|
method: "POST",
|
|
3462
|
-
path:
|
|
3529
|
+
path: BASE11,
|
|
3463
3530
|
body: payload,
|
|
3464
3531
|
signal: options?.signal
|
|
3465
3532
|
});
|
|
@@ -3472,7 +3539,7 @@ var ProfilesFacade = class {
|
|
|
3472
3539
|
async addByContactId(contactId, options) {
|
|
3473
3540
|
const resp = await this.http.requestJson({
|
|
3474
3541
|
method: "PUT",
|
|
3475
|
-
path:
|
|
3542
|
+
path: BASE11,
|
|
3476
3543
|
body: contactId,
|
|
3477
3544
|
signal: options?.signal
|
|
3478
3545
|
});
|
|
@@ -3486,7 +3553,7 @@ var ProfilesFacade = class {
|
|
|
3486
3553
|
async updateProfileProperties(profileId, body, options) {
|
|
3487
3554
|
const resp = await this.http.requestJson({
|
|
3488
3555
|
method: "PUT",
|
|
3489
|
-
path: `${
|
|
3556
|
+
path: `${BASE11}/${encodePathSegment(profileId)}/profileproperties`,
|
|
3490
3557
|
body,
|
|
3491
3558
|
signal: options?.signal
|
|
3492
3559
|
});
|
|
@@ -3496,7 +3563,7 @@ var ProfilesFacade = class {
|
|
|
3496
3563
|
async remove(profileId, options) {
|
|
3497
3564
|
const resp = await this.http.requestJson({
|
|
3498
3565
|
method: "DELETE",
|
|
3499
|
-
path: `${
|
|
3566
|
+
path: `${BASE11}/${encodePathSegment(profileId)}`,
|
|
3500
3567
|
signal: options?.signal
|
|
3501
3568
|
});
|
|
3502
3569
|
return unwrapRemoveProfileList(resp);
|
|
@@ -3745,7 +3812,7 @@ var ViewsFacade = class {
|
|
|
3745
3812
|
};
|
|
3746
3813
|
|
|
3747
3814
|
// ../../src/resources/search/SearchFacade.ts
|
|
3748
|
-
var
|
|
3815
|
+
var BASE12 = "/api/v1/search";
|
|
3749
3816
|
var SearchFacade = class {
|
|
3750
3817
|
constructor(http) {
|
|
3751
3818
|
this.http = http;
|
|
@@ -3755,7 +3822,7 @@ var SearchFacade = class {
|
|
|
3755
3822
|
advisedItems(query, options) {
|
|
3756
3823
|
return this.http.requestJson({
|
|
3757
3824
|
method: "GET",
|
|
3758
|
-
path: `${
|
|
3825
|
+
path: `${BASE12}/adviseditems`,
|
|
3759
3826
|
query: { ...query ?? {} },
|
|
3760
3827
|
signal: options?.signal
|
|
3761
3828
|
});
|
|
@@ -3767,7 +3834,7 @@ var SearchFacade = class {
|
|
|
3767
3834
|
orders(torrowId, body, query, options) {
|
|
3768
3835
|
return this.http.requestJson({
|
|
3769
3836
|
method: "PUT",
|
|
3770
|
-
path: `${
|
|
3837
|
+
path: `${BASE12}/${encodePathSegment(torrowId)}/orders`,
|
|
3771
3838
|
query: { ...query ?? {} },
|
|
3772
3839
|
body,
|
|
3773
3840
|
signal: options?.signal
|
|
@@ -3785,7 +3852,7 @@ var SearchFacade = class {
|
|
|
3785
3852
|
contacts(query, options) {
|
|
3786
3853
|
return this.http.requestJson({
|
|
3787
3854
|
method: "GET",
|
|
3788
|
-
path: `${
|
|
3855
|
+
path: `${BASE12}/contacts`,
|
|
3789
3856
|
query: { ...query ?? {} },
|
|
3790
3857
|
signal: options?.signal
|
|
3791
3858
|
});
|
|
@@ -3800,7 +3867,7 @@ var SearchFacade = class {
|
|
|
3800
3867
|
notes(query, options) {
|
|
3801
3868
|
return this.http.requestJson({
|
|
3802
3869
|
method: "GET",
|
|
3803
|
-
path: `${
|
|
3870
|
+
path: `${BASE12}/notes`,
|
|
3804
3871
|
query: { ...query ?? {} },
|
|
3805
3872
|
signal: options?.signal
|
|
3806
3873
|
});
|
|
@@ -3815,7 +3882,7 @@ var SearchFacade = class {
|
|
|
3815
3882
|
calendars(query, options) {
|
|
3816
3883
|
return this.http.requestJson({
|
|
3817
3884
|
method: "GET",
|
|
3818
|
-
path: `${
|
|
3885
|
+
path: `${BASE12}/calendars`,
|
|
3819
3886
|
query: { ...query ?? {} },
|
|
3820
3887
|
signal: options?.signal
|
|
3821
3888
|
});
|
|
@@ -3830,7 +3897,7 @@ var SearchFacade = class {
|
|
|
3830
3897
|
cases(query, options) {
|
|
3831
3898
|
return this.http.requestJson({
|
|
3832
3899
|
method: "GET",
|
|
3833
|
-
path: `${
|
|
3900
|
+
path: `${BASE12}/cases`,
|
|
3834
3901
|
query: { ...query ?? {} },
|
|
3835
3902
|
signal: options?.signal
|
|
3836
3903
|
});
|
|
@@ -3845,7 +3912,7 @@ var SearchFacade = class {
|
|
|
3845
3912
|
resources(query, options) {
|
|
3846
3913
|
return this.http.requestJson({
|
|
3847
3914
|
method: "GET",
|
|
3848
|
-
path: `${
|
|
3915
|
+
path: `${BASE12}/resources`,
|
|
3849
3916
|
query: { ...query ?? {} },
|
|
3850
3917
|
signal: options?.signal
|
|
3851
3918
|
});
|
|
@@ -3860,7 +3927,7 @@ var SearchFacade = class {
|
|
|
3860
3927
|
services(query, options) {
|
|
3861
3928
|
return this.http.requestJson({
|
|
3862
3929
|
method: "GET",
|
|
3863
|
-
path: `${
|
|
3930
|
+
path: `${BASE12}/services`,
|
|
3864
3931
|
query: { ...query ?? {} },
|
|
3865
3932
|
signal: options?.signal
|
|
3866
3933
|
});
|
|
@@ -3868,7 +3935,7 @@ var SearchFacade = class {
|
|
|
3868
3935
|
};
|
|
3869
3936
|
|
|
3870
3937
|
// ../../src/resources/action-history/ActionHistoryFacade.ts
|
|
3871
|
-
var
|
|
3938
|
+
var BASE13 = "/api/v1/actionhistory";
|
|
3872
3939
|
var ActionHistoryFacade = class {
|
|
3873
3940
|
constructor(http) {
|
|
3874
3941
|
this.http = http;
|
|
@@ -3882,7 +3949,7 @@ var ActionHistoryFacade = class {
|
|
|
3882
3949
|
list(query, options) {
|
|
3883
3950
|
return this.http.requestJson({
|
|
3884
3951
|
method: "GET",
|
|
3885
|
-
path:
|
|
3952
|
+
path: BASE13,
|
|
3886
3953
|
query: { ...query ?? {} },
|
|
3887
3954
|
signal: options?.signal
|
|
3888
3955
|
});
|
|
@@ -3890,7 +3957,7 @@ var ActionHistoryFacade = class {
|
|
|
3890
3957
|
};
|
|
3891
3958
|
|
|
3892
3959
|
// ../../src/resources/accounting-transactions/AccountingTransactionsFacade.ts
|
|
3893
|
-
var
|
|
3960
|
+
var BASE14 = "/api/v1/accountingtransactions";
|
|
3894
3961
|
var AccountingTransactionsFacade = class {
|
|
3895
3962
|
constructor(http) {
|
|
3896
3963
|
this.http = http;
|
|
@@ -3900,17 +3967,18 @@ var AccountingTransactionsFacade = class {
|
|
|
3900
3967
|
create(transaction, options) {
|
|
3901
3968
|
return this.http.requestJson({
|
|
3902
3969
|
method: "POST",
|
|
3903
|
-
path:
|
|
3970
|
+
path: BASE14,
|
|
3904
3971
|
query: { securityToken: options?.securityToken },
|
|
3905
3972
|
body: transaction,
|
|
3906
3973
|
signal: options?.signal
|
|
3907
3974
|
});
|
|
3908
3975
|
}
|
|
3909
|
-
/** `PUT /api/v1/accountingtransactions/{
|
|
3910
|
-
update(transaction,
|
|
3976
|
+
/** `PUT /api/v1/accountingtransactions/{transaction.id}` */
|
|
3977
|
+
update(transaction, options) {
|
|
3978
|
+
const transactionId = requireItemUpdateId(transaction, "Accounting transaction");
|
|
3911
3979
|
return this.http.requestJson({
|
|
3912
3980
|
method: "PUT",
|
|
3913
|
-
path: `${
|
|
3981
|
+
path: `${BASE14}/${encodePathSegment(transactionId)}`,
|
|
3914
3982
|
query: {
|
|
3915
3983
|
checkVersion: options?.checkVersion,
|
|
3916
3984
|
isNeedAnnouncement: options?.isNeedAnnouncement,
|
|
@@ -3924,7 +3992,7 @@ var AccountingTransactionsFacade = class {
|
|
|
3924
3992
|
async delete(torrowId, options) {
|
|
3925
3993
|
const resp = await this.http.requestJson({
|
|
3926
3994
|
method: "DELETE",
|
|
3927
|
-
path: `${
|
|
3995
|
+
path: `${BASE14}/${encodePathSegment(torrowId)}`,
|
|
3928
3996
|
query: {
|
|
3929
3997
|
versionToCheck: options?.versionToCheck,
|
|
3930
3998
|
isNeedAnnouncement: options?.isNeedAnnouncement,
|
|
@@ -3941,7 +4009,7 @@ var AccountingTransactionsFacade = class {
|
|
|
3941
4009
|
updateState(torrowId, state, options) {
|
|
3942
4010
|
return this.http.requestJson({
|
|
3943
4011
|
method: "PUT",
|
|
3944
|
-
path: `${
|
|
4012
|
+
path: `${BASE14}/${encodePathSegment(torrowId)}/state`,
|
|
3945
4013
|
query: {
|
|
3946
4014
|
state,
|
|
3947
4015
|
versionToCheck: options?.versionToCheck,
|
|
@@ -3955,7 +4023,7 @@ var AccountingTransactionsFacade = class {
|
|
|
3955
4023
|
getBalance(torrowId, options) {
|
|
3956
4024
|
return this.http.requestJson({
|
|
3957
4025
|
method: "GET",
|
|
3958
|
-
path: `${
|
|
4026
|
+
path: `${BASE14}/${encodePathSegment(torrowId)}/balance`,
|
|
3959
4027
|
query: {
|
|
3960
4028
|
balanceDate: options?.balanceDate,
|
|
3961
4029
|
securityToken: options?.securityToken
|
|
@@ -3967,7 +4035,7 @@ var AccountingTransactionsFacade = class {
|
|
|
3967
4035
|
listTransactions(torrowId, query, options) {
|
|
3968
4036
|
return this.http.requestJson({
|
|
3969
4037
|
method: "GET",
|
|
3970
|
-
path: `${
|
|
4038
|
+
path: `${BASE14}/${encodePathSegment(torrowId)}/transactions`,
|
|
3971
4039
|
query: { ...query ?? {} },
|
|
3972
4040
|
signal: options?.signal
|
|
3973
4041
|
});
|
|
@@ -3975,7 +4043,7 @@ var AccountingTransactionsFacade = class {
|
|
|
3975
4043
|
};
|
|
3976
4044
|
|
|
3977
4045
|
// ../../src/resources/announcements/AnnouncementsFacade.ts
|
|
3978
|
-
var
|
|
4046
|
+
var BASE15 = "/api/v1/announcements";
|
|
3979
4047
|
var AnnouncementsFacade = class {
|
|
3980
4048
|
constructor(http) {
|
|
3981
4049
|
this.http = http;
|
|
@@ -3989,7 +4057,7 @@ var AnnouncementsFacade = class {
|
|
|
3989
4057
|
list(query, options) {
|
|
3990
4058
|
return this.http.requestJson({
|
|
3991
4059
|
method: "GET",
|
|
3992
|
-
path:
|
|
4060
|
+
path: BASE15,
|
|
3993
4061
|
query: { ...query ?? {} },
|
|
3994
4062
|
signal: options?.signal
|
|
3995
4063
|
});
|
|
@@ -3998,7 +4066,7 @@ var AnnouncementsFacade = class {
|
|
|
3998
4066
|
updateState(body, options) {
|
|
3999
4067
|
return this.http.requestJson({
|
|
4000
4068
|
method: "POST",
|
|
4001
|
-
path: `${
|
|
4069
|
+
path: `${BASE15}/updatestate`,
|
|
4002
4070
|
body,
|
|
4003
4071
|
signal: options?.signal
|
|
4004
4072
|
});
|
|
@@ -4041,7 +4109,7 @@ var ExportImportFacade = class {
|
|
|
4041
4109
|
};
|
|
4042
4110
|
|
|
4043
4111
|
// ../../src/resources/reports/ReportsFacade.ts
|
|
4044
|
-
var
|
|
4112
|
+
var BASE16 = "/api/v1/reports";
|
|
4045
4113
|
var ReportsFacade = class {
|
|
4046
4114
|
constructor(http) {
|
|
4047
4115
|
this.http = http;
|
|
@@ -4053,7 +4121,7 @@ var ReportsFacade = class {
|
|
|
4053
4121
|
generate(body, options) {
|
|
4054
4122
|
return this.http.requestJson({
|
|
4055
4123
|
method: "POST",
|
|
4056
|
-
path:
|
|
4124
|
+
path: BASE16,
|
|
4057
4125
|
query: { profileId: options?.profileId },
|
|
4058
4126
|
body,
|
|
4059
4127
|
signal: options?.signal
|
|
@@ -4063,7 +4131,7 @@ var ReportsFacade = class {
|
|
|
4063
4131
|
generateForProfile(profileId, body, options) {
|
|
4064
4132
|
return this.http.requestJson({
|
|
4065
4133
|
method: "POST",
|
|
4066
|
-
path: `${
|
|
4134
|
+
path: `${BASE16}/${encodePathSegment(profileId)}`,
|
|
4067
4135
|
body,
|
|
4068
4136
|
signal: options?.signal
|
|
4069
4137
|
});
|
|
@@ -4071,11 +4139,11 @@ var ReportsFacade = class {
|
|
|
4071
4139
|
};
|
|
4072
4140
|
|
|
4073
4141
|
// ../../src/resources/loyalty-systems/LoyaltySystemsFacade.ts
|
|
4074
|
-
var
|
|
4142
|
+
var BASE17 = "/api/v1/loyaltysystems";
|
|
4075
4143
|
var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
4076
4144
|
itemObjectTypeCode = TorrowObjectTypeCode.LoyaltySystem;
|
|
4077
4145
|
constructor(http) {
|
|
4078
|
-
super(http,
|
|
4146
|
+
super(http, BASE17);
|
|
4079
4147
|
}
|
|
4080
4148
|
/** Id программы лояльности до `create` / presigned upload. */
|
|
4081
4149
|
generateLoyaltySystemId(ownerTorrowId) {
|
|
@@ -4086,17 +4154,18 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4086
4154
|
const payload = applyItemCreateDefaults(body, "LoyaltySystemItem" /* LoyaltySystemItem */);
|
|
4087
4155
|
return this.http.requestJson({
|
|
4088
4156
|
method: "POST",
|
|
4089
|
-
path:
|
|
4157
|
+
path: BASE17,
|
|
4090
4158
|
query: { parentId: options?.parentId, profileId: options?.profileId },
|
|
4091
4159
|
body: payload,
|
|
4092
4160
|
signal: options?.signal
|
|
4093
4161
|
});
|
|
4094
4162
|
}
|
|
4095
|
-
/** `PUT /api/v1/loyaltysystems/{
|
|
4096
|
-
update(body,
|
|
4163
|
+
/** `PUT /api/v1/loyaltysystems/{body.id}` */
|
|
4164
|
+
update(body, options) {
|
|
4165
|
+
const itemId = requireItemUpdateId(body, "Loyalty system");
|
|
4097
4166
|
return this.http.requestJson({
|
|
4098
4167
|
method: "PUT",
|
|
4099
|
-
path: `${
|
|
4168
|
+
path: `${BASE17}/${encodePathSegment(itemId)}`,
|
|
4100
4169
|
query: {
|
|
4101
4170
|
checkVersion: options?.checkVersion,
|
|
4102
4171
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4109,7 +4178,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4109
4178
|
async delete(torrowId, options) {
|
|
4110
4179
|
const resp = await this.http.requestJson({
|
|
4111
4180
|
method: "DELETE",
|
|
4112
|
-
path: `${
|
|
4181
|
+
path: `${BASE17}/${encodePathSegment(torrowId)}`,
|
|
4113
4182
|
query: {
|
|
4114
4183
|
cascade: options.cascade,
|
|
4115
4184
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -4124,7 +4193,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4124
4193
|
getById(torrowId, options) {
|
|
4125
4194
|
return this.http.requestJson({
|
|
4126
4195
|
method: "GET",
|
|
4127
|
-
path: `${
|
|
4196
|
+
path: `${BASE17}/${encodePathSegment(torrowId)}`,
|
|
4128
4197
|
query: {
|
|
4129
4198
|
versionToCheck: options?.versionToCheck,
|
|
4130
4199
|
includeDeleted: options?.includeDeleted,
|
|
@@ -4139,7 +4208,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4139
4208
|
const { signal, ...rest } = options ?? {};
|
|
4140
4209
|
return this.http.requestJson({
|
|
4141
4210
|
method: "GET",
|
|
4142
|
-
path: `${
|
|
4211
|
+
path: `${BASE17}/personallist`,
|
|
4143
4212
|
query: { ...rest },
|
|
4144
4213
|
signal
|
|
4145
4214
|
});
|
|
@@ -4148,7 +4217,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4148
4217
|
deleteFromPersonalList(torrowId, options) {
|
|
4149
4218
|
return this.http.requestJson({
|
|
4150
4219
|
method: "DELETE",
|
|
4151
|
-
path: `${
|
|
4220
|
+
path: `${BASE17}/personallist/${encodePathSegment(torrowId)}`,
|
|
4152
4221
|
signal: options?.signal
|
|
4153
4222
|
});
|
|
4154
4223
|
}
|
|
@@ -4160,7 +4229,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4160
4229
|
createLoyaltyCard(loyaltySystemId, body, options) {
|
|
4161
4230
|
return this.http.requestJson({
|
|
4162
4231
|
method: "POST",
|
|
4163
|
-
path: `${
|
|
4232
|
+
path: `${BASE17}/${encodePathSegment(loyaltySystemId)}/loyaltycard`,
|
|
4164
4233
|
body,
|
|
4165
4234
|
signal: options?.signal
|
|
4166
4235
|
});
|
|
@@ -4173,7 +4242,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4173
4242
|
searchLoyaltyCards(torrowId, body, options) {
|
|
4174
4243
|
return this.http.requestJson({
|
|
4175
4244
|
method: "POST",
|
|
4176
|
-
path: `${
|
|
4245
|
+
path: `${BASE17}/${encodePathSegment(torrowId)}/loyaltycards`,
|
|
4177
4246
|
body,
|
|
4178
4247
|
signal: options?.signal
|
|
4179
4248
|
});
|
|
@@ -4182,7 +4251,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4182
4251
|
async postStatistics(body, options) {
|
|
4183
4252
|
const resp = await this.http.requestJson({
|
|
4184
4253
|
method: "POST",
|
|
4185
|
-
path: `${
|
|
4254
|
+
path: `${BASE17}/statistics`,
|
|
4186
4255
|
query: { securityToken: options?.securityToken },
|
|
4187
4256
|
body,
|
|
4188
4257
|
signal: options?.signal
|
|
@@ -4193,7 +4262,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4193
4262
|
getParticipantsCount(torrowId, query, options) {
|
|
4194
4263
|
return this.http.requestJson({
|
|
4195
4264
|
method: "GET",
|
|
4196
|
-
path: `${
|
|
4265
|
+
path: `${BASE17}/${encodePathSegment(torrowId)}/participants/count`,
|
|
4197
4266
|
query: { ...query ?? {} },
|
|
4198
4267
|
signal: options?.signal
|
|
4199
4268
|
});
|
|
@@ -4201,12 +4270,12 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
4201
4270
|
};
|
|
4202
4271
|
|
|
4203
4272
|
// ../../src/resources/loyalty-cards/LoyaltyCardsFacade.ts
|
|
4204
|
-
var
|
|
4273
|
+
var BASE18 = "/api/v1/loyaltycards";
|
|
4205
4274
|
var LOYALTY_CARD_SOCIAL_OPTS = { withGroupListEndpoint: false };
|
|
4206
4275
|
var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
4207
4276
|
itemObjectTypeCode = TorrowObjectTypeCode.LoyaltyCard;
|
|
4208
4277
|
constructor(http) {
|
|
4209
|
-
super(http,
|
|
4278
|
+
super(http, BASE18, LOYALTY_CARD_SOCIAL_OPTS);
|
|
4210
4279
|
}
|
|
4211
4280
|
/** Id карты лояльности до `create` / presigned upload. */
|
|
4212
4281
|
generateLoyaltyCardId(ownerTorrowId) {
|
|
@@ -4216,7 +4285,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4216
4285
|
createSubscription(loyaltyCardId, body, options) {
|
|
4217
4286
|
return this.http.requestJson({
|
|
4218
4287
|
method: "POST",
|
|
4219
|
-
path: `${
|
|
4288
|
+
path: `${BASE18}/${encodePathSegment(loyaltyCardId)}/subscription`,
|
|
4220
4289
|
body,
|
|
4221
4290
|
signal: options?.signal
|
|
4222
4291
|
});
|
|
@@ -4225,7 +4294,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4225
4294
|
getParticipantsCount(torrowId, query, options) {
|
|
4226
4295
|
return this.http.requestJson({
|
|
4227
4296
|
method: "GET",
|
|
4228
|
-
path: `${
|
|
4297
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/participants/count`,
|
|
4229
4298
|
query: { ...query ?? {} },
|
|
4230
4299
|
signal: options?.signal
|
|
4231
4300
|
});
|
|
@@ -4234,7 +4303,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4234
4303
|
getBalance(torrowId, options) {
|
|
4235
4304
|
return this.http.requestJson({
|
|
4236
4305
|
method: "GET",
|
|
4237
|
-
path: `${
|
|
4306
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/balance`,
|
|
4238
4307
|
query: {
|
|
4239
4308
|
balanceDate: options?.balanceDate,
|
|
4240
4309
|
securityToken: options?.securityToken
|
|
@@ -4246,7 +4315,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4246
4315
|
listTransactions(torrowId, query, options) {
|
|
4247
4316
|
return this.http.requestJson({
|
|
4248
4317
|
method: "GET",
|
|
4249
|
-
path: `${
|
|
4318
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/transactions`,
|
|
4250
4319
|
query: { ...query ?? {} },
|
|
4251
4320
|
signal: options?.signal
|
|
4252
4321
|
});
|
|
@@ -4255,7 +4324,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4255
4324
|
getSubscriptionBalance(torrowId, subscriptionId, options) {
|
|
4256
4325
|
return this.http.requestJson({
|
|
4257
4326
|
method: "GET",
|
|
4258
|
-
path: `${
|
|
4327
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/subscriptions/${encodePathSegment(subscriptionId)}/balance`,
|
|
4259
4328
|
query: {
|
|
4260
4329
|
balanceDate: options?.balanceDate,
|
|
4261
4330
|
securityToken: options?.securityToken
|
|
@@ -4267,16 +4336,17 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4267
4336
|
getSubscriptionTransactions(torrowId, subscriptionId, query, options) {
|
|
4268
4337
|
return this.http.requestJson({
|
|
4269
4338
|
method: "GET",
|
|
4270
|
-
path: `${
|
|
4339
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/subscriptions/${encodePathSegment(subscriptionId)}/transactions`,
|
|
4271
4340
|
query: { ...query ?? {} },
|
|
4272
4341
|
signal: options?.signal
|
|
4273
4342
|
});
|
|
4274
4343
|
}
|
|
4275
|
-
/** `PUT /api/v1/loyaltycards/{
|
|
4276
|
-
update(body,
|
|
4344
|
+
/** `PUT /api/v1/loyaltycards/{body.id}` */
|
|
4345
|
+
update(body, options) {
|
|
4346
|
+
const itemId = requireItemUpdateId(body, "Loyalty card");
|
|
4277
4347
|
return this.http.requestJson({
|
|
4278
4348
|
method: "PUT",
|
|
4279
|
-
path: `${
|
|
4349
|
+
path: `${BASE18}/${encodePathSegment(itemId)}`,
|
|
4280
4350
|
query: {
|
|
4281
4351
|
checkVersion: options?.checkVersion,
|
|
4282
4352
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4289,7 +4359,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4289
4359
|
async delete(torrowId, options) {
|
|
4290
4360
|
const resp = await this.http.requestJson({
|
|
4291
4361
|
method: "DELETE",
|
|
4292
|
-
path: `${
|
|
4362
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}`,
|
|
4293
4363
|
query: {
|
|
4294
4364
|
cascade: options.cascade,
|
|
4295
4365
|
withPinnedItems: options.withPinnedItems,
|
|
@@ -4304,7 +4374,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4304
4374
|
getById(torrowId, options) {
|
|
4305
4375
|
return this.http.requestJson({
|
|
4306
4376
|
method: "GET",
|
|
4307
|
-
path: `${
|
|
4377
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}`,
|
|
4308
4378
|
query: {
|
|
4309
4379
|
versionToCheck: options?.versionToCheck,
|
|
4310
4380
|
includeDeleted: options?.includeDeleted,
|
|
@@ -4320,7 +4390,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4320
4390
|
const { signal, ...rest } = options ?? {};
|
|
4321
4391
|
return this.http.requestJson({
|
|
4322
4392
|
method: "GET",
|
|
4323
|
-
path: `${
|
|
4393
|
+
path: `${BASE18}/personallist`,
|
|
4324
4394
|
query: { ...rest },
|
|
4325
4395
|
signal
|
|
4326
4396
|
});
|
|
@@ -4329,7 +4399,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4329
4399
|
deleteFromPersonalList(torrowId, options) {
|
|
4330
4400
|
return this.http.requestJson({
|
|
4331
4401
|
method: "DELETE",
|
|
4332
|
-
path: `${
|
|
4402
|
+
path: `${BASE18}/personallist/${encodePathSegment(torrowId)}`,
|
|
4333
4403
|
signal: options?.signal
|
|
4334
4404
|
});
|
|
4335
4405
|
}
|
|
@@ -4341,7 +4411,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4341
4411
|
const { signal, ...queryOpts } = options ?? {};
|
|
4342
4412
|
return this.http.requestJson({
|
|
4343
4413
|
method: "PUT",
|
|
4344
|
-
path: `${
|
|
4414
|
+
path: `${BASE18}/${encodePathSegment(torrowId)}/timetable`,
|
|
4345
4415
|
query: buildTimetableQuery(queryOpts),
|
|
4346
4416
|
body,
|
|
4347
4417
|
signal
|
|
@@ -4351,7 +4421,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4351
4421
|
async getTimetableStatistics(body, options) {
|
|
4352
4422
|
const resp = await this.http.requestJson({
|
|
4353
4423
|
method: "POST",
|
|
4354
|
-
path: `${
|
|
4424
|
+
path: `${BASE18}/timetable/statistics`,
|
|
4355
4425
|
body,
|
|
4356
4426
|
signal: options?.signal
|
|
4357
4427
|
});
|
|
@@ -4364,7 +4434,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
4364
4434
|
updateNotificationWayList(itemId, ways, options) {
|
|
4365
4435
|
return this.http.requestJson({
|
|
4366
4436
|
method: "PUT",
|
|
4367
|
-
path: `${
|
|
4437
|
+
path: `${BASE18}/${encodePathSegment(itemId)}/notificationwaylist`,
|
|
4368
4438
|
query: {
|
|
4369
4439
|
versionToCheck: options?.versionToCheck,
|
|
4370
4440
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4392,7 +4462,7 @@ function stringifyOpaqueJsonSettings(value) {
|
|
|
4392
4462
|
}
|
|
4393
4463
|
|
|
4394
4464
|
// ../../src/resources/user-settings/UserSettingsFacade.ts
|
|
4395
|
-
var
|
|
4465
|
+
var BASE19 = "/api/v1/user/settings";
|
|
4396
4466
|
var UserSettingsFacade = class {
|
|
4397
4467
|
constructor(http) {
|
|
4398
4468
|
this.http = http;
|
|
@@ -4402,7 +4472,7 @@ var UserSettingsFacade = class {
|
|
|
4402
4472
|
async get(options) {
|
|
4403
4473
|
const dto = await this.http.requestJson({
|
|
4404
4474
|
method: "GET",
|
|
4405
|
-
path:
|
|
4475
|
+
path: BASE19,
|
|
4406
4476
|
signal: options?.signal
|
|
4407
4477
|
});
|
|
4408
4478
|
return { settings: parseOpaqueJsonSettings(dto.settings) };
|
|
@@ -4417,7 +4487,7 @@ var UserSettingsFacade = class {
|
|
|
4417
4487
|
};
|
|
4418
4488
|
return this.http.requestJson({
|
|
4419
4489
|
method: "PUT",
|
|
4420
|
-
path: `${
|
|
4490
|
+
path: `${BASE19}/update`,
|
|
4421
4491
|
body: wire,
|
|
4422
4492
|
signal: options?.signal
|
|
4423
4493
|
});
|
|
@@ -4425,7 +4495,7 @@ var UserSettingsFacade = class {
|
|
|
4425
4495
|
};
|
|
4426
4496
|
|
|
4427
4497
|
// ../../src/resources/user/UserFacade.ts
|
|
4428
|
-
var
|
|
4498
|
+
var BASE20 = "/api/v1/user";
|
|
4429
4499
|
var UserFacade = class {
|
|
4430
4500
|
constructor(http) {
|
|
4431
4501
|
this.http = http;
|
|
@@ -4433,13 +4503,13 @@ var UserFacade = class {
|
|
|
4433
4503
|
http;
|
|
4434
4504
|
/** `GET /api/v1/user/loyaltycard` */
|
|
4435
4505
|
getLoyaltyCard(options) {
|
|
4436
|
-
return this.http.requestJson({ method: "GET", path: `${
|
|
4506
|
+
return this.http.requestJson({ method: "GET", path: `${BASE20}/loyaltycard`, signal: options?.signal });
|
|
4437
4507
|
}
|
|
4438
4508
|
/** `GET /api/v1/user/accounts` */
|
|
4439
4509
|
listAccounts(query, options) {
|
|
4440
4510
|
return this.http.requestJson({
|
|
4441
4511
|
method: "GET",
|
|
4442
|
-
path: `${
|
|
4512
|
+
path: `${BASE20}/accounts`,
|
|
4443
4513
|
query: { ...query ?? {} },
|
|
4444
4514
|
signal: options?.signal
|
|
4445
4515
|
});
|
|
@@ -4448,7 +4518,7 @@ var UserFacade = class {
|
|
|
4448
4518
|
initAddAccount(body, options) {
|
|
4449
4519
|
return this.http.requestJson({
|
|
4450
4520
|
method: "POST",
|
|
4451
|
-
path: `${
|
|
4521
|
+
path: `${BASE20}/accounts/add/init`,
|
|
4452
4522
|
body,
|
|
4453
4523
|
signal: options?.signal
|
|
4454
4524
|
});
|
|
@@ -4457,7 +4527,7 @@ var UserFacade = class {
|
|
|
4457
4527
|
completeAddAccount(body, options) {
|
|
4458
4528
|
return this.http.requestJson({
|
|
4459
4529
|
method: "POST",
|
|
4460
|
-
path: `${
|
|
4530
|
+
path: `${BASE20}/accounts/add/complete`,
|
|
4461
4531
|
body,
|
|
4462
4532
|
signal: options?.signal
|
|
4463
4533
|
});
|
|
@@ -4466,7 +4536,7 @@ var UserFacade = class {
|
|
|
4466
4536
|
async deleteAccount(body, options) {
|
|
4467
4537
|
const resp = await this.http.requestJson({
|
|
4468
4538
|
method: "DELETE",
|
|
4469
|
-
path: `${
|
|
4539
|
+
path: `${BASE20}/accounts/delete`,
|
|
4470
4540
|
body,
|
|
4471
4541
|
signal: options?.signal
|
|
4472
4542
|
});
|
|
@@ -4476,7 +4546,7 @@ var UserFacade = class {
|
|
|
4476
4546
|
listDevices(query, options) {
|
|
4477
4547
|
return this.http.requestJson({
|
|
4478
4548
|
method: "GET",
|
|
4479
|
-
path: `${
|
|
4549
|
+
path: `${BASE20}/devices`,
|
|
4480
4550
|
query: { ...query ?? {} },
|
|
4481
4551
|
signal: options?.signal
|
|
4482
4552
|
});
|
|
@@ -4485,7 +4555,7 @@ var UserFacade = class {
|
|
|
4485
4555
|
async deleteDevice(deviceId, options) {
|
|
4486
4556
|
const resp = await this.http.requestJson({
|
|
4487
4557
|
method: "DELETE",
|
|
4488
|
-
path: `${
|
|
4558
|
+
path: `${BASE20}/devices/${encodePathSegment(deviceId)}`,
|
|
4489
4559
|
signal: options?.signal
|
|
4490
4560
|
});
|
|
4491
4561
|
return unwrapDeleteCount(resp);
|
|
@@ -4494,7 +4564,7 @@ var UserFacade = class {
|
|
|
4494
4564
|
async getDeviceSettings(deviceId, options) {
|
|
4495
4565
|
const dto = await this.http.requestJson({
|
|
4496
4566
|
method: "GET",
|
|
4497
|
-
path: `${
|
|
4567
|
+
path: `${BASE20}/devices/${encodePathSegment(deviceId)}/settings`,
|
|
4498
4568
|
signal: options?.signal
|
|
4499
4569
|
});
|
|
4500
4570
|
return {
|
|
@@ -4510,20 +4580,20 @@ var UserFacade = class {
|
|
|
4510
4580
|
const wire = settings === null || settings === void 0 ? "{}" : stringifyOpaqueJsonSettings(settings);
|
|
4511
4581
|
return this.http.requestJson({
|
|
4512
4582
|
method: "PUT",
|
|
4513
|
-
path: `${
|
|
4583
|
+
path: `${BASE20}/devices/${encodePathSegment(deviceId)}/settings`,
|
|
4514
4584
|
query: { settings: wire },
|
|
4515
4585
|
signal: options?.signal
|
|
4516
4586
|
});
|
|
4517
4587
|
}
|
|
4518
4588
|
/** `GET /api/v1/user/defaultprofile` */
|
|
4519
4589
|
getDefaultProfile(options) {
|
|
4520
|
-
return this.http.requestJson({ method: "GET", path: `${
|
|
4590
|
+
return this.http.requestJson({ method: "GET", path: `${BASE20}/defaultprofile`, signal: options?.signal });
|
|
4521
4591
|
}
|
|
4522
4592
|
/** `PUT /api/v1/user/defaultprofile` */
|
|
4523
4593
|
async setDefaultProfileByContactId(contactId, options) {
|
|
4524
4594
|
const resp = await this.http.requestJson({
|
|
4525
4595
|
method: "PUT",
|
|
4526
|
-
path: `${
|
|
4596
|
+
path: `${BASE20}/defaultprofile`,
|
|
4527
4597
|
body: contactId,
|
|
4528
4598
|
signal: options?.signal
|
|
4529
4599
|
});
|
|
@@ -4537,7 +4607,7 @@ var UserFacade = class {
|
|
|
4537
4607
|
const payload = prepareUserProfileItemForAdd(body);
|
|
4538
4608
|
const resp = await this.http.requestJson({
|
|
4539
4609
|
method: "POST",
|
|
4540
|
-
path: `${
|
|
4610
|
+
path: `${BASE20}/defaultprofile`,
|
|
4541
4611
|
body: payload,
|
|
4542
4612
|
signal: options?.signal
|
|
4543
4613
|
});
|
|
@@ -4547,7 +4617,7 @@ var UserFacade = class {
|
|
|
4547
4617
|
listDeliveryWays(query, options) {
|
|
4548
4618
|
return this.http.requestJson({
|
|
4549
4619
|
method: "GET",
|
|
4550
|
-
path: `${
|
|
4620
|
+
path: `${BASE20}/deliveryways`,
|
|
4551
4621
|
query: { ...query ?? {} },
|
|
4552
4622
|
signal: options?.signal
|
|
4553
4623
|
});
|
|
@@ -4556,7 +4626,7 @@ var UserFacade = class {
|
|
|
4556
4626
|
listDefaultNotificationWays(options) {
|
|
4557
4627
|
return this.http.requestJson({
|
|
4558
4628
|
method: "GET",
|
|
4559
|
-
path: `${
|
|
4629
|
+
path: `${BASE20}/defaultnotificationways`,
|
|
4560
4630
|
signal: options?.signal
|
|
4561
4631
|
});
|
|
4562
4632
|
}
|
|
@@ -4564,7 +4634,7 @@ var UserFacade = class {
|
|
|
4564
4634
|
updateDefaultNotificationWays(body, options) {
|
|
4565
4635
|
return this.http.requestJson({
|
|
4566
4636
|
method: "PUT",
|
|
4567
|
-
path: `${
|
|
4637
|
+
path: `${BASE20}/defaultnotificationways`,
|
|
4568
4638
|
query: {
|
|
4569
4639
|
versionToCheck: options?.versionToCheck,
|
|
4570
4640
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4577,7 +4647,7 @@ var UserFacade = class {
|
|
|
4577
4647
|
updatePlace(query, options) {
|
|
4578
4648
|
return this.http.requestJson({
|
|
4579
4649
|
method: "PUT",
|
|
4580
|
-
path: `${
|
|
4650
|
+
path: `${BASE20}/place`,
|
|
4581
4651
|
query,
|
|
4582
4652
|
signal: options?.signal
|
|
4583
4653
|
});
|
|
@@ -4586,7 +4656,7 @@ var UserFacade = class {
|
|
|
4586
4656
|
register(body, options) {
|
|
4587
4657
|
return this.http.requestJson({
|
|
4588
4658
|
method: "POST",
|
|
4589
|
-
path: `${
|
|
4659
|
+
path: `${BASE20}/register`,
|
|
4590
4660
|
body,
|
|
4591
4661
|
signal: options?.signal
|
|
4592
4662
|
});
|
|
@@ -4595,7 +4665,7 @@ var UserFacade = class {
|
|
|
4595
4665
|
getTimetable(body, query, options) {
|
|
4596
4666
|
return this.http.requestJson({
|
|
4597
4667
|
method: "PUT",
|
|
4598
|
-
path: `${
|
|
4668
|
+
path: `${BASE20}/timetable`,
|
|
4599
4669
|
query: { ...query ?? {} },
|
|
4600
4670
|
body,
|
|
4601
4671
|
signal: options?.signal
|
|
@@ -4605,7 +4675,7 @@ var UserFacade = class {
|
|
|
4605
4675
|
listCalendars(options) {
|
|
4606
4676
|
return this.http.requestJson({
|
|
4607
4677
|
method: "GET",
|
|
4608
|
-
path: `${
|
|
4678
|
+
path: `${BASE20}/calendars`,
|
|
4609
4679
|
signal: options?.signal
|
|
4610
4680
|
});
|
|
4611
4681
|
}
|
|
@@ -4613,7 +4683,7 @@ var UserFacade = class {
|
|
|
4613
4683
|
updateCalendars(body, options) {
|
|
4614
4684
|
return this.http.requestJson({
|
|
4615
4685
|
method: "PUT",
|
|
4616
|
-
path: `${
|
|
4686
|
+
path: `${BASE20}/calendars/update`,
|
|
4617
4687
|
body,
|
|
4618
4688
|
signal: options?.signal
|
|
4619
4689
|
});
|
|
@@ -4622,7 +4692,7 @@ var UserFacade = class {
|
|
|
4622
4692
|
initDelete(options) {
|
|
4623
4693
|
return this.http.requestJson({
|
|
4624
4694
|
method: "DELETE",
|
|
4625
|
-
path: `${
|
|
4695
|
+
path: `${BASE20}/delete/init`,
|
|
4626
4696
|
signal: options?.signal
|
|
4627
4697
|
});
|
|
4628
4698
|
}
|
|
@@ -4630,19 +4700,19 @@ var UserFacade = class {
|
|
|
4630
4700
|
completeDelete(body, options) {
|
|
4631
4701
|
return this.http.requestJson({
|
|
4632
4702
|
method: "DELETE",
|
|
4633
|
-
path: `${
|
|
4703
|
+
path: `${BASE20}/delete/complete`,
|
|
4634
4704
|
body,
|
|
4635
4705
|
signal: options?.signal
|
|
4636
4706
|
});
|
|
4637
4707
|
}
|
|
4638
4708
|
/** `GET /api/v1/user/count` — публичный счётчик пользователей (без Bearer ок). */
|
|
4639
4709
|
count(options) {
|
|
4640
|
-
return this.http.requestJson({ method: "GET", path: `${
|
|
4710
|
+
return this.http.requestJson({ method: "GET", path: `${BASE20}/count`, signal: options?.signal });
|
|
4641
4711
|
}
|
|
4642
4712
|
};
|
|
4643
4713
|
|
|
4644
4714
|
// ../../src/resources/api-keys/ApiKeysFacade.ts
|
|
4645
|
-
var
|
|
4715
|
+
var BASE21 = "/api/v1/apikeys";
|
|
4646
4716
|
var ApiKeysFacade = class {
|
|
4647
4717
|
constructor(http) {
|
|
4648
4718
|
this.http = http;
|
|
@@ -4652,7 +4722,7 @@ var ApiKeysFacade = class {
|
|
|
4652
4722
|
list(options) {
|
|
4653
4723
|
return this.http.requestJson({
|
|
4654
4724
|
method: "GET",
|
|
4655
|
-
path:
|
|
4725
|
+
path: BASE21,
|
|
4656
4726
|
signal: options?.signal
|
|
4657
4727
|
});
|
|
4658
4728
|
}
|
|
@@ -4660,7 +4730,7 @@ var ApiKeysFacade = class {
|
|
|
4660
4730
|
create(body, options) {
|
|
4661
4731
|
return this.http.requestJson({
|
|
4662
4732
|
method: "POST",
|
|
4663
|
-
path:
|
|
4733
|
+
path: BASE21,
|
|
4664
4734
|
body,
|
|
4665
4735
|
signal: options?.signal
|
|
4666
4736
|
});
|
|
@@ -4669,14 +4739,14 @@ var ApiKeysFacade = class {
|
|
|
4669
4739
|
delete(keyId, options) {
|
|
4670
4740
|
return this.http.requestJson({
|
|
4671
4741
|
method: "DELETE",
|
|
4672
|
-
path: `${
|
|
4742
|
+
path: `${BASE21}/${encodePathSegment(keyId)}`,
|
|
4673
4743
|
signal: options?.signal
|
|
4674
4744
|
});
|
|
4675
4745
|
}
|
|
4676
4746
|
};
|
|
4677
4747
|
|
|
4678
4748
|
// ../../src/resources/block-reason/BlockReasonsFacade.ts
|
|
4679
|
-
var
|
|
4749
|
+
var BASE22 = "/api/v1/blockreason";
|
|
4680
4750
|
var BlockReasonsFacade = class {
|
|
4681
4751
|
constructor(http) {
|
|
4682
4752
|
this.http = http;
|
|
@@ -4686,7 +4756,7 @@ var BlockReasonsFacade = class {
|
|
|
4686
4756
|
create(body, options) {
|
|
4687
4757
|
return this.http.requestJson({
|
|
4688
4758
|
method: "POST",
|
|
4689
|
-
path:
|
|
4759
|
+
path: BASE22,
|
|
4690
4760
|
body,
|
|
4691
4761
|
signal: options?.signal
|
|
4692
4762
|
});
|
|
@@ -4695,7 +4765,7 @@ var BlockReasonsFacade = class {
|
|
|
4695
4765
|
getById(id, options) {
|
|
4696
4766
|
return this.http.requestJson({
|
|
4697
4767
|
method: "GET",
|
|
4698
|
-
path: `${
|
|
4768
|
+
path: `${BASE22}/${encodePathSegment(String(id))}`,
|
|
4699
4769
|
query: { lng: options?.lng },
|
|
4700
4770
|
signal: options?.signal
|
|
4701
4771
|
});
|
|
@@ -4705,7 +4775,7 @@ var BlockReasonsFacade = class {
|
|
|
4705
4775
|
const { signal } = options ?? {};
|
|
4706
4776
|
return this.http.requestJson({
|
|
4707
4777
|
method: "GET",
|
|
4708
|
-
path: `${
|
|
4778
|
+
path: `${BASE22}/all`,
|
|
4709
4779
|
query: { ...query ?? {} },
|
|
4710
4780
|
signal
|
|
4711
4781
|
});
|
|
@@ -4714,14 +4784,14 @@ var BlockReasonsFacade = class {
|
|
|
4714
4784
|
delete(id, options) {
|
|
4715
4785
|
return this.http.requestJson({
|
|
4716
4786
|
method: "DELETE",
|
|
4717
|
-
path: `${
|
|
4787
|
+
path: `${BASE22}/${encodePathSegment(String(id))}`,
|
|
4718
4788
|
signal: options?.signal
|
|
4719
4789
|
});
|
|
4720
4790
|
}
|
|
4721
4791
|
};
|
|
4722
4792
|
|
|
4723
4793
|
// ../../src/resources/external-auths/ExternalAuthsFacade.ts
|
|
4724
|
-
var
|
|
4794
|
+
var BASE23 = "/api/v1/externalauths";
|
|
4725
4795
|
var ExternalAuthsFacade = class {
|
|
4726
4796
|
constructor(http) {
|
|
4727
4797
|
this.http = http;
|
|
@@ -4731,7 +4801,7 @@ var ExternalAuthsFacade = class {
|
|
|
4731
4801
|
add(body, options) {
|
|
4732
4802
|
return this.http.requestJson({
|
|
4733
4803
|
method: "POST",
|
|
4734
|
-
path:
|
|
4804
|
+
path: BASE23,
|
|
4735
4805
|
body,
|
|
4736
4806
|
signal: options?.signal
|
|
4737
4807
|
});
|
|
@@ -4740,7 +4810,7 @@ var ExternalAuthsFacade = class {
|
|
|
4740
4810
|
getById(torrowId, options) {
|
|
4741
4811
|
return this.http.requestJson({
|
|
4742
4812
|
method: "GET",
|
|
4743
|
-
path: `${
|
|
4813
|
+
path: `${BASE23}/${encodePathSegment(torrowId)}`,
|
|
4744
4814
|
query: { includeDeleted: options?.includeDeleted },
|
|
4745
4815
|
signal: options?.signal
|
|
4746
4816
|
});
|
|
@@ -4750,7 +4820,7 @@ var ExternalAuthsFacade = class {
|
|
|
4750
4820
|
const { signal, ...rest } = options ?? {};
|
|
4751
4821
|
return this.http.requestJson({
|
|
4752
4822
|
method: "GET",
|
|
4753
|
-
path: `${
|
|
4823
|
+
path: `${BASE23}/all`,
|
|
4754
4824
|
query: { ...rest },
|
|
4755
4825
|
signal
|
|
4756
4826
|
});
|
|
@@ -4759,7 +4829,7 @@ var ExternalAuthsFacade = class {
|
|
|
4759
4829
|
async delete(externalAuthId, options) {
|
|
4760
4830
|
const resp = await this.http.requestJson({
|
|
4761
4831
|
method: "DELETE",
|
|
4762
|
-
path: `${
|
|
4832
|
+
path: `${BASE23}/${encodePathSegment(externalAuthId)}`,
|
|
4763
4833
|
query: {
|
|
4764
4834
|
versionToCheck: options?.versionToCheck,
|
|
4765
4835
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4771,7 +4841,7 @@ var ExternalAuthsFacade = class {
|
|
|
4771
4841
|
};
|
|
4772
4842
|
|
|
4773
4843
|
// ../../src/resources/id-generator/IdGeneratorFacade.ts
|
|
4774
|
-
var
|
|
4844
|
+
var BASE24 = "/api/v1/idgenerator";
|
|
4775
4845
|
var IdGeneratorFacade = class {
|
|
4776
4846
|
constructor(http) {
|
|
4777
4847
|
this.http = http;
|
|
@@ -4780,7 +4850,7 @@ var IdGeneratorFacade = class {
|
|
|
4780
4850
|
async getNextId(objectType, options) {
|
|
4781
4851
|
const resp = await this.http.requestJson({
|
|
4782
4852
|
method: "GET",
|
|
4783
|
-
path: `${
|
|
4853
|
+
path: `${BASE24}/${encodePathSegment(String(objectType))}`,
|
|
4784
4854
|
signal: options?.signal
|
|
4785
4855
|
});
|
|
4786
4856
|
return unwrapTorrowId(resp);
|
|
@@ -4788,7 +4858,7 @@ var IdGeneratorFacade = class {
|
|
|
4788
4858
|
};
|
|
4789
4859
|
|
|
4790
4860
|
// ../../src/resources/integrations/IntegrationsFacade.ts
|
|
4791
|
-
var
|
|
4861
|
+
var BASE25 = "/api/v1/integrations";
|
|
4792
4862
|
var IntegrationsFacade = class {
|
|
4793
4863
|
constructor(http) {
|
|
4794
4864
|
this.http = http;
|
|
@@ -4798,16 +4868,17 @@ var IntegrationsFacade = class {
|
|
|
4798
4868
|
create(body, options) {
|
|
4799
4869
|
return this.http.requestJson({
|
|
4800
4870
|
method: "POST",
|
|
4801
|
-
path:
|
|
4871
|
+
path: BASE25,
|
|
4802
4872
|
body,
|
|
4803
4873
|
signal: options?.signal
|
|
4804
4874
|
});
|
|
4805
4875
|
}
|
|
4806
|
-
/** `PUT /api/v1/integrations/{
|
|
4807
|
-
update(body,
|
|
4876
|
+
/** `PUT /api/v1/integrations/{body.id}` */
|
|
4877
|
+
update(body, options) {
|
|
4878
|
+
const itemId = requireItemUpdateId(body, "Integration");
|
|
4808
4879
|
return this.http.requestJson({
|
|
4809
4880
|
method: "PUT",
|
|
4810
|
-
path: `${
|
|
4881
|
+
path: `${BASE25}/${encodePathSegment(itemId)}`,
|
|
4811
4882
|
query: { checkVersion: options?.checkVersion },
|
|
4812
4883
|
body,
|
|
4813
4884
|
signal: options?.signal
|
|
@@ -4817,7 +4888,7 @@ var IntegrationsFacade = class {
|
|
|
4817
4888
|
list(options) {
|
|
4818
4889
|
return this.http.requestJson({
|
|
4819
4890
|
method: "GET",
|
|
4820
|
-
path: `${
|
|
4891
|
+
path: `${BASE25}/list`,
|
|
4821
4892
|
query: {
|
|
4822
4893
|
integrationIds: options?.integrationIds,
|
|
4823
4894
|
includeDeleted: options?.includeDeleted
|
|
@@ -4829,7 +4900,7 @@ var IntegrationsFacade = class {
|
|
|
4829
4900
|
async delete(integrationId, options) {
|
|
4830
4901
|
const resp = await this.http.requestJson({
|
|
4831
4902
|
method: "DELETE",
|
|
4832
|
-
path: `${
|
|
4903
|
+
path: `${BASE25}/${encodePathSegment(integrationId)}`,
|
|
4833
4904
|
query: {
|
|
4834
4905
|
versionToCheck: options?.versionToCheck,
|
|
4835
4906
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4841,7 +4912,7 @@ var IntegrationsFacade = class {
|
|
|
4841
4912
|
};
|
|
4842
4913
|
|
|
4843
4914
|
// ../../src/resources/item/ItemFacade.ts
|
|
4844
|
-
var
|
|
4915
|
+
var BASE26 = "/api/v1/item";
|
|
4845
4916
|
var ItemFacade = class {
|
|
4846
4917
|
constructor(http) {
|
|
4847
4918
|
this.http = http;
|
|
@@ -4855,7 +4926,7 @@ var ItemFacade = class {
|
|
|
4855
4926
|
activateShareItemSession(shareItemSessionId, options) {
|
|
4856
4927
|
return this.http.requestJson({
|
|
4857
4928
|
method: "PUT",
|
|
4858
|
-
path: `${
|
|
4929
|
+
path: `${BASE26}/activateshareitemsession/${encodePathSegment(shareItemSessionId)}`,
|
|
4859
4930
|
query: { userProfileId: options?.userProfileId, code: options?.code },
|
|
4860
4931
|
signal: options?.signal
|
|
4861
4932
|
});
|
|
@@ -4864,7 +4935,7 @@ var ItemFacade = class {
|
|
|
4864
4935
|
getByUniqueName(uniqueName, options) {
|
|
4865
4936
|
return this.http.requestJson({
|
|
4866
4937
|
method: "GET",
|
|
4867
|
-
path: `${
|
|
4938
|
+
path: `${BASE26}/uniquename/${encodePathSegment(uniqueName)}`,
|
|
4868
4939
|
signal: options?.signal
|
|
4869
4940
|
});
|
|
4870
4941
|
}
|
|
@@ -4872,7 +4943,7 @@ var ItemFacade = class {
|
|
|
4872
4943
|
getUserFeedback(torrowId, options) {
|
|
4873
4944
|
return this.http.requestJson({
|
|
4874
4945
|
method: "GET",
|
|
4875
|
-
path: `${
|
|
4946
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/userfeedback`,
|
|
4876
4947
|
query: {
|
|
4877
4948
|
throwExceptionIfNotFound: options?.throwExceptionIfNotFound,
|
|
4878
4949
|
versionToCheck: options?.versionToCheck,
|
|
@@ -4886,7 +4957,7 @@ var ItemFacade = class {
|
|
|
4886
4957
|
const { signal, ...query } = options ?? {};
|
|
4887
4958
|
return this.http.requestJson({
|
|
4888
4959
|
method: "PUT",
|
|
4889
|
-
path: `${
|
|
4960
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/userfeedback`,
|
|
4890
4961
|
query: { ...query },
|
|
4891
4962
|
signal
|
|
4892
4963
|
});
|
|
@@ -4896,7 +4967,7 @@ var ItemFacade = class {
|
|
|
4896
4967
|
const { signal, ...query } = options ?? {};
|
|
4897
4968
|
const resp = await this.http.requestJson({
|
|
4898
4969
|
method: "DELETE",
|
|
4899
|
-
path: `${
|
|
4970
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/userfeedback`,
|
|
4900
4971
|
query: { ...query },
|
|
4901
4972
|
signal
|
|
4902
4973
|
});
|
|
@@ -4907,7 +4978,7 @@ var ItemFacade = class {
|
|
|
4907
4978
|
const { signal, ...query } = options ?? {};
|
|
4908
4979
|
return this.http.requestJson({
|
|
4909
4980
|
method: "GET",
|
|
4910
|
-
path: `${
|
|
4981
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks`,
|
|
4911
4982
|
query: { ...query },
|
|
4912
4983
|
signal
|
|
4913
4984
|
});
|
|
@@ -4917,7 +4988,7 @@ var ItemFacade = class {
|
|
|
4917
4988
|
const { signal, ...query } = options ?? {};
|
|
4918
4989
|
return this.http.requestJson({
|
|
4919
4990
|
method: "POST",
|
|
4920
|
-
path: `${
|
|
4991
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/newmessage`,
|
|
4921
4992
|
query: { ...query },
|
|
4922
4993
|
signal
|
|
4923
4994
|
});
|
|
@@ -4926,7 +4997,7 @@ var ItemFacade = class {
|
|
|
4926
4997
|
getFeedback(torrowId, messageId, options) {
|
|
4927
4998
|
return this.http.requestJson({
|
|
4928
4999
|
method: "GET",
|
|
4929
|
-
path: `${
|
|
5000
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/${encodePathSegment(messageId)}`,
|
|
4930
5001
|
query: {
|
|
4931
5002
|
versionToCheck: options?.versionToCheck,
|
|
4932
5003
|
includeDeleted: options?.includeDeleted
|
|
@@ -4939,7 +5010,7 @@ var ItemFacade = class {
|
|
|
4939
5010
|
const { signal, ...query } = options ?? {};
|
|
4940
5011
|
return this.http.requestJson({
|
|
4941
5012
|
method: "PUT",
|
|
4942
|
-
path: `${
|
|
5013
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/${encodePathSegment(messageId)}`,
|
|
4943
5014
|
query: { ...query },
|
|
4944
5015
|
signal
|
|
4945
5016
|
});
|
|
@@ -4948,7 +5019,7 @@ var ItemFacade = class {
|
|
|
4948
5019
|
async deleteFeedback(torrowId, messageId, options) {
|
|
4949
5020
|
const resp = await this.http.requestJson({
|
|
4950
5021
|
method: "DELETE",
|
|
4951
|
-
path: `${
|
|
5022
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/${encodePathSegment(messageId)}`,
|
|
4952
5023
|
query: {
|
|
4953
5024
|
versionToCheck: options?.versionToCheck,
|
|
4954
5025
|
isNeedAnnouncement: options?.isNeedAnnouncement
|
|
@@ -4962,17 +5033,17 @@ var ItemFacade = class {
|
|
|
4962
5033
|
const { signal, ...query } = options ?? {};
|
|
4963
5034
|
return this.http.requestJson({
|
|
4964
5035
|
method: "POST",
|
|
4965
|
-
path: `${
|
|
5036
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/${encodePathSegment(messageId)}/reply`,
|
|
4966
5037
|
query: { ...query },
|
|
4967
5038
|
signal
|
|
4968
5039
|
});
|
|
4969
5040
|
}
|
|
4970
|
-
/** `GET /api/v1/item/{torrowId}/feedbacks/{messageId}/replies` */
|
|
5041
|
+
/** `GET /api/v1/item/{torrowId}/feedbacks/{messageId}/replies` — массив **`Feedback`** (не `ItemFeedback`). */
|
|
4971
5042
|
listFeedbackReplies(torrowId, messageId, options) {
|
|
4972
5043
|
const { signal, ...query } = options ?? {};
|
|
4973
5044
|
return this.http.requestJson({
|
|
4974
5045
|
method: "GET",
|
|
4975
|
-
path: `${
|
|
5046
|
+
path: `${BASE26}/${encodePathSegment(torrowId)}/feedbacks/${encodePathSegment(messageId)}/replies`,
|
|
4976
5047
|
query: { ...query },
|
|
4977
5048
|
signal
|
|
4978
5049
|
});
|
|
@@ -4980,7 +5051,7 @@ var ItemFacade = class {
|
|
|
4980
5051
|
};
|
|
4981
5052
|
|
|
4982
5053
|
// ../../src/resources/short-url/ShortUrlFacade.ts
|
|
4983
|
-
var
|
|
5054
|
+
var BASE27 = "/api/v1/u";
|
|
4984
5055
|
var ShortUrlFacade = class {
|
|
4985
5056
|
constructor(http, config) {
|
|
4986
5057
|
this.http = http;
|
|
@@ -4992,7 +5063,7 @@ var ShortUrlFacade = class {
|
|
|
4992
5063
|
getFull(shortUrl, options) {
|
|
4993
5064
|
return this.http.requestJson({
|
|
4994
5065
|
method: "GET",
|
|
4995
|
-
path: `${
|
|
5066
|
+
path: `${BASE27}/${encodePathSegment(shortUrl)}/full`,
|
|
4996
5067
|
signal: options?.signal
|
|
4997
5068
|
});
|
|
4998
5069
|
}
|
|
@@ -5003,7 +5074,7 @@ var ShortUrlFacade = class {
|
|
|
5003
5074
|
async getRedirectLocation(shortUrl, options) {
|
|
5004
5075
|
const fetchFn = this.config.fetch ?? globalThis.fetch;
|
|
5005
5076
|
const origin = this.config.baseUrl ?? DEFAULT_TORROW_API_BASE_URL;
|
|
5006
|
-
const url = joinBaseUrlAndPath(origin, `${
|
|
5077
|
+
const url = joinBaseUrlAndPath(origin, `${BASE27}/${encodePathSegment(shortUrl)}`);
|
|
5007
5078
|
const authHeaders = await buildAuthHeaders(this.config);
|
|
5008
5079
|
const res = await fetchFn(url, {
|
|
5009
5080
|
method: "GET",
|
|
@@ -5020,7 +5091,7 @@ var ShortUrlFacade = class {
|
|
|
5020
5091
|
};
|
|
5021
5092
|
|
|
5022
5093
|
// ../../src/resources/thesaurus/ThesaurusFacade.ts
|
|
5023
|
-
var
|
|
5094
|
+
var BASE28 = "/api/v1/thesaurus";
|
|
5024
5095
|
var ThesaurusFacade = class {
|
|
5025
5096
|
constructor(http) {
|
|
5026
5097
|
this.http = http;
|
|
@@ -5031,7 +5102,7 @@ var ThesaurusFacade = class {
|
|
|
5031
5102
|
const { signal, ...query } = options ?? {};
|
|
5032
5103
|
return this.http.requestJson({
|
|
5033
5104
|
method: "GET",
|
|
5034
|
-
path: `${
|
|
5105
|
+
path: `${BASE28}/places`,
|
|
5035
5106
|
query: { ...query },
|
|
5036
5107
|
signal
|
|
5037
5108
|
});
|
|
@@ -5041,7 +5112,7 @@ var ThesaurusFacade = class {
|
|
|
5041
5112
|
const { signal, ...query } = options ?? {};
|
|
5042
5113
|
return this.http.requestJson({
|
|
5043
5114
|
method: "GET",
|
|
5044
|
-
path: `${
|
|
5115
|
+
path: `${BASE28}/hobbies`,
|
|
5045
5116
|
query: { ...query },
|
|
5046
5117
|
signal
|
|
5047
5118
|
});
|
|
@@ -5467,6 +5538,176 @@ var CommunicationTypeValues = {
|
|
|
5467
5538
|
Max: "Max",
|
|
5468
5539
|
Other: "Other"
|
|
5469
5540
|
};
|
|
5541
|
+
var ProfileTypeValues = {
|
|
5542
|
+
Unknown: "UnknownProfile",
|
|
5543
|
+
None: "None",
|
|
5544
|
+
MyProfile: "MyProfile",
|
|
5545
|
+
AnyProfile: "AnyProfile",
|
|
5546
|
+
CopyProfile: "CopyProfile"
|
|
5547
|
+
};
|
|
5548
|
+
|
|
5549
|
+
// ../../src/resources/contacts/communication-links.ts
|
|
5550
|
+
function digitsOnly(value) {
|
|
5551
|
+
return value.replace(/\D+/g, "");
|
|
5552
|
+
}
|
|
5553
|
+
function looksLikeUrl(value) {
|
|
5554
|
+
return /^https?:\/\//i.test(value) || value.includes(".");
|
|
5555
|
+
}
|
|
5556
|
+
function removeFirstAt(value) {
|
|
5557
|
+
return value.replace(/^@/, "");
|
|
5558
|
+
}
|
|
5559
|
+
function ensureHttpUrl(value) {
|
|
5560
|
+
return /^[a-z][a-z0-9+.-]*:/i.test(value) ? value : `https://${value}`;
|
|
5561
|
+
}
|
|
5562
|
+
function getDomain(url) {
|
|
5563
|
+
if (!url?.trim()) {
|
|
5564
|
+
return void 0;
|
|
5565
|
+
}
|
|
5566
|
+
const withScheme = /^[a-z][a-z0-9+.-]*:/i.test(url) ? url : `https://${url}`;
|
|
5567
|
+
const match = withScheme.match(/:\/\/(www[0-9]?\.)?([^/:]+)/i);
|
|
5568
|
+
const hostName = match?.[2];
|
|
5569
|
+
if (!hostName) {
|
|
5570
|
+
return void 0;
|
|
5571
|
+
}
|
|
5572
|
+
const parts = hostName.split(".").reverse();
|
|
5573
|
+
if (parts.length > 1) {
|
|
5574
|
+
let domain = `${parts[1]}.${parts[0]}`;
|
|
5575
|
+
if (hostName.toLowerCase().includes(".co.uk") && parts.length > 2) {
|
|
5576
|
+
domain = `${parts[2]}.${domain}`;
|
|
5577
|
+
}
|
|
5578
|
+
return domain;
|
|
5579
|
+
}
|
|
5580
|
+
return hostName;
|
|
5581
|
+
}
|
|
5582
|
+
function websiteBrandFromDomain(domain) {
|
|
5583
|
+
switch ((domain ?? "").toLowerCase()) {
|
|
5584
|
+
case "youtube.com":
|
|
5585
|
+
case "youtu.be":
|
|
5586
|
+
return "youtube";
|
|
5587
|
+
case "vk.com":
|
|
5588
|
+
return "vkontakte";
|
|
5589
|
+
case "ok.ru":
|
|
5590
|
+
return "odnoklassniki";
|
|
5591
|
+
case "facebook.com":
|
|
5592
|
+
case "fb.com":
|
|
5593
|
+
case "fb.me":
|
|
5594
|
+
return "facebook";
|
|
5595
|
+
case "twitter.com":
|
|
5596
|
+
case "x.com":
|
|
5597
|
+
return "twitter";
|
|
5598
|
+
case "instagram.com":
|
|
5599
|
+
case "instagr.am":
|
|
5600
|
+
case "instagr.com":
|
|
5601
|
+
return "instagram";
|
|
5602
|
+
case "linkedin.com":
|
|
5603
|
+
case "linked.in":
|
|
5604
|
+
case "lnkd.in":
|
|
5605
|
+
return "linkedin";
|
|
5606
|
+
case "zoom.us":
|
|
5607
|
+
return "zoom";
|
|
5608
|
+
default:
|
|
5609
|
+
return null;
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
function communicationHref(comm) {
|
|
5613
|
+
const value = comm.value?.trim() ?? "";
|
|
5614
|
+
if (!value) {
|
|
5615
|
+
return null;
|
|
5616
|
+
}
|
|
5617
|
+
const digits = digitsOnly(comm.valueForSearch?.trim() || value);
|
|
5618
|
+
switch (comm.type) {
|
|
5619
|
+
case "Phone":
|
|
5620
|
+
return digits ? `tel:${digits}` : `tel:${value}`;
|
|
5621
|
+
case "Sms":
|
|
5622
|
+
return digits ? `sms:${digits}` : `sms:${value}`;
|
|
5623
|
+
case "Email":
|
|
5624
|
+
return `mailto:${value}`;
|
|
5625
|
+
case "WebSite":
|
|
5626
|
+
return ensureHttpUrl(value);
|
|
5627
|
+
case "Telegram":
|
|
5628
|
+
if (/^https?:\/\//i.test(value) || /^tg:/i.test(value)) {
|
|
5629
|
+
return value;
|
|
5630
|
+
}
|
|
5631
|
+
return `https://telegram.me/${removeFirstAt(value)}`;
|
|
5632
|
+
case "WhatsApp":
|
|
5633
|
+
return digits ? `https://wa.me/${digits}` : null;
|
|
5634
|
+
case "Viber":
|
|
5635
|
+
return digits ? `viber://add?number=${digits}` : null;
|
|
5636
|
+
case "Skype":
|
|
5637
|
+
return `skype:${removeFirstAt(value)}?call`;
|
|
5638
|
+
case "Max":
|
|
5639
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5640
|
+
return value;
|
|
5641
|
+
}
|
|
5642
|
+
return `https://max.ru/${removeFirstAt(value)}`;
|
|
5643
|
+
case "Vkontakte":
|
|
5644
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5645
|
+
return value;
|
|
5646
|
+
}
|
|
5647
|
+
return `https://vk.com/${removeFirstAt(value)}`;
|
|
5648
|
+
case "Facebook":
|
|
5649
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5650
|
+
return value;
|
|
5651
|
+
}
|
|
5652
|
+
return `https://www.facebook.com/${removeFirstAt(value)}`;
|
|
5653
|
+
case "Instagram":
|
|
5654
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5655
|
+
return value;
|
|
5656
|
+
}
|
|
5657
|
+
return `https://www.instagram.com/${removeFirstAt(value)}`;
|
|
5658
|
+
case "Odnoklassniki":
|
|
5659
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5660
|
+
return value;
|
|
5661
|
+
}
|
|
5662
|
+
return `https://ok.ru/${removeFirstAt(value)}`;
|
|
5663
|
+
case "Twitter":
|
|
5664
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5665
|
+
return value;
|
|
5666
|
+
}
|
|
5667
|
+
return `https://twitter.com/${removeFirstAt(value)}`;
|
|
5668
|
+
case "LinkedIn":
|
|
5669
|
+
if (/^https?:\/\//i.test(value)) {
|
|
5670
|
+
return value;
|
|
5671
|
+
}
|
|
5672
|
+
return `https://www.linkedin.com/in/${removeFirstAt(value)}`;
|
|
5673
|
+
case "Youtube":
|
|
5674
|
+
return ensureHttpUrl(value);
|
|
5675
|
+
default:
|
|
5676
|
+
return looksLikeUrl(value) ? ensureHttpUrl(value) : null;
|
|
5677
|
+
}
|
|
5678
|
+
}
|
|
5679
|
+
function resolveCommunicationBrand(comm) {
|
|
5680
|
+
switch (comm.type) {
|
|
5681
|
+
case "Telegram":
|
|
5682
|
+
return "telegram";
|
|
5683
|
+
case "WhatsApp":
|
|
5684
|
+
return "whatsapp";
|
|
5685
|
+
case "Viber":
|
|
5686
|
+
return "viber";
|
|
5687
|
+
case "Skype":
|
|
5688
|
+
return "skype";
|
|
5689
|
+
case "Max":
|
|
5690
|
+
return "max";
|
|
5691
|
+
case "Youtube":
|
|
5692
|
+
return "youtube";
|
|
5693
|
+
case "Vkontakte":
|
|
5694
|
+
return "vkontakte";
|
|
5695
|
+
case "Facebook":
|
|
5696
|
+
return "facebook";
|
|
5697
|
+
case "Odnoklassniki":
|
|
5698
|
+
return "odnoklassniki";
|
|
5699
|
+
case "Twitter":
|
|
5700
|
+
return "twitter";
|
|
5701
|
+
case "LinkedIn":
|
|
5702
|
+
return "linkedin";
|
|
5703
|
+
case "Instagram":
|
|
5704
|
+
return "instagram";
|
|
5705
|
+
case "WebSite":
|
|
5706
|
+
return websiteBrandFromDomain(getDomain(comm.value?.trim()));
|
|
5707
|
+
default:
|
|
5708
|
+
return websiteBrandFromDomain(getDomain(comm.value?.trim()));
|
|
5709
|
+
}
|
|
5710
|
+
}
|
|
5470
5711
|
|
|
5471
5712
|
// ../../src/resources/reports/types.ts
|
|
5472
5713
|
var TimeSplitTypeValues = {
|
|
@@ -5521,6 +5762,101 @@ var LoyaltyCardSortConditionValues = {
|
|
|
5521
5762
|
LoyaltyCardStateDescSequenceCardNumberDesc: "LoyaltyCardStateDescSequenceCardNumberDesc"
|
|
5522
5763
|
};
|
|
5523
5764
|
|
|
5765
|
+
// ../../src/resources/services/types.ts
|
|
5766
|
+
var SessionDurationTypeValues = {
|
|
5767
|
+
Unknown: "UnknownSessionDurationType",
|
|
5768
|
+
None: "SessionDurationNone",
|
|
5769
|
+
Custom: "Custom",
|
|
5770
|
+
Constant: "Constant",
|
|
5771
|
+
Sum: "Sum"
|
|
5772
|
+
};
|
|
5773
|
+
var TimeSelectionTypeValues = {
|
|
5774
|
+
Unknown: "UnknownTimeSelectionType",
|
|
5775
|
+
None: "TimeSelectionNone",
|
|
5776
|
+
Consumer: "Consumer",
|
|
5777
|
+
Executor: "Executor"
|
|
5778
|
+
};
|
|
5779
|
+
var StateManagementTypeValues = {
|
|
5780
|
+
Unknown: "UnknownStateManagementType",
|
|
5781
|
+
Auto: "Auto",
|
|
5782
|
+
Manual: "Manual"
|
|
5783
|
+
};
|
|
5784
|
+
var SessionPrecisionTypeValues = {
|
|
5785
|
+
Unknown: "UnknownSessionPrecisionType",
|
|
5786
|
+
None: "SessionPrecisionNone",
|
|
5787
|
+
DateTime: "DateTime",
|
|
5788
|
+
Date: "Date"
|
|
5789
|
+
};
|
|
5790
|
+
|
|
5791
|
+
// ../../src/resources/services/service-type-preset.ts
|
|
5792
|
+
var ServiceType = {
|
|
5793
|
+
Appeal: "Appeal",
|
|
5794
|
+
RegisterOnTime: "RegisterOnTime",
|
|
5795
|
+
OrderOnTime: "OrderOnTime",
|
|
5796
|
+
Rent: "Rent",
|
|
5797
|
+
AutoRent: "AutoRent",
|
|
5798
|
+
Custom: "Custom"
|
|
5799
|
+
};
|
|
5800
|
+
var ServiceTypePresetValues = {
|
|
5801
|
+
Appeal: ServiceType.Appeal,
|
|
5802
|
+
RegisterOnTime: ServiceType.RegisterOnTime,
|
|
5803
|
+
OrderOnTime: ServiceType.OrderOnTime,
|
|
5804
|
+
Rent: ServiceType.Rent,
|
|
5805
|
+
AutoRent: ServiceType.AutoRent
|
|
5806
|
+
};
|
|
5807
|
+
var serviceSessionDurationPresets = {
|
|
5808
|
+
[ServiceType.Appeal]: {
|
|
5809
|
+
sessionDurationType: SessionDurationTypeValues.None,
|
|
5810
|
+
timeSelectionType: TimeSelectionTypeValues.None,
|
|
5811
|
+
stateManagementType: StateManagementTypeValues.Manual
|
|
5812
|
+
},
|
|
5813
|
+
[ServiceType.RegisterOnTime]: {
|
|
5814
|
+
sessionDurationType: SessionDurationTypeValues.Sum,
|
|
5815
|
+
timeSelectionType: TimeSelectionTypeValues.Consumer,
|
|
5816
|
+
stateManagementType: StateManagementTypeValues.Auto
|
|
5817
|
+
},
|
|
5818
|
+
[ServiceType.OrderOnTime]: {
|
|
5819
|
+
sessionDurationType: SessionDurationTypeValues.Sum,
|
|
5820
|
+
timeSelectionType: TimeSelectionTypeValues.Consumer,
|
|
5821
|
+
stateManagementType: StateManagementTypeValues.Manual
|
|
5822
|
+
},
|
|
5823
|
+
[ServiceType.Rent]: {
|
|
5824
|
+
sessionDurationType: SessionDurationTypeValues.Custom,
|
|
5825
|
+
timeSelectionType: TimeSelectionTypeValues.Consumer,
|
|
5826
|
+
stateManagementType: StateManagementTypeValues.Manual
|
|
5827
|
+
},
|
|
5828
|
+
[ServiceType.AutoRent]: {
|
|
5829
|
+
sessionDurationType: SessionDurationTypeValues.Custom,
|
|
5830
|
+
timeSelectionType: TimeSelectionTypeValues.Consumer,
|
|
5831
|
+
stateManagementType: StateManagementTypeValues.Auto
|
|
5832
|
+
}
|
|
5833
|
+
};
|
|
5834
|
+
function createServiceSessionDurationProperties(type, options) {
|
|
5835
|
+
const preset = serviceSessionDurationPresets[type];
|
|
5836
|
+
if (!preset) {
|
|
5837
|
+
throw new TypeError(`Unknown service type: ${String(type)}`);
|
|
5838
|
+
}
|
|
5839
|
+
return {
|
|
5840
|
+
...options,
|
|
5841
|
+
sessionPrecisionType: options?.sessionPrecisionType ?? SessionPrecisionTypeValues.DateTime,
|
|
5842
|
+
...preset
|
|
5843
|
+
};
|
|
5844
|
+
}
|
|
5845
|
+
function getServiceTypeFromSessionDurationProperties(properties) {
|
|
5846
|
+
if (!properties) {
|
|
5847
|
+
return ServiceType.Custom;
|
|
5848
|
+
}
|
|
5849
|
+
for (const [type, preset] of Object.entries(serviceSessionDurationPresets)) {
|
|
5850
|
+
if (properties.sessionDurationType === preset.sessionDurationType && properties.timeSelectionType === preset.timeSelectionType && properties.stateManagementType === preset.stateManagementType) {
|
|
5851
|
+
return type;
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5854
|
+
return ServiceType.Custom;
|
|
5855
|
+
}
|
|
5856
|
+
function getServiceType(service) {
|
|
5857
|
+
return getServiceTypeFromSessionDurationProperties(service.sessionDurationProperties);
|
|
5858
|
+
}
|
|
5859
|
+
|
|
5524
5860
|
// ../../src/resources/services/booking-wizard-hints.ts
|
|
5525
5861
|
var ServiceCheckInWizardStepType = {
|
|
5526
5862
|
Unknown: 0,
|
|
@@ -5534,6 +5870,12 @@ var ServiceCheckInWizardStepParameterName = {
|
|
|
5534
5870
|
ResourceGroupId: "ResourceGroupId",
|
|
5535
5871
|
AutoChoiceResource: "AutoChoiceResource"
|
|
5536
5872
|
};
|
|
5873
|
+
var TimeStepUiModeValues = {
|
|
5874
|
+
SelectDate: "selectDate",
|
|
5875
|
+
SelectDateRange: "selectDateRange",
|
|
5876
|
+
SelectTimeBegin: "selectTimeBegin",
|
|
5877
|
+
SelectTime: "selectTime"
|
|
5878
|
+
};
|
|
5537
5879
|
function sortStepDescriptionsByOrder(list) {
|
|
5538
5880
|
if (!list?.length) {
|
|
5539
5881
|
return [];
|
|
@@ -5558,17 +5900,280 @@ function getTimeStepUiMode(session) {
|
|
|
5558
5900
|
const isSelectDateAndTimeBegin = sessionPrecisionType === "DateTime" && sessionDurationType !== "SessionDurationNone" && sessionDurationType !== "Custom";
|
|
5559
5901
|
const isSelectDateRangeAndTimeBeginAndTimeEnd = sessionPrecisionType === "DateTime" && sessionDurationType === "Custom";
|
|
5560
5902
|
if (isSelectDate) {
|
|
5561
|
-
return
|
|
5903
|
+
return TimeStepUiModeValues.SelectDate;
|
|
5562
5904
|
}
|
|
5563
5905
|
if (isSelectDateRange) {
|
|
5564
|
-
return
|
|
5906
|
+
return TimeStepUiModeValues.SelectDateRange;
|
|
5565
5907
|
}
|
|
5566
5908
|
if (isSelectDateAndTimeBegin || isSelectDateRangeAndTimeBeginAndTimeEnd) {
|
|
5567
|
-
return
|
|
5909
|
+
return TimeStepUiModeValues.SelectTimeBegin;
|
|
5568
5910
|
}
|
|
5569
|
-
return
|
|
5911
|
+
return TimeStepUiModeValues.SelectTime;
|
|
5570
5912
|
}
|
|
5571
5913
|
|
|
5914
|
+
// ../../src/resources/services/service-builder.ts
|
|
5915
|
+
var RESOURCE_USAGE_TYPES = /* @__PURE__ */ new Set(["Specification", "Rent", "Sale"]);
|
|
5916
|
+
var GROUP_ID_PATTERN = /^[0-9a-f]{24}$/i;
|
|
5917
|
+
var SESSION_DURATION_TYPES = new Set(Object.values(SessionDurationTypeValues));
|
|
5918
|
+
var TIME_SELECTION_TYPES = new Set(Object.values(TimeSelectionTypeValues));
|
|
5919
|
+
var STATE_MANAGEMENT_TYPES = new Set(Object.values(StateManagementTypeValues));
|
|
5920
|
+
function cloneValue(value) {
|
|
5921
|
+
if (value instanceof Date) {
|
|
5922
|
+
return new Date(value.getTime());
|
|
5923
|
+
}
|
|
5924
|
+
if (Array.isArray(value)) {
|
|
5925
|
+
return value.map((item) => cloneValue(item));
|
|
5926
|
+
}
|
|
5927
|
+
if (value && typeof value === "object") {
|
|
5928
|
+
const result = {};
|
|
5929
|
+
for (const [key, item] of Object.entries(value)) {
|
|
5930
|
+
result[key] = cloneValue(item);
|
|
5931
|
+
}
|
|
5932
|
+
return result;
|
|
5933
|
+
}
|
|
5934
|
+
return value;
|
|
5935
|
+
}
|
|
5936
|
+
function generateServiceResourceGroupId() {
|
|
5937
|
+
const bytes = new Uint8Array(12);
|
|
5938
|
+
const cryptoObject = globalThis.crypto;
|
|
5939
|
+
if (cryptoObject?.getRandomValues) {
|
|
5940
|
+
cryptoObject.getRandomValues(bytes);
|
|
5941
|
+
} else {
|
|
5942
|
+
for (let index = 0; index < bytes.length; index += 1) {
|
|
5943
|
+
bytes[index] = Math.floor(Math.random() * 256);
|
|
5944
|
+
}
|
|
5945
|
+
}
|
|
5946
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
5947
|
+
}
|
|
5948
|
+
function normalizeSteps(steps) {
|
|
5949
|
+
return steps.map((step, index) => ({ step, index })).sort((a, b) => {
|
|
5950
|
+
const aOrder = a.step.stepOrder;
|
|
5951
|
+
const bOrder = b.step.stepOrder;
|
|
5952
|
+
if (aOrder == null && bOrder == null) return a.index - b.index;
|
|
5953
|
+
if (aOrder == null) return 1;
|
|
5954
|
+
if (bOrder == null) return -1;
|
|
5955
|
+
return aOrder - bOrder || a.index - b.index;
|
|
5956
|
+
}).map(({ step }, index) => ({ ...step, stepOrder: index + 1 }));
|
|
5957
|
+
}
|
|
5958
|
+
function assertStepPosition(position, length) {
|
|
5959
|
+
if (position === void 0) return length + 1;
|
|
5960
|
+
if (!Number.isInteger(position) || position < 1 || position > length + 1) {
|
|
5961
|
+
throw new RangeError(`stepOrder must be an integer from 1 to ${length + 1}`);
|
|
5962
|
+
}
|
|
5963
|
+
return position;
|
|
5964
|
+
}
|
|
5965
|
+
var ServiceBuilder = class _ServiceBuilder {
|
|
5966
|
+
draft;
|
|
5967
|
+
addedGroups = /* @__PURE__ */ new Map();
|
|
5968
|
+
constructor(body) {
|
|
5969
|
+
this.draft = cloneValue(body);
|
|
5970
|
+
this.normalizeAndSyncOrders();
|
|
5971
|
+
}
|
|
5972
|
+
static create(body) {
|
|
5973
|
+
return new _ServiceBuilder(body);
|
|
5974
|
+
}
|
|
5975
|
+
static from(service) {
|
|
5976
|
+
return new _ServiceBuilder(service);
|
|
5977
|
+
}
|
|
5978
|
+
withType(type, options) {
|
|
5979
|
+
if (type === ServiceType.Custom) {
|
|
5980
|
+
throw new TypeError("ServiceType.Custom requires explicit sessionDurationProperties");
|
|
5981
|
+
}
|
|
5982
|
+
this.draft.sessionDurationProperties = createServiceSessionDurationProperties(type, options);
|
|
5983
|
+
return this;
|
|
5984
|
+
}
|
|
5985
|
+
withSessionDurationProperties(properties) {
|
|
5986
|
+
if (!properties.sessionDurationType || !SESSION_DURATION_TYPES.has(properties.sessionDurationType) || !properties.timeSelectionType || !TIME_SELECTION_TYPES.has(properties.timeSelectionType) || !properties.stateManagementType || !STATE_MANAGEMENT_TYPES.has(properties.stateManagementType)) {
|
|
5987
|
+
throw new TypeError(
|
|
5988
|
+
"sessionDurationProperties must include sessionDurationType, timeSelectionType, and stateManagementType"
|
|
5989
|
+
);
|
|
5990
|
+
}
|
|
5991
|
+
this.draft.sessionDurationProperties = cloneValue(properties);
|
|
5992
|
+
return this;
|
|
5993
|
+
}
|
|
5994
|
+
addResourceStep(input) {
|
|
5995
|
+
if (!RESOURCE_USAGE_TYPES.has(input.usageType)) {
|
|
5996
|
+
throw new TypeError(`Unsupported resource group usageType: ${String(input.usageType)}`);
|
|
5997
|
+
}
|
|
5998
|
+
const minResources = input.minResources ?? 1;
|
|
5999
|
+
const maxResources = input.maxResources ?? 1;
|
|
6000
|
+
if (input.autoChoiceResource === true && (minResources !== 1 || maxResources !== 1)) {
|
|
6001
|
+
throw new RangeError("autoChoiceResource requires exactly one resource");
|
|
6002
|
+
}
|
|
6003
|
+
const group = this.addResourceGroup(input, input.usageType);
|
|
6004
|
+
const groupId = group.groupId;
|
|
6005
|
+
const step = {
|
|
6006
|
+
stepType: ServiceCheckInWizardStepType.Resource,
|
|
6007
|
+
description: input.description,
|
|
6008
|
+
stepParameterList: [
|
|
6009
|
+
{
|
|
6010
|
+
parameterName: ServiceCheckInWizardStepParameterName.ResourceGroupId,
|
|
6011
|
+
parameterValue: groupId
|
|
6012
|
+
},
|
|
6013
|
+
{
|
|
6014
|
+
parameterName: ServiceCheckInWizardStepParameterName.AutoChoiceResource,
|
|
6015
|
+
parameterValue: String(input.autoChoiceResource ?? false)
|
|
6016
|
+
},
|
|
6017
|
+
{
|
|
6018
|
+
parameterName: ServiceCheckInWizardStepParameterName.HiddenStep,
|
|
6019
|
+
parameterValue: String(input.hiddenStep ?? false)
|
|
6020
|
+
},
|
|
6021
|
+
{
|
|
6022
|
+
parameterName: ServiceCheckInWizardStepParameterName.HideResourceDetail,
|
|
6023
|
+
parameterValue: String(input.hideResourceDetail ?? false)
|
|
6024
|
+
}
|
|
6025
|
+
]
|
|
6026
|
+
};
|
|
6027
|
+
this.insertStep(step, input.stepOrder);
|
|
6028
|
+
return this;
|
|
6029
|
+
}
|
|
6030
|
+
/** Добавляет платёжную группу без ресурсного шага; шаг оплаты добавляется отдельно. */
|
|
6031
|
+
addPaymentGroup(input) {
|
|
6032
|
+
this.addResourceGroup(input, "Payment");
|
|
6033
|
+
return this;
|
|
6034
|
+
}
|
|
6035
|
+
/** Заменяет список ресурсов существующей группы, например после создания платёжного ресурса. */
|
|
6036
|
+
setResourceGroupResourceIds(resourceGroupId, resourceIds) {
|
|
6037
|
+
const normalizedGroupId = resourceGroupId.trim();
|
|
6038
|
+
if (!normalizedGroupId) throw new TypeError("resourceGroupId must not be empty");
|
|
6039
|
+
const normalizedResourceIds = resourceIds.map((resourceId) => resourceId.trim());
|
|
6040
|
+
if (normalizedResourceIds.some((resourceId) => !resourceId)) {
|
|
6041
|
+
throw new TypeError("resourceIds must not contain empty ids");
|
|
6042
|
+
}
|
|
6043
|
+
if (new Set(normalizedResourceIds).size !== normalizedResourceIds.length) {
|
|
6044
|
+
throw new TypeError("resourceIds must not contain duplicates");
|
|
6045
|
+
}
|
|
6046
|
+
const groups = this.draft.resourceGroupList ?? [];
|
|
6047
|
+
if (!groups.some((group) => group.groupId === normalizedGroupId)) {
|
|
6048
|
+
throw new TypeError(`Service resource group not found: ${normalizedGroupId}`);
|
|
6049
|
+
}
|
|
6050
|
+
this.draft.resourceGroupList = groups.map(
|
|
6051
|
+
(group) => group.groupId === normalizedGroupId ? { ...group, resourceIdList: [...normalizedResourceIds] } : group
|
|
6052
|
+
);
|
|
6053
|
+
return this;
|
|
6054
|
+
}
|
|
6055
|
+
addTimeStep(options) {
|
|
6056
|
+
return this.addSingletonStep(ServiceCheckInWizardStepType.Time, options?.stepOrder);
|
|
6057
|
+
}
|
|
6058
|
+
addPaymentStep(options) {
|
|
6059
|
+
return this.addSingletonStep(ServiceCheckInWizardStepType.Payment, options?.stepOrder);
|
|
6060
|
+
}
|
|
6061
|
+
build() {
|
|
6062
|
+
this.normalizeAndSyncOrders();
|
|
6063
|
+
this.validateConfiguration();
|
|
6064
|
+
const resourceGroupIds = /* @__PURE__ */ Object.create(null);
|
|
6065
|
+
for (const [key, group] of this.addedGroups) {
|
|
6066
|
+
const current = this.draft.resourceGroupList?.find((item) => item.groupId === group.groupId);
|
|
6067
|
+
Object.defineProperty(resourceGroupIds, key, {
|
|
6068
|
+
value: current?.groupId ?? group.groupId,
|
|
6069
|
+
enumerable: true,
|
|
6070
|
+
configurable: true
|
|
6071
|
+
});
|
|
6072
|
+
}
|
|
6073
|
+
return { body: cloneValue(this.draft), resourceGroupIds };
|
|
6074
|
+
}
|
|
6075
|
+
addSingletonStep(stepType, stepOrder) {
|
|
6076
|
+
if (this.draft.stepDescriptionList?.some((step) => step.stepType === stepType)) {
|
|
6077
|
+
throw new TypeError(`Service already contains step type ${stepType}`);
|
|
6078
|
+
}
|
|
6079
|
+
this.insertStep({ stepType }, stepOrder);
|
|
6080
|
+
return this;
|
|
6081
|
+
}
|
|
6082
|
+
addResourceGroup(input, usageType) {
|
|
6083
|
+
const key = input.key.trim();
|
|
6084
|
+
const groupName = input.groupName.trim();
|
|
6085
|
+
if (!key) throw new TypeError("Resource group key must not be empty");
|
|
6086
|
+
if (!groupName) throw new TypeError("Resource group name must not be empty");
|
|
6087
|
+
if (this.addedGroups.has(key)) throw new TypeError(`Duplicate resource group key: ${key}`);
|
|
6088
|
+
const groupId = input.groupId ?? generateServiceResourceGroupId();
|
|
6089
|
+
if (!GROUP_ID_PATTERN.test(groupId)) {
|
|
6090
|
+
throw new TypeError("Resource group id must be a 24-character hexadecimal string");
|
|
6091
|
+
}
|
|
6092
|
+
const groups = [...this.draft.resourceGroupList ?? []];
|
|
6093
|
+
if (groups.some((group2) => group2.groupId === groupId)) {
|
|
6094
|
+
throw new TypeError(`Duplicate resource group id: ${groupId}`);
|
|
6095
|
+
}
|
|
6096
|
+
const minResources = input.minResources ?? 1;
|
|
6097
|
+
const maxResources = input.maxResources ?? 1;
|
|
6098
|
+
for (const [name, value] of [
|
|
6099
|
+
["minResources", minResources],
|
|
6100
|
+
["maxResources", maxResources],
|
|
6101
|
+
["maxTotalAmount", input.maxTotalAmount]
|
|
6102
|
+
]) {
|
|
6103
|
+
if (value != null && (!Number.isInteger(value) || value < 0)) {
|
|
6104
|
+
throw new RangeError(`${name} must be a non-negative integer`);
|
|
6105
|
+
}
|
|
6106
|
+
}
|
|
6107
|
+
if (minResources > maxResources) {
|
|
6108
|
+
throw new RangeError("minResources must not exceed maxResources");
|
|
6109
|
+
}
|
|
6110
|
+
const group = {
|
|
6111
|
+
groupId,
|
|
6112
|
+
groupName,
|
|
6113
|
+
usageType,
|
|
6114
|
+
minResources,
|
|
6115
|
+
maxResources,
|
|
6116
|
+
maxTotalAmount: input.maxTotalAmount,
|
|
6117
|
+
quickFilterTags: cloneValue(input.quickFilterTags),
|
|
6118
|
+
bookingProperties: cloneValue(input.bookingProperties ?? void 0)
|
|
6119
|
+
};
|
|
6120
|
+
this.draft.resourceGroupList = [...groups, group];
|
|
6121
|
+
this.addedGroups.set(key, cloneValue(group));
|
|
6122
|
+
return group;
|
|
6123
|
+
}
|
|
6124
|
+
insertStep(step, stepOrder) {
|
|
6125
|
+
const steps = normalizeSteps([...this.draft.stepDescriptionList ?? []]);
|
|
6126
|
+
const position = assertStepPosition(stepOrder, steps.length);
|
|
6127
|
+
steps.splice(position - 1, 0, step);
|
|
6128
|
+
this.draft.stepDescriptionList = steps.map((item, index) => ({
|
|
6129
|
+
...item,
|
|
6130
|
+
stepOrder: index + 1
|
|
6131
|
+
}));
|
|
6132
|
+
this.normalizeAndSyncOrders();
|
|
6133
|
+
}
|
|
6134
|
+
normalizeAndSyncOrders() {
|
|
6135
|
+
const hasSteps = this.draft.stepDescriptionList != null;
|
|
6136
|
+
const steps = normalizeSteps([...this.draft.stepDescriptionList ?? []]);
|
|
6137
|
+
if (hasSteps) this.draft.stepDescriptionList = steps;
|
|
6138
|
+
const orders = /* @__PURE__ */ new Map();
|
|
6139
|
+
for (const step of steps) {
|
|
6140
|
+
if (step.stepType === ServiceCheckInWizardStepType.Resource) {
|
|
6141
|
+
const groupId = getResourceGroupIdFromStep(step);
|
|
6142
|
+
if (groupId && step.stepOrder != null) orders.set(groupId, step.stepOrder);
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
if (this.draft.resourceGroupList != null) {
|
|
6146
|
+
this.draft.resourceGroupList = this.draft.resourceGroupList.map((group) => ({
|
|
6147
|
+
...group,
|
|
6148
|
+
order: group.groupId ? orders.get(group.groupId) ?? group.order : group.order
|
|
6149
|
+
}));
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
validateConfiguration() {
|
|
6153
|
+
const groups = this.draft.resourceGroupList ?? [];
|
|
6154
|
+
const ids = /* @__PURE__ */ new Set();
|
|
6155
|
+
for (const group of groups) {
|
|
6156
|
+
if (!group.groupId || !GROUP_ID_PATTERN.test(group.groupId)) {
|
|
6157
|
+
throw new TypeError("Every resource group must have a valid 24-character hexadecimal id");
|
|
6158
|
+
}
|
|
6159
|
+
if (ids.has(group.groupId)) throw new TypeError(`Duplicate resource group id: ${group.groupId}`);
|
|
6160
|
+
ids.add(group.groupId);
|
|
6161
|
+
}
|
|
6162
|
+
const usedIds = /* @__PURE__ */ new Set();
|
|
6163
|
+
for (const step of this.draft.stepDescriptionList ?? []) {
|
|
6164
|
+
if (step.stepType !== ServiceCheckInWizardStepType.Resource) continue;
|
|
6165
|
+
const groupId = getResourceGroupIdFromStep(step);
|
|
6166
|
+
if (!groupId || !ids.has(groupId)) {
|
|
6167
|
+
throw new TypeError(`Resource step references an unknown resource group: ${groupId ?? ""}`);
|
|
6168
|
+
}
|
|
6169
|
+
if (usedIds.has(groupId)) {
|
|
6170
|
+
throw new TypeError(`Resource group is used by more than one step: ${groupId}`);
|
|
6171
|
+
}
|
|
6172
|
+
usedIds.add(groupId);
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6175
|
+
};
|
|
6176
|
+
|
|
5572
6177
|
// ../../src/resources/services/booking-wizard-expand.ts
|
|
5573
6178
|
function isExistsStrict(n) {
|
|
5574
6179
|
return n !== void 0 && n !== null;
|
|
@@ -5622,31 +6227,36 @@ function expandBookingWizardSteps(service) {
|
|
|
5622
6227
|
return out;
|
|
5623
6228
|
}
|
|
5624
6229
|
|
|
5625
|
-
// ../../src/resources/services/
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
};
|
|
5639
|
-
var StateManagementTypeValues = {
|
|
5640
|
-
Unknown: "UnknownStateManagementType",
|
|
5641
|
-
Auto: "Auto",
|
|
5642
|
-
Manual: "Manual"
|
|
5643
|
-
};
|
|
5644
|
-
var SessionPrecisionTypeValues = {
|
|
5645
|
-
Unknown: "UnknownSessionPrecisionType",
|
|
5646
|
-
None: "SessionPrecisionNone",
|
|
5647
|
-
DateTime: "DateTime",
|
|
5648
|
-
Date: "Date"
|
|
6230
|
+
// ../../src/resources/services/check-in-schedule-hints.ts
|
|
6231
|
+
function isFreeCheckInSlot(period) {
|
|
6232
|
+
return period.from != null && period.to != null && (period.status == null || period.status === "FreeTime");
|
|
6233
|
+
}
|
|
6234
|
+
function getFreeCheckInSlots(response) {
|
|
6235
|
+
return (response?.checkInSchedule ?? []).filter(isFreeCheckInSlot);
|
|
6236
|
+
}
|
|
6237
|
+
|
|
6238
|
+
// ../../src/resources/services/service-order-errors.ts
|
|
6239
|
+
var ServiceOrderConflictErrorNameValues = {
|
|
6240
|
+
ResourceUnavailable: "REQUESTED_RESOURCE_IS_NOT_AVAILABLE",
|
|
6241
|
+
QuantityUnavailable: "REQUESTED_RESOURCE_QUANTITY_IS_NOT_AVAILABLE",
|
|
6242
|
+
ServiceUnavailableAtTime: "SERVICE_IS_NOT_AVAILABLE_AT_TIME"
|
|
5649
6243
|
};
|
|
6244
|
+
function getServiceOrderConflictReason(error) {
|
|
6245
|
+
if (!(error instanceof TorrowHttpError)) return void 0;
|
|
6246
|
+
switch (error.apiErrorName) {
|
|
6247
|
+
case ServiceOrderConflictErrorNameValues.ResourceUnavailable:
|
|
6248
|
+
return "resource-unavailable";
|
|
6249
|
+
case ServiceOrderConflictErrorNameValues.QuantityUnavailable:
|
|
6250
|
+
return "quantity-unavailable";
|
|
6251
|
+
case ServiceOrderConflictErrorNameValues.ServiceUnavailableAtTime:
|
|
6252
|
+
return "service-unavailable-at-time";
|
|
6253
|
+
default:
|
|
6254
|
+
return void 0;
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
function isServiceOrderConflictError(error) {
|
|
6258
|
+
return getServiceOrderConflictReason(error) !== void 0;
|
|
6259
|
+
}
|
|
5650
6260
|
|
|
5651
6261
|
// ../../src/resources/cases/payment-hints.ts
|
|
5652
6262
|
function normalizePaymentUrl(url) {
|
|
@@ -5663,6 +6273,124 @@ function getTicketPaymentUrl(caseItem) {
|
|
|
5663
6273
|
return normalizePaymentUrl(getTicketPaymentUrlRaw(caseItem));
|
|
5664
6274
|
}
|
|
5665
6275
|
|
|
6276
|
+
// ../../src/resources/resources/resource-builder.ts
|
|
6277
|
+
function cloneValue2(value) {
|
|
6278
|
+
if (value instanceof Date) return new Date(value.getTime());
|
|
6279
|
+
if (Array.isArray(value)) return value.map((item) => cloneValue2(item));
|
|
6280
|
+
if (value && typeof value === "object") {
|
|
6281
|
+
const result = {};
|
|
6282
|
+
for (const [key, item] of Object.entries(value)) result[key] = cloneValue2(item);
|
|
6283
|
+
return result;
|
|
6284
|
+
}
|
|
6285
|
+
return value;
|
|
6286
|
+
}
|
|
6287
|
+
function isSameBinding(description, serviceId, resourceGroupId) {
|
|
6288
|
+
return description.id === serviceId && description.resourceGroupId === resourceGroupId;
|
|
6289
|
+
}
|
|
6290
|
+
var ResourceBuilder = class _ResourceBuilder {
|
|
6291
|
+
draft;
|
|
6292
|
+
constructor(body) {
|
|
6293
|
+
this.draft = cloneValue2(body);
|
|
6294
|
+
}
|
|
6295
|
+
static create(body) {
|
|
6296
|
+
return new _ResourceBuilder(body);
|
|
6297
|
+
}
|
|
6298
|
+
static from(resource) {
|
|
6299
|
+
return new _ResourceBuilder(resource);
|
|
6300
|
+
}
|
|
6301
|
+
attachToService(service, resourceGroupId, options) {
|
|
6302
|
+
const serviceId = service.id?.trim();
|
|
6303
|
+
if (!serviceId) throw new TypeError("Service must have a non-empty id");
|
|
6304
|
+
const normalizedGroupId = resourceGroupId.trim();
|
|
6305
|
+
if (!normalizedGroupId) throw new TypeError("resourceGroupId must not be empty");
|
|
6306
|
+
const group = service.resourceGroupList?.find((item) => item.groupId === normalizedGroupId);
|
|
6307
|
+
if (!group) throw new TypeError(`Service resource group not found: ${normalizedGroupId}`);
|
|
6308
|
+
if (!group.usageType) throw new TypeError("Service resource group has no usageType");
|
|
6309
|
+
if (this.draft.usageType != null && this.draft.usageType !== group.usageType) {
|
|
6310
|
+
throw new TypeError("Resource usageType does not match the service resource group");
|
|
6311
|
+
}
|
|
6312
|
+
const descriptions = [...this.draft.serviceDescriptions ?? []];
|
|
6313
|
+
const matching = descriptions.filter(
|
|
6314
|
+
(item) => isSameBinding(item, serviceId, normalizedGroupId)
|
|
6315
|
+
);
|
|
6316
|
+
const current = matching[0];
|
|
6317
|
+
const next = {
|
|
6318
|
+
...current,
|
|
6319
|
+
id: serviceId,
|
|
6320
|
+
serviceName: service.name,
|
|
6321
|
+
resourceGroupId: normalizedGroupId,
|
|
6322
|
+
resourceGroupName: group.groupName,
|
|
6323
|
+
usageAmount: options?.usageAmount === void 0 ? current?.usageAmount : options.usageAmount,
|
|
6324
|
+
sortIndex: options?.sortIndex === void 0 ? current?.sortIndex : options.sortIndex,
|
|
6325
|
+
laterBinding: group.bookingProperties != null
|
|
6326
|
+
};
|
|
6327
|
+
const firstIndex = descriptions.findIndex(
|
|
6328
|
+
(item) => isSameBinding(item, serviceId, normalizedGroupId)
|
|
6329
|
+
);
|
|
6330
|
+
const withoutBinding = descriptions.filter(
|
|
6331
|
+
(item) => !isSameBinding(item, serviceId, normalizedGroupId)
|
|
6332
|
+
);
|
|
6333
|
+
if (firstIndex < 0) withoutBinding.push(next);
|
|
6334
|
+
else withoutBinding.splice(firstIndex, 0, next);
|
|
6335
|
+
this.draft = {
|
|
6336
|
+
...this.draft,
|
|
6337
|
+
usageType: this.draft.usageType ?? group.usageType,
|
|
6338
|
+
serviceDescriptions: withoutBinding
|
|
6339
|
+
};
|
|
6340
|
+
return this;
|
|
6341
|
+
}
|
|
6342
|
+
detachFromService(serviceId, resourceGroupId) {
|
|
6343
|
+
const normalizedServiceId = serviceId.trim();
|
|
6344
|
+
const normalizedGroupId = resourceGroupId.trim();
|
|
6345
|
+
if (!normalizedServiceId) throw new TypeError("serviceId must not be empty");
|
|
6346
|
+
if (!normalizedGroupId) throw new TypeError("resourceGroupId must not be empty");
|
|
6347
|
+
this.draft = {
|
|
6348
|
+
...this.draft,
|
|
6349
|
+
serviceDescriptions: (this.draft.serviceDescriptions ?? []).filter(
|
|
6350
|
+
(item) => !isSameBinding(item, normalizedServiceId, normalizedGroupId)
|
|
6351
|
+
)
|
|
6352
|
+
};
|
|
6353
|
+
return this;
|
|
6354
|
+
}
|
|
6355
|
+
/** Задаёт зависимость или исключение ресурса по id ранее выбранных ресурсов. */
|
|
6356
|
+
setUsageCondition(type, conditionIds) {
|
|
6357
|
+
if (type !== UsageConditionTypeValues.Additional && type !== UsageConditionTypeValues.Exclusion) {
|
|
6358
|
+
throw new TypeError(`Unsupported usage condition type: ${String(type)}`);
|
|
6359
|
+
}
|
|
6360
|
+
const normalizedIds = conditionIds.map((conditionId) => conditionId.trim());
|
|
6361
|
+
if (normalizedIds.length === 0) {
|
|
6362
|
+
throw new TypeError("conditionIds must not be empty");
|
|
6363
|
+
}
|
|
6364
|
+
if (normalizedIds.some((conditionId) => !conditionId)) {
|
|
6365
|
+
throw new TypeError("conditionIds must not contain empty ids");
|
|
6366
|
+
}
|
|
6367
|
+
if (new Set(normalizedIds).size !== normalizedIds.length) {
|
|
6368
|
+
throw new TypeError("conditionIds must not contain duplicates");
|
|
6369
|
+
}
|
|
6370
|
+
this.draft = {
|
|
6371
|
+
...this.draft,
|
|
6372
|
+
usageCondition: {
|
|
6373
|
+
usageConditionType: type,
|
|
6374
|
+
conditionIdList: normalizedIds
|
|
6375
|
+
}
|
|
6376
|
+
};
|
|
6377
|
+
return this;
|
|
6378
|
+
}
|
|
6379
|
+
clearUsageCondition() {
|
|
6380
|
+
this.draft = {
|
|
6381
|
+
...this.draft,
|
|
6382
|
+
usageCondition: {
|
|
6383
|
+
usageConditionType: UsageConditionTypeValues.None,
|
|
6384
|
+
conditionIdList: []
|
|
6385
|
+
}
|
|
6386
|
+
};
|
|
6387
|
+
return this;
|
|
6388
|
+
}
|
|
6389
|
+
build() {
|
|
6390
|
+
return { body: cloneValue2(this.draft) };
|
|
6391
|
+
}
|
|
6392
|
+
};
|
|
6393
|
+
|
|
5666
6394
|
// ../../src/resources/common/device-type.ts
|
|
5667
6395
|
var DeviceTypeValues = {
|
|
5668
6396
|
Unknown: "Unknown",
|
|
@@ -5757,16 +6485,22 @@ export {
|
|
|
5757
6485
|
ParticipationFieldRequirementTypeValues,
|
|
5758
6486
|
ParticipationFieldTypeValues,
|
|
5759
6487
|
PinnedViewsFacade,
|
|
6488
|
+
ProfileTypeValues,
|
|
5760
6489
|
ProfilesFacade,
|
|
5761
6490
|
RawClient,
|
|
5762
6491
|
RelationsFacade,
|
|
5763
6492
|
ReportsFacade,
|
|
6493
|
+
ResourceBuilder,
|
|
5764
6494
|
ResourcesFacade,
|
|
5765
6495
|
SearchFacade,
|
|
5766
6496
|
SendCodeAccountTypeValueList,
|
|
5767
6497
|
SendCodeAccountTypeValues,
|
|
6498
|
+
ServiceBuilder,
|
|
5768
6499
|
ServiceCheckInWizardStepParameterName,
|
|
5769
6500
|
ServiceCheckInWizardStepType,
|
|
6501
|
+
ServiceOrderConflictErrorNameValues,
|
|
6502
|
+
ServiceType,
|
|
6503
|
+
ServiceTypePresetValues,
|
|
5770
6504
|
ServicesFacade,
|
|
5771
6505
|
SessionDurationTypeValues,
|
|
5772
6506
|
SessionPrecisionTypeValues,
|
|
@@ -5775,6 +6509,7 @@ export {
|
|
|
5775
6509
|
ThesaurusFacade,
|
|
5776
6510
|
TimeSelectionTypeValues,
|
|
5777
6511
|
TimeSplitTypeValues,
|
|
6512
|
+
TimeStepUiModeValues,
|
|
5778
6513
|
TimetableViewTypeValues,
|
|
5779
6514
|
TokenStatusValueList,
|
|
5780
6515
|
TokenStatusValues,
|
|
@@ -5784,6 +6519,7 @@ export {
|
|
|
5784
6519
|
TorrowItemTypeValueList,
|
|
5785
6520
|
TorrowItemTypeValues,
|
|
5786
6521
|
TorrowObjectTypeCode,
|
|
6522
|
+
UsageConditionTypeValues,
|
|
5787
6523
|
UsageTypeValues,
|
|
5788
6524
|
UserAccessLevelValues,
|
|
5789
6525
|
UserFacade,
|
|
@@ -5794,11 +6530,24 @@ export {
|
|
|
5794
6530
|
ViewsFacade,
|
|
5795
6531
|
buildContextIconSvg,
|
|
5796
6532
|
buildContextIconSvgBytes,
|
|
6533
|
+
cancelCaseParticipation,
|
|
6534
|
+
communicationHref,
|
|
6535
|
+
createOrder,
|
|
6536
|
+
createServiceSessionDurationProperties,
|
|
5797
6537
|
expandBookingWizardSteps,
|
|
6538
|
+
generateServiceResourceGroupId,
|
|
5798
6539
|
generateTorrowId,
|
|
5799
6540
|
generateTorrowIdForOwner,
|
|
6541
|
+
getCase,
|
|
6542
|
+
getCheckInSchedule,
|
|
5800
6543
|
getContextIconPresetFileName,
|
|
6544
|
+
getFreeCheckInSlots,
|
|
5801
6545
|
getResourceGroupIdFromStep,
|
|
6546
|
+
getService,
|
|
6547
|
+
getServiceOrderConflictReason,
|
|
6548
|
+
getServiceResources,
|
|
6549
|
+
getServiceType,
|
|
6550
|
+
getServiceTypeFromSessionDurationProperties,
|
|
5802
6551
|
getShardFromTorrowId,
|
|
5803
6552
|
getStepParameter,
|
|
5804
6553
|
getTicketPaymentUrl,
|
|
@@ -5812,8 +6561,10 @@ export {
|
|
|
5812
6561
|
isAuthScope,
|
|
5813
6562
|
isContextIconPreset,
|
|
5814
6563
|
isDeviceType,
|
|
6564
|
+
isFreeCheckInSlot,
|
|
5815
6565
|
isItemViewSortCondition,
|
|
5816
6566
|
isSendCodeAccountType,
|
|
6567
|
+
isServiceOrderConflictError,
|
|
5817
6568
|
isStepFlag,
|
|
5818
6569
|
isTokenRespReadyStatus,
|
|
5819
6570
|
isTokenStatus,
|
|
@@ -5829,6 +6580,7 @@ export {
|
|
|
5829
6580
|
parseSendCodeAccountType,
|
|
5830
6581
|
parseTokenStatus,
|
|
5831
6582
|
parseVerificationMethod,
|
|
6583
|
+
resolveCommunicationBrand,
|
|
5832
6584
|
shouldSkipResourceStep,
|
|
5833
6585
|
sortStepDescriptionsByOrder,
|
|
5834
6586
|
torrowObjectTypeToCode,
|