@torrow/sdk-client 0.15.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +201 -235
- package/dist/index.js +75 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10787,11 +10787,11 @@ var Discriminator = /* @__PURE__ */ ((Discriminator2) => {
|
|
|
10787
10787
|
})(Discriminator || {});
|
|
10788
10788
|
|
|
10789
10789
|
// ../../src/resources/common/item-create-defaults.ts
|
|
10790
|
-
function applyItemCreateDefaults(body, discriminator) {
|
|
10790
|
+
function applyItemCreateDefaults(body, discriminator, publicityType) {
|
|
10791
10791
|
const payload = { ...body };
|
|
10792
10792
|
payload.discriminator = discriminator;
|
|
10793
10793
|
const withPublicity = payload;
|
|
10794
|
-
withPublicity.publicityType =
|
|
10794
|
+
withPublicity.publicityType = publicityType ?? "Personal" /* Personal */;
|
|
10795
10795
|
return payload;
|
|
10796
10796
|
}
|
|
10797
10797
|
|
|
@@ -12081,7 +12081,7 @@ var CalendarsFacade = class extends TorrowItemFacade {
|
|
|
12081
12081
|
itemObjectTypeCode = TorrowObjectTypeCode.Calendar;
|
|
12082
12082
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
12083
12083
|
readFileMetadataItem(id, signal) {
|
|
12084
|
-
return this.getById(id, {
|
|
12084
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
12085
12085
|
}
|
|
12086
12086
|
constructor(http) {
|
|
12087
12087
|
super(http, BASE, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
@@ -12096,7 +12096,7 @@ var CalendarsFacade = class extends TorrowItemFacade {
|
|
|
12096
12096
|
}
|
|
12097
12097
|
/** `POST /api/v1/calendars` */
|
|
12098
12098
|
create(body, options) {
|
|
12099
|
-
const payload = applyItemCreateDefaults(body, "CalendarItem" /* CalendarItem
|
|
12099
|
+
const payload = applyItemCreateDefaults(body, "CalendarItem" /* CalendarItem */, options?.publicityType);
|
|
12100
12100
|
return this.http.requestJson({
|
|
12101
12101
|
method: "POST",
|
|
12102
12102
|
path: BASE,
|
|
@@ -12146,7 +12146,7 @@ var CalendarsFacade = class extends TorrowItemFacade {
|
|
|
12146
12146
|
query: {
|
|
12147
12147
|
versionToCheck: options?.versionToCheck,
|
|
12148
12148
|
includeDeleted: options?.includeDeleted,
|
|
12149
|
-
includeChildItems: options?.
|
|
12149
|
+
includeChildItems: options?.includeChildItemStats,
|
|
12150
12150
|
securityToken: options?.securityToken
|
|
12151
12151
|
},
|
|
12152
12152
|
signal: options?.signal
|
|
@@ -12431,7 +12431,7 @@ function getCase(http, torrowId, options) {
|
|
|
12431
12431
|
caseParticipantProfileId: options?.caseParticipantProfileId,
|
|
12432
12432
|
versionToCheck: options?.versionToCheck,
|
|
12433
12433
|
includeDeleted: options?.includeDeleted,
|
|
12434
|
-
includeChildTypes: options?.
|
|
12434
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
12435
12435
|
securityToken: options?.securityToken,
|
|
12436
12436
|
caseParticipantId: options?.caseParticipantId
|
|
12437
12437
|
},
|
|
@@ -12453,7 +12453,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
12453
12453
|
itemObjectTypeCode = TorrowObjectTypeCode.Case;
|
|
12454
12454
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
12455
12455
|
readFileMetadataItem(id, signal) {
|
|
12456
|
-
return this.getById(id, {
|
|
12456
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
12457
12457
|
}
|
|
12458
12458
|
constructor(http) {
|
|
12459
12459
|
super(http, BASE3);
|
|
@@ -12474,7 +12474,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
12474
12474
|
createWithOptions(body, options) {
|
|
12475
12475
|
const payload = {
|
|
12476
12476
|
...body,
|
|
12477
|
-
caseItem: body.caseItem ? this.withCreateDefaults(body.caseItem) : body.caseItem
|
|
12477
|
+
caseItem: body.caseItem ? this.withCreateDefaults(body.caseItem, options?.publicityType) : body.caseItem
|
|
12478
12478
|
};
|
|
12479
12479
|
return this.http.requestJson({
|
|
12480
12480
|
method: "PUT",
|
|
@@ -12492,7 +12492,7 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
12492
12492
|
* NSwag: `createCase`. Предпочтительный путь с оболочкой — **`createWithOptions`** (`CreateCaseReq`).
|
|
12493
12493
|
*/
|
|
12494
12494
|
createCaseItem(body, options) {
|
|
12495
|
-
const payload = this.withCreateDefaults(body);
|
|
12495
|
+
const payload = this.withCreateDefaults(body, options?.publicityType);
|
|
12496
12496
|
return this.http.requestJson({
|
|
12497
12497
|
method: "POST",
|
|
12498
12498
|
path: BASE3,
|
|
@@ -12525,8 +12525,8 @@ var CasesFacade = class extends TorrowItemFacade {
|
|
|
12525
12525
|
signal: options?.signal
|
|
12526
12526
|
}).then((dto) => projectCaseItem(dto));
|
|
12527
12527
|
}
|
|
12528
|
-
withCreateDefaults(body) {
|
|
12529
|
-
const payload = applyItemCreateDefaults(body, "CaseItem" /* CaseItem
|
|
12528
|
+
withCreateDefaults(body, publicityType) {
|
|
12529
|
+
const payload = applyItemCreateDefaults(body, "CaseItem" /* CaseItem */, publicityType);
|
|
12530
12530
|
return {
|
|
12531
12531
|
...payload,
|
|
12532
12532
|
caseState: payload.caseState ?? CaseStateValues.Verifying,
|
|
@@ -13134,7 +13134,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
13134
13134
|
itemObjectTypeCode = TorrowObjectTypeCode.Contact;
|
|
13135
13135
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
13136
13136
|
readFileMetadataItem(id, signal) {
|
|
13137
|
-
return this.getById(id, {
|
|
13137
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
13138
13138
|
}
|
|
13139
13139
|
constructor(http) {
|
|
13140
13140
|
super(http, BASE4, CONTACT_SOCIAL_OPTS);
|
|
@@ -13147,9 +13147,12 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
13147
13147
|
patch(itemId, fields, options) {
|
|
13148
13148
|
return patchItem(this.http, itemId, fields, options, createContactPatchAdapter());
|
|
13149
13149
|
}
|
|
13150
|
-
/**
|
|
13150
|
+
/**
|
|
13151
|
+
* `POST /api/v1/contacts`.
|
|
13152
|
+
* Начальная публичность задаётся через `options.publicityType`; при пропуске SDK отправляет `Personal`.
|
|
13153
|
+
*/
|
|
13151
13154
|
create(body, options) {
|
|
13152
|
-
const payload = this.withCreateDefaults(body);
|
|
13155
|
+
const payload = this.withCreateDefaults(body, options?.publicityType);
|
|
13153
13156
|
return this.http.requestJson({
|
|
13154
13157
|
method: "POST",
|
|
13155
13158
|
path: BASE4,
|
|
@@ -13161,10 +13164,11 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
13161
13164
|
signal: options?.signal
|
|
13162
13165
|
}).then((dto) => projectContactItem(dto));
|
|
13163
13166
|
}
|
|
13164
|
-
withCreateDefaults(body) {
|
|
13167
|
+
withCreateDefaults(body, publicityType) {
|
|
13165
13168
|
const payload = applyItemCreateDefaults(
|
|
13166
13169
|
body,
|
|
13167
|
-
"ContactItem" /* ContactItem
|
|
13170
|
+
"ContactItem" /* ContactItem */,
|
|
13171
|
+
publicityType
|
|
13168
13172
|
);
|
|
13169
13173
|
normalizeContactStructuredArrayRidsForWrite(payload);
|
|
13170
13174
|
normalizeContactCommunicationsForWrite(payload);
|
|
@@ -13198,7 +13202,7 @@ var ContactsFacade = class extends TorrowItemFacade {
|
|
|
13198
13202
|
query: {
|
|
13199
13203
|
versionToCheck: options?.versionToCheck,
|
|
13200
13204
|
includeDeleted: options?.includeDeleted,
|
|
13201
|
-
includeChildTypes: options?.
|
|
13205
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
13202
13206
|
securityToken: options?.securityToken
|
|
13203
13207
|
},
|
|
13204
13208
|
signal: options?.signal
|
|
@@ -13329,7 +13333,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
13329
13333
|
itemObjectTypeCode = TorrowObjectTypeCode.Context;
|
|
13330
13334
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
13331
13335
|
readFileMetadataItem(id, signal) {
|
|
13332
|
-
return this.getById(id, {
|
|
13336
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
13333
13337
|
}
|
|
13334
13338
|
constructor(http) {
|
|
13335
13339
|
super(http, BASE5, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
@@ -13344,7 +13348,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
13344
13348
|
}
|
|
13345
13349
|
/** `POST /api/v1/contexts` */
|
|
13346
13350
|
create(body, options) {
|
|
13347
|
-
const payload = applyItemCreateDefaults(body, "ContextItem" /* ContextItem
|
|
13351
|
+
const payload = applyItemCreateDefaults(body, "ContextItem" /* ContextItem */, options?.publicityType);
|
|
13348
13352
|
return this.http.requestJson({
|
|
13349
13353
|
method: "POST",
|
|
13350
13354
|
path: BASE5,
|
|
@@ -13390,7 +13394,7 @@ var ContextsFacade = class extends TorrowItemFacade {
|
|
|
13390
13394
|
query: {
|
|
13391
13395
|
versionToCheck: options?.versionToCheck,
|
|
13392
13396
|
includeDeleted: options?.includeDeleted,
|
|
13393
|
-
includeChildTypes: options?.
|
|
13397
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
13394
13398
|
securityToken: options?.securityToken
|
|
13395
13399
|
},
|
|
13396
13400
|
signal: options?.signal
|
|
@@ -13466,7 +13470,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
13466
13470
|
itemObjectTypeCode = TorrowObjectTypeCode.Note;
|
|
13467
13471
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
13468
13472
|
readFileMetadataItem(id, signal) {
|
|
13469
|
-
return this.getById(id, {
|
|
13473
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
13470
13474
|
}
|
|
13471
13475
|
constructor(http) {
|
|
13472
13476
|
super(http, BASE6, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
@@ -13479,9 +13483,9 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
13479
13483
|
patch(itemId, fields, options) {
|
|
13480
13484
|
return patchItem(this.http, itemId, fields, options, createNotePatchAdapter());
|
|
13481
13485
|
}
|
|
13482
|
-
/** `POST /api/v1/notes`;
|
|
13486
|
+
/** `POST /api/v1/notes`; публичность новой заметки задаётся в options, без неё отправляется `Personal`. Явное data:string обязательно, включая "". */
|
|
13483
13487
|
create(body, options) {
|
|
13484
|
-
const payload = this.withCreateDefaults(prepareNoteWrite(body));
|
|
13488
|
+
const payload = this.withCreateDefaults(prepareNoteWrite(body), options?.publicityType);
|
|
13485
13489
|
return this.http.requestJson({
|
|
13486
13490
|
method: "POST",
|
|
13487
13491
|
path: BASE6,
|
|
@@ -13493,10 +13497,11 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
13493
13497
|
signal: options?.signal
|
|
13494
13498
|
}).then((dto) => projectNoteItem(dto));
|
|
13495
13499
|
}
|
|
13496
|
-
/** `PUT /api/v1/notes/{body.id}`;
|
|
13500
|
+
/** `PUT /api/v1/notes/{body.id}`; публичность меняется только через `updatePublicity`. Явное data:string обязательно, "" отправляется буквально. */
|
|
13497
13501
|
update(body, options) {
|
|
13498
13502
|
const itemId = requireItemUpdateId(body, "Note");
|
|
13499
|
-
const
|
|
13503
|
+
const prepared = prepareNoteWrite(body);
|
|
13504
|
+
const { publicityType: _ignoredPublicityType, ...payload } = prepared;
|
|
13500
13505
|
return this.http.requestJson({
|
|
13501
13506
|
method: "PUT",
|
|
13502
13507
|
path: `${BASE6}/${encodePathSegment(itemId)}`,
|
|
@@ -13535,7 +13540,7 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
13535
13540
|
query: {
|
|
13536
13541
|
versionToCheck: options?.versionToCheck,
|
|
13537
13542
|
includeDeleted: options?.includeDeleted,
|
|
13538
|
-
includeChildTypes: options?.
|
|
13543
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
13539
13544
|
securityToken: options?.securityToken
|
|
13540
13545
|
},
|
|
13541
13546
|
signal: options?.signal
|
|
@@ -13611,8 +13616,8 @@ var NotesFacade = class extends TorrowItemFacade {
|
|
|
13611
13616
|
});
|
|
13612
13617
|
return unwrapFilePutUrl(resp);
|
|
13613
13618
|
}
|
|
13614
|
-
withCreateDefaults(body) {
|
|
13615
|
-
const payload = applyItemCreateDefaults(body, "NoteItem" /* NoteItem
|
|
13619
|
+
withCreateDefaults(body, publicityType) {
|
|
13620
|
+
const payload = applyItemCreateDefaults(body, "NoteItem" /* NoteItem */, publicityType);
|
|
13616
13621
|
if (!payload.name?.trim()) {
|
|
13617
13622
|
payload.name = this.getDefaultName(payload.data);
|
|
13618
13623
|
}
|
|
@@ -14360,7 +14365,12 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14360
14365
|
itemObjectTypeCode = TorrowObjectTypeCode.Resource;
|
|
14361
14366
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
14362
14367
|
readFileMetadataItem(id, signal) {
|
|
14363
|
-
return this.getById(id, {
|
|
14368
|
+
return this.getById(id, {
|
|
14369
|
+
includeChildItemStats: false,
|
|
14370
|
+
isNeedItem: true,
|
|
14371
|
+
isNeedParentResource: false,
|
|
14372
|
+
signal
|
|
14373
|
+
});
|
|
14364
14374
|
}
|
|
14365
14375
|
constructor(http) {
|
|
14366
14376
|
super(http, BASE7, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
@@ -14403,7 +14413,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14403
14413
|
}
|
|
14404
14414
|
/** `POST /api/v1/resources` */
|
|
14405
14415
|
create(body, options) {
|
|
14406
|
-
const payload = this.withCreateDefaults(body);
|
|
14416
|
+
const payload = this.withCreateDefaults(body, options?.publicityType);
|
|
14407
14417
|
return this.http.requestJson({
|
|
14408
14418
|
method: "POST",
|
|
14409
14419
|
path: BASE7,
|
|
@@ -14430,8 +14440,8 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14430
14440
|
signal: options?.signal
|
|
14431
14441
|
}).then((item) => this.toSdkResourceItem(item));
|
|
14432
14442
|
}
|
|
14433
|
-
withCreateDefaults(body) {
|
|
14434
|
-
const payload = applyItemCreateDefaults(body, "ResourceItem" /* ResourceItem
|
|
14443
|
+
withCreateDefaults(body, publicityType) {
|
|
14444
|
+
const payload = applyItemCreateDefaults(body, "ResourceItem" /* ResourceItem */, publicityType);
|
|
14435
14445
|
return {
|
|
14436
14446
|
...payload,
|
|
14437
14447
|
usageType: payload.usageType ?? UsageTypeValues.Specification
|
|
@@ -14462,7 +14472,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14462
14472
|
includeDeleted: options?.includeDeleted,
|
|
14463
14473
|
isNeedItem: options?.isNeedItem,
|
|
14464
14474
|
isNeedParentResource: options?.isNeedParentResource,
|
|
14465
|
-
includeChildTypes: options?.
|
|
14475
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
14466
14476
|
securityToken: options?.securityToken
|
|
14467
14477
|
},
|
|
14468
14478
|
signal: options?.signal
|
|
@@ -14487,7 +14497,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14487
14497
|
includeDeleted: options?.includeDeleted,
|
|
14488
14498
|
isNeedItem: options?.isNeedItem,
|
|
14489
14499
|
isNeedParentResource: options?.isNeedParentResource,
|
|
14490
|
-
|
|
14500
|
+
includeChildItemStats: options?.includeChildItemStats,
|
|
14491
14501
|
securityToken: options?.securityToken,
|
|
14492
14502
|
signal: options?.signal
|
|
14493
14503
|
});
|
|
@@ -14537,7 +14547,7 @@ var ResourcesFacade = class extends TorrowItemFacade {
|
|
|
14537
14547
|
includeDeleted: options?.includeDeleted,
|
|
14538
14548
|
isNeedItem: options?.isNeedItem,
|
|
14539
14549
|
isNeedParentResource: options?.isNeedParentResource,
|
|
14540
|
-
|
|
14550
|
+
includeChildItemStats: options?.includeChildItemStats,
|
|
14541
14551
|
securityToken: options?.securityToken,
|
|
14542
14552
|
signal: options?.signal
|
|
14543
14553
|
});
|
|
@@ -14688,7 +14698,7 @@ async function getService(http, torrowId, options) {
|
|
|
14688
14698
|
profileId: options?.profileId,
|
|
14689
14699
|
versionToCheck: options?.versionToCheck,
|
|
14690
14700
|
includeDeleted: options?.includeDeleted,
|
|
14691
|
-
includeChildTypes: options?.
|
|
14701
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
14692
14702
|
securityToken: options?.securityToken
|
|
14693
14703
|
},
|
|
14694
14704
|
signal: options?.signal
|
|
@@ -15013,7 +15023,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
15013
15023
|
itemObjectTypeCode = TorrowObjectTypeCode.Service;
|
|
15014
15024
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
15015
15025
|
readFileMetadataItem(id, signal) {
|
|
15016
|
-
return this.getById(id, {
|
|
15026
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
15017
15027
|
}
|
|
15018
15028
|
constructor(http) {
|
|
15019
15029
|
super(http, BASE9, { imagePutUrlSecurityToken: false, withPhotoEndpoints: false });
|
|
@@ -15033,7 +15043,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
15033
15043
|
}
|
|
15034
15044
|
/** `POST /api/v1/services` */
|
|
15035
15045
|
create(body, options) {
|
|
15036
|
-
const payload = applyItemCreateDefaults(body, "ServiceItem" /* ServiceItem
|
|
15046
|
+
const payload = applyItemCreateDefaults(body, "ServiceItem" /* ServiceItem */, options?.publicityType);
|
|
15037
15047
|
return this.http.requestJson({
|
|
15038
15048
|
method: "POST",
|
|
15039
15049
|
path: BASE9,
|
|
@@ -15108,7 +15118,7 @@ var ServicesFacade = class extends TorrowItemFacade {
|
|
|
15108
15118
|
profileId: options?.profileId,
|
|
15109
15119
|
versionToCheck: options?.versionToCheck,
|
|
15110
15120
|
includeDeleted: options?.includeDeleted,
|
|
15111
|
-
includeChildTypes: options?.
|
|
15121
|
+
includeChildTypes: options?.includeChildItemStats,
|
|
15112
15122
|
securityToken: options?.securityToken
|
|
15113
15123
|
},
|
|
15114
15124
|
signal: options?.signal
|
|
@@ -15475,7 +15485,8 @@ function ensureContactNameForProfileWrite(body) {
|
|
|
15475
15485
|
function prepareUserProfileItemForAdd(body) {
|
|
15476
15486
|
const payload = applyItemCreateDefaults(
|
|
15477
15487
|
body,
|
|
15478
|
-
"ContactItem" /* ContactItem
|
|
15488
|
+
"ContactItem" /* ContactItem */,
|
|
15489
|
+
void 0
|
|
15479
15490
|
);
|
|
15480
15491
|
ensureContactNameForProfileWrite(payload);
|
|
15481
15492
|
normalizeContactStructuredArrayRidsForWrite(payload);
|
|
@@ -16251,7 +16262,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
16251
16262
|
itemObjectTypeCode = TorrowObjectTypeCode.LoyaltySystem;
|
|
16252
16263
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
16253
16264
|
readFileMetadataItem(id, signal) {
|
|
16254
|
-
return this.getById(id, {
|
|
16265
|
+
return this.getById(id, { includeChildItemStats: false, signal });
|
|
16255
16266
|
}
|
|
16256
16267
|
constructor(http) {
|
|
16257
16268
|
super(http, BASE17);
|
|
@@ -16266,7 +16277,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
16266
16277
|
itemId: torrowId,
|
|
16267
16278
|
operation: "getInitialSubscriptionImageInfo" /* GetInitialSubscriptionImageInfo */,
|
|
16268
16279
|
signal,
|
|
16269
|
-
readItem: (id, originalSignal) => this.getById(id, {
|
|
16280
|
+
readItem: (id, originalSignal) => this.getById(id, { includeChildItemStats: false, signal: originalSignal }),
|
|
16270
16281
|
selectFile: (item) => {
|
|
16271
16282
|
const initial = item.initialSubscription;
|
|
16272
16283
|
if (initial == null) {
|
|
@@ -16289,7 +16300,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
16289
16300
|
}
|
|
16290
16301
|
/** `POST /api/v1/loyaltysystems` */
|
|
16291
16302
|
create(body, options) {
|
|
16292
|
-
const payload = applyItemCreateDefaults(body, "LoyaltySystemItem" /* LoyaltySystemItem
|
|
16303
|
+
const payload = applyItemCreateDefaults(body, "LoyaltySystemItem" /* LoyaltySystemItem */, options?.publicityType);
|
|
16293
16304
|
return this.http.requestJson({
|
|
16294
16305
|
method: "POST",
|
|
16295
16306
|
path: BASE17,
|
|
@@ -16335,7 +16346,7 @@ var LoyaltySystemsFacade = class extends TorrowItemCoreFacade {
|
|
|
16335
16346
|
query: {
|
|
16336
16347
|
versionToCheck: options?.versionToCheck,
|
|
16337
16348
|
includeDeleted: options?.includeDeleted,
|
|
16338
|
-
includeChildItems: options?.
|
|
16349
|
+
includeChildItems: options?.includeChildItemStats,
|
|
16339
16350
|
securityToken: options?.securityToken
|
|
16340
16351
|
},
|
|
16341
16352
|
signal: options?.signal
|
|
@@ -16414,7 +16425,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
16414
16425
|
itemObjectTypeCode = TorrowObjectTypeCode.LoyaltyCard;
|
|
16415
16426
|
/** Чтение полной карточки для метаданных без дочерних данных. */
|
|
16416
16427
|
readFileMetadataItem(id, signal) {
|
|
16417
|
-
return this.getById(id, {
|
|
16428
|
+
return this.getById(id, { includeChildItemStats: false, includeBalance: false, signal });
|
|
16418
16429
|
}
|
|
16419
16430
|
constructor(http) {
|
|
16420
16431
|
super(http, BASE18, LOYALTY_CARD_SOCIAL_OPTS);
|
|
@@ -16579,7 +16590,7 @@ var LoyaltyCardsFacade = class extends TorrowItemCoreFacade {
|
|
|
16579
16590
|
query: {
|
|
16580
16591
|
versionToCheck: options?.versionToCheck,
|
|
16581
16592
|
includeDeleted: options?.includeDeleted,
|
|
16582
|
-
includeChildItems: options?.
|
|
16593
|
+
includeChildItems: options?.includeChildItemStats,
|
|
16583
16594
|
includeBalance: options?.includeBalance,
|
|
16584
16595
|
securityToken: options?.securityToken
|
|
16585
16596
|
},
|
|
@@ -16706,8 +16717,11 @@ var BASE20 = "/api/v1/user";
|
|
|
16706
16717
|
var UserFacade = class {
|
|
16707
16718
|
constructor(http) {
|
|
16708
16719
|
this.http = http;
|
|
16720
|
+
this.profiles = new ProfilesFacade(http);
|
|
16709
16721
|
}
|
|
16710
16722
|
http;
|
|
16723
|
+
/** Общий путь чтения списка профилей с его распаковкой и read-проекцией. */
|
|
16724
|
+
profiles;
|
|
16711
16725
|
/** `GET /api/v1/user/loyaltycard` */
|
|
16712
16726
|
getLoyaltyCard(options) {
|
|
16713
16727
|
return this.http.requestJson({ method: "GET", path: `${BASE20}/loyaltycard`, signal: options?.signal }).then((dto) => projectLoyaltyCardItem(dto));
|
|
@@ -16792,13 +16806,24 @@ var UserFacade = class {
|
|
|
16792
16806
|
signal: options?.signal
|
|
16793
16807
|
});
|
|
16794
16808
|
}
|
|
16795
|
-
/**
|
|
16796
|
-
|
|
16797
|
-
|
|
16809
|
+
/**
|
|
16810
|
+
* Возвращает серверный профиль по умолчанию (`GET /api/v1/user/defaultprofile`).
|
|
16811
|
+
* Если ответ null или пуст, выбирает первый профиль из {@link ProfilesFacade.list}
|
|
16812
|
+
* в серверном порядке; при пустом списке возвращает null.
|
|
16813
|
+
* Запасной выбор только читает данные и не назначает серверный default.
|
|
16814
|
+
* Ошибки передаются вызывающему коду; один signal отменяет оба запроса.
|
|
16815
|
+
* @param options Параметры чтения: signal — отмена всей цепочки запросов.
|
|
16816
|
+
*/
|
|
16817
|
+
async getDefaultProfile(options) {
|
|
16818
|
+
const dto = await this.http.requestJson({
|
|
16798
16819
|
method: "GET",
|
|
16799
16820
|
path: `${BASE20}/defaultprofile`,
|
|
16800
16821
|
signal: options?.signal
|
|
16801
|
-
})
|
|
16822
|
+
});
|
|
16823
|
+
if (dto !== null && dto !== void 0) {
|
|
16824
|
+
return projectContactItem(dto);
|
|
16825
|
+
}
|
|
16826
|
+
return (await this.profiles.list(options))[0] ?? null;
|
|
16802
16827
|
}
|
|
16803
16828
|
/** `PUT /api/v1/user/defaultprofile` */
|
|
16804
16829
|
async setDefaultProfileByContactId(contactId, options) {
|