@torrow/sdk-client 0.8.0 → 0.9.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.js CHANGED
@@ -11,103 +11,167 @@ async function buildAuthHeaders(config) {
11
11
  return headers;
12
12
  }
13
13
 
14
- // ../../src/http/TorrowHttpError.ts
15
- function pickApiErrorName(body) {
16
- if (body === null || typeof body !== "object") {
17
- return void 0;
18
- }
19
- const o = body;
20
- if (typeof o.error === "string" && o.error.length > 0) {
21
- return o.error;
22
- }
23
- if (typeof o.name === "string" && o.name.length > 0) {
24
- return o.name;
14
+ // ../../src/http/TorrowSdkError.ts
15
+ var TorrowSdkErrorCategory = /* @__PURE__ */ ((TorrowSdkErrorCategory2) => {
16
+ TorrowSdkErrorCategory2["InvalidInput"] = "InvalidInput";
17
+ TorrowSdkErrorCategory2["InvalidState"] = "InvalidState";
18
+ TorrowSdkErrorCategory2["AccessDenied"] = "AccessDenied";
19
+ TorrowSdkErrorCategory2["InsufficientData"] = "InsufficientData";
20
+ TorrowSdkErrorCategory2["InvalidResponse"] = "InvalidResponse";
21
+ TorrowSdkErrorCategory2["VersionConflict"] = "VersionConflict";
22
+ TorrowSdkErrorCategory2["AuthenticationRequired"] = "AuthenticationRequired";
23
+ TorrowSdkErrorCategory2["UnsupportedOperation"] = "UnsupportedOperation";
24
+ TorrowSdkErrorCategory2["RateLimited"] = "RateLimited";
25
+ TorrowSdkErrorCategory2["HttpFailure"] = "HttpFailure";
26
+ TorrowSdkErrorCategory2["TransportFailure"] = "TransportFailure";
27
+ TorrowSdkErrorCategory2["StorageFailure"] = "StorageFailure";
28
+ TorrowSdkErrorCategory2["Cancelled"] = "Cancelled";
29
+ TorrowSdkErrorCategory2["Unknown"] = "Unknown";
30
+ return TorrowSdkErrorCategory2;
31
+ })(TorrowSdkErrorCategory || {});
32
+ var TorrowSdkRequestState = /* @__PURE__ */ ((TorrowSdkRequestState2) => {
33
+ TorrowSdkRequestState2["NotStarted"] = "NotStarted";
34
+ TorrowSdkRequestState2["Started"] = "Started";
35
+ return TorrowSdkRequestState2;
36
+ })(TorrowSdkRequestState || {});
37
+ var TorrowSdkEffectArea = /* @__PURE__ */ ((TorrowSdkEffectArea2) => {
38
+ TorrowSdkEffectArea2["Remote"] = "Remote";
39
+ TorrowSdkEffectArea2["SessionMemory"] = "SessionMemory";
40
+ TorrowSdkEffectArea2["Storage"] = "Storage";
41
+ return TorrowSdkEffectArea2;
42
+ })(TorrowSdkEffectArea || {});
43
+ var TorrowSdkEffectState = /* @__PURE__ */ ((TorrowSdkEffectState2) => {
44
+ TorrowSdkEffectState2["NotApplied"] = "NotApplied";
45
+ TorrowSdkEffectState2["Applied"] = "Applied";
46
+ TorrowSdkEffectState2["Unknown"] = "Unknown";
47
+ return TorrowSdkEffectState2;
48
+ })(TorrowSdkEffectState || {});
49
+ var TorrowSdkErrorDomain = /* @__PURE__ */ ((TorrowSdkErrorDomain2) => {
50
+ TorrowSdkErrorDomain2["BehaviorSettings"] = "BehaviorSettings";
51
+ TorrowSdkErrorDomain2["Otp"] = "Otp";
52
+ TorrowSdkErrorDomain2["AuthSession"] = "AuthSession";
53
+ return TorrowSdkErrorDomain2;
54
+ })(TorrowSdkErrorDomain || {});
55
+ var OtpErrorReason = /* @__PURE__ */ ((OtpErrorReason2) => {
56
+ OtpErrorReason2["InvalidChallenge"] = "InvalidChallenge";
57
+ OtpErrorReason2["UnsupportedMethod"] = "UnsupportedMethod";
58
+ OtpErrorReason2["AuthHeaderMissing"] = "AuthHeaderMissing";
59
+ OtpErrorReason2["CodeRequestLimitExceeded"] = "CodeRequestLimitExceeded";
60
+ return OtpErrorReason2;
61
+ })(OtpErrorReason || {});
62
+ var AuthSessionErrorReason = /* @__PURE__ */ ((AuthSessionErrorReason2) => {
63
+ AuthSessionErrorReason2["SessionNotReady"] = "SessionNotReady";
64
+ AuthSessionErrorReason2["CallbackFailed"] = "CallbackFailed";
65
+ return AuthSessionErrorReason2;
66
+ })(AuthSessionErrorReason || {});
67
+ var BehaviorSettingsEffectStep = /* @__PURE__ */ ((BehaviorSettingsEffectStep2) => {
68
+ BehaviorSettingsEffectStep2["Write"] = "Write";
69
+ return BehaviorSettingsEffectStep2;
70
+ })(BehaviorSettingsEffectStep || {});
71
+ var AuthSessionEffectStep = /* @__PURE__ */ ((AuthSessionEffectStep2) => {
72
+ AuthSessionEffectStep2["CreateAuthSession"] = "CreateAuthSession";
73
+ AuthSessionEffectStep2["CloseSession"] = "CloseSession";
74
+ AuthSessionEffectStep2["IssueTokens"] = "IssueTokens";
75
+ AuthSessionEffectStep2["RefreshTokens"] = "RefreshTokens";
76
+ AuthSessionEffectStep2["RevokeTokens"] = "RevokeTokens";
77
+ AuthSessionEffectStep2["SendCode"] = "SendCode";
78
+ AuthSessionEffectStep2["SetTokens"] = "SetTokens";
79
+ AuthSessionEffectStep2["ClearTokens"] = "ClearTokens";
80
+ AuthSessionEffectStep2["SaveTokens"] = "SaveTokens";
81
+ AuthSessionEffectStep2["ClearStorage"] = "ClearStorage";
82
+ return AuthSessionEffectStep2;
83
+ })(AuthSessionEffectStep || {});
84
+ var TorrowSdkError = class _TorrowSdkError extends Error {
85
+ /** Общая причина отказа. */
86
+ category;
87
+ /** Безопасные метаданные ответа. */
88
+ http;
89
+ /** Неизменяемое предметное уточнение. */
90
+ detail;
91
+ /** Начало fetch; не доставка. */
92
+ request;
93
+ /** Имя составной операции без пользовательских значений. */
94
+ operation;
95
+ /** Стадия отказа без аргументов. */
96
+ failureAt;
97
+ /** Неизменяемые сведения об описанных изменениях. */
98
+ effects;
99
+ #sensitive;
100
+ constructor(init) {
101
+ super(`Torrow SDK: ${init.category}`);
102
+ this.name = "TorrowSdkError";
103
+ this.category = init.category;
104
+ this.http = init.http && Object.freeze({ ...init.http });
105
+ this.detail = init.detail && Object.freeze({ ...init.detail });
106
+ this.request = init.request;
107
+ this.operation = init.operation;
108
+ this.failureAt = init.failureAt;
109
+ this.effects = init.effects && Object.freeze(init.effects.map((effect) => Object.freeze({ ...effect })));
110
+ this.#sensitive = Object.freeze({ ...init.sensitive, cleanup: init.sensitive?.cleanup && Object.freeze({ ...init.sensitive.cleanup }) });
111
+ Object.freeze(this);
112
+ }
113
+ /** Безопасный снимок для обычной сериализации и диагностики. */
114
+ toJSON() {
115
+ return {
116
+ category: this.category,
117
+ http: this.http,
118
+ detail: this.detail,
119
+ request: this.request,
120
+ operation: this.operation,
121
+ failureAt: this.failureAt,
122
+ effects: this.effects
123
+ };
25
124
  }
26
- if (typeof o.title === "string" && o.title.length > 0) {
27
- return o.title;
125
+ /** Явный доступ к секретной диагностике; вызывающий код отвечает за её защиту. */
126
+ getSensitiveDetails() {
127
+ return this.#sensitive;
28
128
  }
29
- if (typeof o.message === "string" && o.message.length > 0) {
30
- return o.message;
129
+ /** Новый снимок для составной операции; исходная ошибка не изменяется. */
130
+ withContext(context) {
131
+ return new _TorrowSdkError({ ...this.toJSON(), ...context, sensitive: this.#sensitive });
31
132
  }
32
- return void 0;
133
+ };
134
+
135
+ // ../../src/http/transport-errors.ts
136
+ var KnownApiErrorName = /* @__PURE__ */ ((KnownApiErrorName2) => {
137
+ KnownApiErrorName2["ResourceUnavailable"] = "REQUESTED_RESOURCE_IS_NOT_AVAILABLE";
138
+ KnownApiErrorName2["QuantityUnavailable"] = "REQUESTED_RESOURCE_QUANTITY_IS_NOT_AVAILABLE";
139
+ KnownApiErrorName2["ServiceUnavailableAtTime"] = "SERVICE_IS_NOT_AVAILABLE_AT_TIME";
140
+ KnownApiErrorName2["WrongVersion"] = "OBJECT_HAS_WRONG_VERSION";
141
+ KnownApiErrorName2["CodeRequestLimit"] = "CODE_REQUEST_LIMIT_EXCEEDED";
142
+ KnownApiErrorName2["AccessDenied"] = "ACCESS_DENIED";
143
+ KnownApiErrorName2["UserNoRights"] = "USER_HAVE_NO_RIGHTS_TO_ELEMENTS";
144
+ KnownApiErrorName2["AuthHeaderMissing"] = "AUTH_HEADER_MISSING";
145
+ KnownApiErrorName2["WrongSessionCode"] = "WRONG_SESSION_ACCESS_CODE";
146
+ KnownApiErrorName2["AttemptsExceeded"] = "EXCEEDED_ATTEMPTS_COUNT";
147
+ return KnownApiErrorName2;
148
+ })(KnownApiErrorName || {});
149
+ function createHttpError(init) {
150
+ const body = record(init.body);
151
+ const code = body?.code;
152
+ const apiCode = typeof code === "string" ? code : typeof code === "number" && Number.isFinite(code) ? String(code) : void 0;
153
+ const apiName = [body?.error, body?.name].find((value) => typeof value === "string" && Object.values(KnownApiErrorName).includes(value));
154
+ const nested = record(body?.torrowError) ?? record(body?.torrowErrorClient) ?? record(body?.innerError);
155
+ const trace = body?.traceIdentifier ?? nested?.traceIdentifier;
156
+ const http = {
157
+ status: init.status,
158
+ apiCode,
159
+ apiErrorName: typeof apiName === "string" ? apiName : void 0,
160
+ requestId: init.requestId,
161
+ traceIdentifier: init.traceIdentifier || (typeof trace === "string" ? trace : void 0)
162
+ };
163
+ const category = init.status === 401 ? "AuthenticationRequired" /* AuthenticationRequired */ : init.status === 403 ? "AccessDenied" /* AccessDenied */ : init.status === 429 ? "RateLimited" /* RateLimited */ : "HttpFailure" /* HttpFailure */;
164
+ return new TorrowSdkError({ category, http, request: "Started" /* Started */, sensitive: init });
33
165
  }
34
- function pickApiCode(body) {
35
- if (body === null || typeof body !== "object") {
36
- return void 0;
37
- }
38
- const c = body.code;
39
- if (typeof c === "string") {
40
- return c;
41
- }
42
- return typeof c === "number" && Number.isFinite(c) ? String(c) : void 0;
166
+ function record(value) {
167
+ return value !== null && typeof value === "object" ? value : void 0;
43
168
  }
44
- function pickTraceIdentifier(body) {
45
- if (body === null || typeof body !== "object") {
46
- return void 0;
47
- }
48
- const o = body;
49
- if (typeof o.traceIdentifier === "string" && o.traceIdentifier.length > 0) {
50
- return o.traceIdentifier;
51
- }
52
- for (const key of ["torrowError", "torrowErrorClient", "innerError"]) {
53
- const nested = o[key];
54
- if (nested !== null && typeof nested === "object") {
55
- const t = nested.traceIdentifier;
56
- if (typeof t === "string" && t.length > 0) {
57
- return t;
58
- }
59
- }
60
- }
61
- return void 0;
169
+ function normalizeTransportError(cause, request, signal, url, parsing = false) {
170
+ if (cause instanceof TorrowSdkError) return cause;
171
+ const cancelled = signal?.aborted || record(cause)?.name === "AbortError";
172
+ const category = cancelled ? "Cancelled" /* Cancelled */ : parsing ? "InvalidResponse" /* InvalidResponse */ : request === "Started" /* Started */ && cause instanceof TypeError ? "TransportFailure" /* TransportFailure */ : "Unknown" /* Unknown */;
173
+ return new TorrowSdkError({ category, request, sensitive: { cause, url } });
62
174
  }
63
- var TorrowHttpError = class _TorrowHttpError extends Error {
64
- status;
65
- body;
66
- apiErrorName;
67
- /** Код ошибки API строкой: числовой `TorrowErrorClient.code` приводится к строке (`"311293"`). */
68
- code;
69
- requestId;
70
- /**
71
- * Идентификатор трассировки шлюза (`TorrowErrorClient.traceIdentifier`
72
- * или заголовок `trace-identifier`) — для саппорта/логов.
73
- */
74
- traceIdentifier;
75
- url;
76
- constructor(init) {
77
- const apiName = pickApiErrorName(init.body);
78
- const code = pickApiCode(init.body);
79
- const traceIdentifier = (typeof init.traceIdentifier === "string" && init.traceIdentifier.length > 0 ? init.traceIdentifier : void 0) ?? pickTraceIdentifier(init.body);
80
- const message = _TorrowHttpError.buildMessage(
81
- init.status,
82
- init.url,
83
- apiName,
84
- code,
85
- traceIdentifier
86
- );
87
- super(message, { cause: init.cause });
88
- this.name = "TorrowHttpError";
89
- this.status = init.status;
90
- this.body = init.body;
91
- this.url = init.url;
92
- this.requestId = init.requestId;
93
- this.traceIdentifier = traceIdentifier;
94
- this.apiErrorName = apiName;
95
- this.code = code;
96
- }
97
- static buildMessage(status, url, apiErrorName, code, traceIdentifier) {
98
- const parts = [`HTTP ${status}`, url];
99
- if (code) {
100
- parts.push(`code=${code}`);
101
- }
102
- if (apiErrorName) {
103
- parts.push(apiErrorName);
104
- }
105
- if (traceIdentifier) {
106
- parts.push(`trace-identifier=${traceIdentifier}`);
107
- }
108
- return parts.join(" \u2014 ");
109
- }
110
- };
111
175
 
112
176
  // ../../src/util/json.ts
113
177
  var ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(Z|([+-])(\d{2}):(\d{2}))$/;
@@ -138,64 +202,274 @@ function stringifyJsonBody(body) {
138
202
  var responseDateNodes = [
139
203
  {},
140
204
  {
141
- "ref": 2
205
+ "items": 2
206
+ },
207
+ {
208
+ "ref": 3
209
+ },
210
+ {
211
+ "properties": {
212
+ "issueDate": 4,
213
+ "expiredDate": 5,
214
+ "subscriptions": 6,
215
+ "image": 15,
216
+ "rating": 16,
217
+ "personalInfo": 19,
218
+ "blockInfo": 41,
219
+ "meta": 44
220
+ }
221
+ },
222
+ {
223
+ "date": true
224
+ },
225
+ {
226
+ "date": true
227
+ },
228
+ {
229
+ "items": 7
230
+ },
231
+ {
232
+ "ref": 8
233
+ },
234
+ {
235
+ "properties": {
236
+ "createDate": 9,
237
+ "beginDate": 10,
238
+ "endDate": 11,
239
+ "image": 12
240
+ }
241
+ },
242
+ {
243
+ "date": true
244
+ },
245
+ {
246
+ "date": true
247
+ },
248
+ {
249
+ "date": true
250
+ },
251
+ {
252
+ "ref": 13
253
+ },
254
+ {
255
+ "properties": {
256
+ "urlExpiration": 14
257
+ }
258
+ },
259
+ {
260
+ "date": true
261
+ },
262
+ {
263
+ "ref": 13
264
+ },
265
+ {
266
+ "ref": 17
267
+ },
268
+ {
269
+ "properties": {
270
+ "date": 18
271
+ }
272
+ },
273
+ {
274
+ "date": true
275
+ },
276
+ {
277
+ "ref": 20
278
+ },
279
+ {
280
+ "properties": {
281
+ "meta": 21,
282
+ "lastUsageTime": 25,
283
+ "personalReminders": 26,
284
+ "subscriptionList": 35
285
+ }
286
+ },
287
+ {
288
+ "ref": 22
289
+ },
290
+ {
291
+ "properties": {
292
+ "lastModified": 23,
293
+ "createDate": 24
294
+ }
295
+ },
296
+ {
297
+ "date": true
298
+ },
299
+ {
300
+ "date": true
301
+ },
302
+ {
303
+ "date": true
304
+ },
305
+ {
306
+ "items": 27
307
+ },
308
+ {
309
+ "ref": 28
310
+ },
311
+ {
312
+ "properties": {
313
+ "date": 29,
314
+ "recurringConditions": 30
315
+ }
316
+ },
317
+ {
318
+ "date": true
319
+ },
320
+ {
321
+ "ref": 31
322
+ },
323
+ {
324
+ "properties": {
325
+ "endDate": 32,
326
+ "beginDate": 33,
327
+ "firstWeekDate": 34
328
+ }
329
+ },
330
+ {
331
+ "date": true
332
+ },
333
+ {
334
+ "date": true
335
+ },
336
+ {
337
+ "date": true
338
+ },
339
+ {
340
+ "items": 36
341
+ },
342
+ {
343
+ "ref": 37
142
344
  },
143
345
  {
144
346
  "properties": {
145
- "files": 3,
146
- "image": 7,
147
- "rating": 8,
148
- "personalInfo": 11,
149
- "blockInfo": 33,
150
- "meta": 36
347
+ "openDate": 38,
348
+ "closeDate": 39,
349
+ "recurringConditions": 40
151
350
  }
152
351
  },
153
352
  {
154
- "items": 4
353
+ "date": true
354
+ },
355
+ {
356
+ "date": true
357
+ },
358
+ {
359
+ "ref": 31
155
360
  },
156
361
  {
157
- "ref": 5
362
+ "ref": 42
158
363
  },
159
364
  {
160
365
  "properties": {
161
- "urlExpiration": 6
366
+ "blockDate": 43
162
367
  }
163
368
  },
164
369
  {
165
370
  "date": true
166
371
  },
167
372
  {
168
- "ref": 5
373
+ "ref": 22
169
374
  },
170
375
  {
171
- "ref": 9
376
+ "items": 46
377
+ },
378
+ {
379
+ "ref": 47
172
380
  },
173
381
  {
174
382
  "properties": {
175
- "date": 10
383
+ "issueDate": 48,
384
+ "expiredDate": 49,
385
+ "itemObject": 50,
386
+ "itemLink": 53,
387
+ "personalViewInfo": 56,
388
+ "image": 62
176
389
  }
177
390
  },
178
391
  {
179
392
  "date": true
180
393
  },
181
394
  {
182
- "ref": 12
395
+ "date": true
396
+ },
397
+ {
398
+ "ref": 51
399
+ },
400
+ {
401
+ "properties": {
402
+ "meta": 52
403
+ }
404
+ },
405
+ {
406
+ "ref": 22
407
+ },
408
+ {
409
+ "ref": 54
410
+ },
411
+ {
412
+ "properties": {
413
+ "meta": 55
414
+ }
415
+ },
416
+ {
417
+ "ref": 22
418
+ },
419
+ {
420
+ "ref": 57
183
421
  },
184
422
  {
185
423
  "properties": {
186
- "meta": 13,
187
- "lastUsageTime": 17,
188
- "personalReminders": 18,
189
- "subscriptionList": 27
424
+ "meta": 58,
425
+ "lastUsageTime": 59,
426
+ "personalReminders": 60
190
427
  }
191
428
  },
192
429
  {
193
- "ref": 14
430
+ "ref": 22
431
+ },
432
+ {
433
+ "date": true
434
+ },
435
+ {
436
+ "items": 61
437
+ },
438
+ {
439
+ "ref": 28
440
+ },
441
+ {
442
+ "ref": 13
443
+ },
444
+ {
445
+ "items": 64
446
+ },
447
+ {
448
+ "ref": 47
449
+ },
450
+ {
451
+ "items": 66
452
+ },
453
+ {
454
+ "ref": 3
455
+ },
456
+ {
457
+ "ref": 3
458
+ },
459
+ {
460
+ "items": 69
461
+ },
462
+ {
463
+ "ref": 70
194
464
  },
195
465
  {
196
466
  "properties": {
197
- "lastModified": 15,
198
- "createDate": 16
467
+ "startDate": 71,
468
+ "expiredDate": 72,
469
+ "itemObject": 73,
470
+ "itemLink": 74,
471
+ "personalViewInfo": 75,
472
+ "image": 76
199
473
  }
200
474
  },
201
475
  {
@@ -204,331 +478,1370 @@ var responseDateNodes = [
204
478
  {
205
479
  "date": true
206
480
  },
481
+ {
482
+ "ref": 51
483
+ },
484
+ {
485
+ "ref": 54
486
+ },
487
+ {
488
+ "ref": 57
489
+ },
490
+ {
491
+ "ref": 13
492
+ },
493
+ {
494
+ "items": 78
495
+ },
496
+ {
497
+ "ref": 70
498
+ },
499
+ {
500
+ "items": 80
501
+ },
502
+ {
503
+ "ref": 81
504
+ },
505
+ {
506
+ "properties": {
507
+ "startDate": 82,
508
+ "expiredDate": 83,
509
+ "initialSubscription": 84,
510
+ "image": 87,
511
+ "rating": 88,
512
+ "personalInfo": 89,
513
+ "blockInfo": 90,
514
+ "meta": 91
515
+ }
516
+ },
517
+ {
518
+ "date": true
519
+ },
207
520
  {
208
521
  "date": true
209
522
  },
210
523
  {
211
- "items": 19
524
+ "ref": 85
525
+ },
526
+ {
527
+ "properties": {
528
+ "image": 86
529
+ }
530
+ },
531
+ {
532
+ "ref": 13
533
+ },
534
+ {
535
+ "ref": 13
536
+ },
537
+ {
538
+ "ref": 17
212
539
  },
213
540
  {
214
541
  "ref": 20
215
542
  },
543
+ {
544
+ "ref": 42
545
+ },
546
+ {
547
+ "ref": 22
548
+ },
549
+ {
550
+ "ref": 81
551
+ },
552
+ {
553
+ "ref": 94
554
+ },
555
+ {
556
+ "properties": {
557
+ "schedule": 95,
558
+ "firstWeekDate": 112,
559
+ "appendixList": 113,
560
+ "priceInfo": 118,
561
+ "image": 124,
562
+ "rating": 125,
563
+ "personalInfo": 126,
564
+ "blockInfo": 127,
565
+ "meta": 128
566
+ }
567
+ },
568
+ {
569
+ "ref": 96
570
+ },
571
+ {
572
+ "properties": {
573
+ "scheduleRanges": 97,
574
+ "scheduleRangeExceptions": 103
575
+ }
576
+ },
577
+ {
578
+ "items": 98
579
+ },
580
+ {
581
+ "ref": 99
582
+ },
216
583
  {
217
584
  "properties": {
218
- "date": 21,
219
- "recurringConditions": 22
585
+ "beginning": 100,
586
+ "ending": 101,
587
+ "recurringConditions": 102
220
588
  }
221
589
  },
222
590
  {
223
591
  "date": true
224
592
  },
225
593
  {
226
- "ref": 23
594
+ "date": true
595
+ },
596
+ {
597
+ "ref": 31
598
+ },
599
+ {
600
+ "ref": 104
227
601
  },
228
602
  {
229
603
  "properties": {
230
- "endDate": 24,
231
- "beginDate": 25,
232
- "firstWeekDate": 26
604
+ "replacedTimeRanges": 105,
605
+ "excludedTimeRanges": 110
233
606
  }
234
607
  },
235
608
  {
236
- "date": true
609
+ "items": 106
610
+ },
611
+ {
612
+ "ref": 107
613
+ },
614
+ {
615
+ "properties": {
616
+ "begin": 108,
617
+ "end": 109
618
+ }
619
+ },
620
+ {
621
+ "date": true
622
+ },
623
+ {
624
+ "date": true
625
+ },
626
+ {
627
+ "items": 111
628
+ },
629
+ {
630
+ "ref": 107
631
+ },
632
+ {
633
+ "date": true
634
+ },
635
+ {
636
+ "items": 114
637
+ },
638
+ {
639
+ "ref": 115
640
+ },
641
+ {
642
+ "properties": {
643
+ "openDate": 116,
644
+ "closeDate": 117
645
+ }
646
+ },
647
+ {
648
+ "date": true
649
+ },
650
+ {
651
+ "date": true
652
+ },
653
+ {
654
+ "ref": 119
655
+ },
656
+ {
657
+ "properties": {
658
+ "settings": 120
659
+ }
660
+ },
661
+ {
662
+ "items": 121
663
+ },
664
+ {
665
+ "ref": 122
666
+ },
667
+ {
668
+ "properties": {
669
+ "schedule": 123
670
+ }
671
+ },
672
+ {
673
+ "ref": 96
674
+ },
675
+ {
676
+ "ref": 13
677
+ },
678
+ {
679
+ "ref": 17
680
+ },
681
+ {
682
+ "ref": 20
683
+ },
684
+ {
685
+ "ref": 42
686
+ },
687
+ {
688
+ "ref": 22
689
+ },
690
+ {
691
+ "items": 130
692
+ },
693
+ {
694
+ "ref": 94
695
+ },
696
+ {
697
+ "items": 132
698
+ },
699
+ {
700
+ "ref": 133
701
+ },
702
+ {
703
+ "properties": {
704
+ "appendixList": 134,
705
+ "itemObject": 136,
706
+ "itemLink": 137,
707
+ "personalViewInfo": 138,
708
+ "image": 139
709
+ }
710
+ },
711
+ {
712
+ "items": 135
713
+ },
714
+ {
715
+ "ref": 115
716
+ },
717
+ {
718
+ "ref": 51
719
+ },
720
+ {
721
+ "ref": 54
722
+ },
723
+ {
724
+ "ref": 57
725
+ },
726
+ {
727
+ "ref": 13
728
+ },
729
+ {
730
+ "items": 141
731
+ },
732
+ {
733
+ "ref": 133
734
+ },
735
+ {
736
+ "items": 143
737
+ },
738
+ {
739
+ "ref": 133
740
+ },
741
+ {
742
+ "ref": 145
743
+ },
744
+ {
745
+ "properties": {
746
+ "schedule": 146,
747
+ "priceInfo": 147,
748
+ "item": 148,
749
+ "parentResource": 155,
750
+ "amountProperties": 156,
751
+ "appendixList": 159,
752
+ "ticketProperties": 161,
753
+ "image": 164,
754
+ "rating": 165,
755
+ "personalInfo": 166,
756
+ "blockInfo": 167,
757
+ "meta": 168
758
+ }
759
+ },
760
+ {
761
+ "ref": 96
762
+ },
763
+ {
764
+ "ref": 119
765
+ },
766
+ {
767
+ "ref": 149
768
+ },
769
+ {
770
+ "properties": {
771
+ "image": 150,
772
+ "rating": 151,
773
+ "personalInfo": 152,
774
+ "blockInfo": 153,
775
+ "meta": 154
776
+ }
777
+ },
778
+ {
779
+ "ref": 13
780
+ },
781
+ {
782
+ "ref": 17
783
+ },
784
+ {
785
+ "ref": 20
786
+ },
787
+ {
788
+ "ref": 42
789
+ },
790
+ {
791
+ "ref": 22
792
+ },
793
+ {
794
+ "ref": 149
795
+ },
796
+ {
797
+ "ref": 157
798
+ },
799
+ {
800
+ "properties": {
801
+ "inventoryDate": 158
802
+ }
803
+ },
804
+ {
805
+ "date": true
806
+ },
807
+ {
808
+ "items": 160
809
+ },
810
+ {
811
+ "ref": 115
812
+ },
813
+ {
814
+ "ref": 162
815
+ },
816
+ {
817
+ "properties": {
818
+ "paymentExpirationDate": 163
819
+ }
820
+ },
821
+ {
822
+ "date": true
823
+ },
824
+ {
825
+ "ref": 13
826
+ },
827
+ {
828
+ "ref": 17
829
+ },
830
+ {
831
+ "ref": 20
832
+ },
833
+ {
834
+ "ref": 42
835
+ },
836
+ {
837
+ "ref": 22
838
+ },
839
+ {
840
+ "items": 170
841
+ },
842
+ {
843
+ "ref": 145
844
+ },
845
+ {
846
+ "items": 172
847
+ },
848
+ {
849
+ "ref": 173
850
+ },
851
+ {
852
+ "properties": {
853
+ "priceInfo": 174,
854
+ "amountProperties": 175,
855
+ "appendixList": 176,
856
+ "itemObject": 178,
857
+ "itemLink": 179,
858
+ "personalViewInfo": 180,
859
+ "image": 181
860
+ }
861
+ },
862
+ {
863
+ "ref": 119
864
+ },
865
+ {
866
+ "ref": 157
867
+ },
868
+ {
869
+ "items": 177
870
+ },
871
+ {
872
+ "ref": 115
873
+ },
874
+ {
875
+ "ref": 51
876
+ },
877
+ {
878
+ "ref": 54
879
+ },
880
+ {
881
+ "ref": 57
882
+ },
883
+ {
884
+ "ref": 13
885
+ },
886
+ {
887
+ "items": 183
888
+ },
889
+ {
890
+ "ref": 173
891
+ },
892
+ {
893
+ "items": 185
894
+ },
895
+ {
896
+ "ref": 173
897
+ },
898
+ {
899
+ "ref": 187
900
+ },
901
+ {
902
+ "properties": {
903
+ "beginDate": 188,
904
+ "endDate": 189,
905
+ "caseStateDate": 190,
906
+ "personalInfo": 191,
907
+ "bookingResourceList": 215,
908
+ "schedule": 217,
909
+ "appendixList": 218,
910
+ "priceInfo": 220,
911
+ "image": 221,
912
+ "rating": 222,
913
+ "blockInfo": 223,
914
+ "meta": 224
915
+ }
916
+ },
917
+ {
918
+ "date": true
919
+ },
920
+ {
921
+ "date": true
922
+ },
923
+ {
924
+ "date": true
925
+ },
926
+ {
927
+ "ref": 192
928
+ },
929
+ {
930
+ "properties": {
931
+ "caseParticipant": 193,
932
+ "ticketResource": 207,
933
+ "paymentResource": 208,
934
+ "meta": 209,
935
+ "lastUsageTime": 210,
936
+ "personalReminders": 211,
937
+ "subscriptionList": 213
938
+ }
939
+ },
940
+ {
941
+ "ref": 194
942
+ },
943
+ {
944
+ "properties": {
945
+ "meta": 195,
946
+ "bookingResourceList": 196,
947
+ "lastConfirmationDate": 200,
948
+ "confirmationWaitingDate": 201,
949
+ "groupCaseProperties": 202,
950
+ "bookingExpirationDate": 206
951
+ }
952
+ },
953
+ {
954
+ "ref": 22
955
+ },
956
+ {
957
+ "items": 197
958
+ },
959
+ {
960
+ "ref": 198
961
+ },
962
+ {
963
+ "properties": {
964
+ "processingDate": 199
965
+ }
966
+ },
967
+ {
968
+ "date": true
969
+ },
970
+ {
971
+ "date": true
972
+ },
973
+ {
974
+ "date": true
975
+ },
976
+ {
977
+ "ref": 203
978
+ },
979
+ {
980
+ "properties": {
981
+ "excludedTimeRanges": 204
982
+ }
983
+ },
984
+ {
985
+ "items": 205
986
+ },
987
+ {
988
+ "ref": 107
989
+ },
990
+ {
991
+ "date": true
992
+ },
993
+ {
994
+ "ref": 145
995
+ },
996
+ {
997
+ "ref": 145
998
+ },
999
+ {
1000
+ "ref": 22
1001
+ },
1002
+ {
1003
+ "date": true
1004
+ },
1005
+ {
1006
+ "items": 212
1007
+ },
1008
+ {
1009
+ "ref": 28
1010
+ },
1011
+ {
1012
+ "items": 214
1013
+ },
1014
+ {
1015
+ "ref": 37
1016
+ },
1017
+ {
1018
+ "items": 216
1019
+ },
1020
+ {
1021
+ "ref": 198
1022
+ },
1023
+ {
1024
+ "ref": 96
1025
+ },
1026
+ {
1027
+ "items": 219
1028
+ },
1029
+ {
1030
+ "ref": 115
1031
+ },
1032
+ {
1033
+ "ref": 119
1034
+ },
1035
+ {
1036
+ "ref": 13
1037
+ },
1038
+ {
1039
+ "ref": 17
1040
+ },
1041
+ {
1042
+ "ref": 42
1043
+ },
1044
+ {
1045
+ "ref": 22
1046
+ },
1047
+ {
1048
+ "items": 226
1049
+ },
1050
+ {
1051
+ "ref": 187
1052
+ },
1053
+ {
1054
+ "items": 228
1055
+ },
1056
+ {
1057
+ "ref": 229
1058
+ },
1059
+ {
1060
+ "properties": {
1061
+ "endDate": 230,
1062
+ "beginDate": 231,
1063
+ "schedule": 232,
1064
+ "caseParticipant": 233,
1065
+ "appendixList": 234,
1066
+ "itemObject": 236,
1067
+ "itemLink": 237,
1068
+ "personalViewInfo": 238,
1069
+ "image": 239
1070
+ }
1071
+ },
1072
+ {
1073
+ "date": true
1074
+ },
1075
+ {
1076
+ "date": true
1077
+ },
1078
+ {
1079
+ "ref": 96
1080
+ },
1081
+ {
1082
+ "ref": 194
1083
+ },
1084
+ {
1085
+ "items": 235
1086
+ },
1087
+ {
1088
+ "ref": 115
1089
+ },
1090
+ {
1091
+ "ref": 51
1092
+ },
1093
+ {
1094
+ "ref": 54
1095
+ },
1096
+ {
1097
+ "ref": 57
1098
+ },
1099
+ {
1100
+ "ref": 13
1101
+ },
1102
+ {
1103
+ "items": 241
1104
+ },
1105
+ {
1106
+ "ref": 229
1107
+ },
1108
+ {
1109
+ "items": 243
1110
+ },
1111
+ {
1112
+ "ref": 229
1113
+ },
1114
+ {
1115
+ "ref": 245
1116
+ },
1117
+ {
1118
+ "properties": {
1119
+ "scheduleRangeExceptions": 246,
1120
+ "image": 247,
1121
+ "rating": 248,
1122
+ "personalInfo": 249,
1123
+ "blockInfo": 250,
1124
+ "meta": 251
1125
+ }
1126
+ },
1127
+ {
1128
+ "ref": 104
1129
+ },
1130
+ {
1131
+ "ref": 13
1132
+ },
1133
+ {
1134
+ "ref": 17
1135
+ },
1136
+ {
1137
+ "ref": 20
1138
+ },
1139
+ {
1140
+ "ref": 42
1141
+ },
1142
+ {
1143
+ "ref": 22
1144
+ },
1145
+ {
1146
+ "items": 253
1147
+ },
1148
+ {
1149
+ "ref": 245
1150
+ },
1151
+ {
1152
+ "items": 255
1153
+ },
1154
+ {
1155
+ "ref": 256
1156
+ },
1157
+ {
1158
+ "properties": {
1159
+ "itemObject": 257,
1160
+ "itemLink": 258,
1161
+ "personalViewInfo": 259,
1162
+ "image": 260
1163
+ }
1164
+ },
1165
+ {
1166
+ "ref": 51
1167
+ },
1168
+ {
1169
+ "ref": 54
1170
+ },
1171
+ {
1172
+ "ref": 57
1173
+ },
1174
+ {
1175
+ "ref": 13
1176
+ },
1177
+ {
1178
+ "items": 262
1179
+ },
1180
+ {
1181
+ "ref": 256
1182
+ },
1183
+ {
1184
+ "items": 264
1185
+ },
1186
+ {
1187
+ "ref": 256
1188
+ },
1189
+ {
1190
+ "ref": 266
1191
+ },
1192
+ {
1193
+ "properties": {
1194
+ "files": 267,
1195
+ "image": 269,
1196
+ "rating": 270,
1197
+ "personalInfo": 271,
1198
+ "blockInfo": 272,
1199
+ "meta": 273
1200
+ }
1201
+ },
1202
+ {
1203
+ "items": 268
1204
+ },
1205
+ {
1206
+ "ref": 13
1207
+ },
1208
+ {
1209
+ "ref": 13
1210
+ },
1211
+ {
1212
+ "ref": 17
1213
+ },
1214
+ {
1215
+ "ref": 20
1216
+ },
1217
+ {
1218
+ "ref": 42
1219
+ },
1220
+ {
1221
+ "ref": 22
1222
+ },
1223
+ {
1224
+ "ref": 266
1225
+ },
1226
+ {
1227
+ "items": 276
1228
+ },
1229
+ {
1230
+ "ref": 266
1231
+ },
1232
+ {
1233
+ "ref": 266
1234
+ },
1235
+ {
1236
+ "ref": 51
1237
+ },
1238
+ {
1239
+ "ref": 51
1240
+ },
1241
+ {
1242
+ "ref": 149
1243
+ },
1244
+ {
1245
+ "ref": 282
1246
+ },
1247
+ {
1248
+ "properties": {
1249
+ "includeResp": 283
1250
+ }
1251
+ },
1252
+ {
1253
+ "ref": 284
1254
+ },
1255
+ {
1256
+ "properties": {
1257
+ "linkMetaList": 285
1258
+ }
1259
+ },
1260
+ {
1261
+ "items": 286
1262
+ },
1263
+ {
1264
+ "ref": 287
1265
+ },
1266
+ {
1267
+ "properties": {
1268
+ "info": 288
1269
+ }
1270
+ },
1271
+ {
1272
+ "ref": 22
1273
+ },
1274
+ {
1275
+ "ref": 290
1276
+ },
1277
+ {
1278
+ "properties": {
1279
+ "meta": 291,
1280
+ "subscriptionList": 292
1281
+ }
1282
+ },
1283
+ {
1284
+ "ref": 22
1285
+ },
1286
+ {
1287
+ "items": 293
1288
+ },
1289
+ {
1290
+ "ref": 37
1291
+ },
1292
+ {
1293
+ "items": 295
1294
+ },
1295
+ {
1296
+ "ref": 296
1297
+ },
1298
+ {
1299
+ "properties": {
1300
+ "file": 297,
1301
+ "files": 298,
1302
+ "itemObject": 300,
1303
+ "itemLink": 301,
1304
+ "personalViewInfo": 302,
1305
+ "image": 303
1306
+ }
1307
+ },
1308
+ {
1309
+ "ref": 13
1310
+ },
1311
+ {
1312
+ "items": 299
1313
+ },
1314
+ {
1315
+ "ref": 13
1316
+ },
1317
+ {
1318
+ "ref": 51
1319
+ },
1320
+ {
1321
+ "ref": 54
1322
+ },
1323
+ {
1324
+ "ref": 57
1325
+ },
1326
+ {
1327
+ "ref": 13
1328
+ },
1329
+ {
1330
+ "items": 305
1331
+ },
1332
+ {
1333
+ "ref": 296
1334
+ },
1335
+ {
1336
+ "items": 307
1337
+ },
1338
+ {
1339
+ "ref": 296
1340
+ },
1341
+ {
1342
+ "ref": 309
1343
+ },
1344
+ {
1345
+ "properties": {
1346
+ "birthday": 310,
1347
+ "communications": 311,
1348
+ "dates": 315,
1349
+ "photos": 319,
1350
+ "activityStatus": 321,
1351
+ "personalInfo": 326,
1352
+ "loyaltyCard": 335,
1353
+ "image": 336,
1354
+ "rating": 337,
1355
+ "blockInfo": 338,
1356
+ "meta": 339
1357
+ }
1358
+ },
1359
+ {
1360
+ "date": true
1361
+ },
1362
+ {
1363
+ "items": 312
1364
+ },
1365
+ {
1366
+ "ref": 313
1367
+ },
1368
+ {
1369
+ "properties": {
1370
+ "checkDate": 314
1371
+ }
1372
+ },
1373
+ {
1374
+ "date": true
1375
+ },
1376
+ {
1377
+ "items": 316
1378
+ },
1379
+ {
1380
+ "ref": 317
1381
+ },
1382
+ {
1383
+ "properties": {
1384
+ "date": 318
1385
+ }
1386
+ },
1387
+ {
1388
+ "date": true
1389
+ },
1390
+ {
1391
+ "items": 320
1392
+ },
1393
+ {
1394
+ "ref": 13
1395
+ },
1396
+ {
1397
+ "ref": 322
1398
+ },
1399
+ {
1400
+ "properties": {
1401
+ "lastActivityTime": 323,
1402
+ "meetingTime": 324,
1403
+ "nextChangeStatusTime": 325
1404
+ }
1405
+ },
1406
+ {
1407
+ "date": true
1408
+ },
1409
+ {
1410
+ "date": true
1411
+ },
1412
+ {
1413
+ "date": true
1414
+ },
1415
+ {
1416
+ "ref": 327
1417
+ },
1418
+ {
1419
+ "properties": {
1420
+ "confirmDate": 328,
1421
+ "meta": 329,
1422
+ "lastUsageTime": 330,
1423
+ "personalReminders": 331,
1424
+ "subscriptionList": 333
1425
+ }
1426
+ },
1427
+ {
1428
+ "date": true
1429
+ },
1430
+ {
1431
+ "ref": 22
1432
+ },
1433
+ {
1434
+ "date": true
1435
+ },
1436
+ {
1437
+ "items": 332
1438
+ },
1439
+ {
1440
+ "ref": 28
1441
+ },
1442
+ {
1443
+ "items": 334
1444
+ },
1445
+ {
1446
+ "ref": 37
237
1447
  },
238
1448
  {
239
- "date": true
1449
+ "ref": 149
240
1450
  },
241
1451
  {
242
- "date": true
1452
+ "ref": 13
243
1453
  },
244
1454
  {
245
- "items": 28
1455
+ "ref": 17
246
1456
  },
247
1457
  {
248
- "ref": 29
1458
+ "ref": 42
249
1459
  },
250
1460
  {
251
- "properties": {
252
- "openDate": 30,
253
- "closeDate": 31,
254
- "recurringConditions": 32
255
- }
1461
+ "ref": 22
256
1462
  },
257
1463
  {
258
- "date": true
1464
+ "items": 341
259
1465
  },
260
1466
  {
261
- "date": true
1467
+ "ref": 309
262
1468
  },
263
1469
  {
264
- "ref": 23
1470
+ "items": 343
265
1471
  },
266
1472
  {
267
- "ref": 34
1473
+ "ref": 344
268
1474
  },
269
1475
  {
270
1476
  "properties": {
271
- "blockDate": 35
1477
+ "activityStatus": 345,
1478
+ "itemObject": 346,
1479
+ "itemLink": 347,
1480
+ "personalViewInfo": 348,
1481
+ "image": 349
272
1482
  }
273
1483
  },
274
1484
  {
275
- "date": true
1485
+ "ref": 322
276
1486
  },
277
1487
  {
278
- "ref": 14
1488
+ "ref": 51
279
1489
  },
280
1490
  {
281
- "ref": 2
1491
+ "ref": 54
282
1492
  },
283
1493
  {
284
- "ref": 2
1494
+ "ref": 57
285
1495
  },
286
1496
  {
287
- "ref": 40
1497
+ "ref": 13
288
1498
  },
289
1499
  {
290
- "properties": {
291
- "meta": 41
292
- }
1500
+ "items": 351
293
1501
  },
294
1502
  {
295
- "ref": 14
1503
+ "ref": 344
296
1504
  },
297
1505
  {
298
- "ref": 40
1506
+ "items": 353
299
1507
  },
300
1508
  {
301
- "ref": 44
1509
+ "ref": 344
302
1510
  },
303
1511
  {
304
- "properties": {
305
- "image": 45,
306
- "rating": 46,
307
- "personalInfo": 47,
308
- "blockInfo": 48,
309
- "meta": 49
310
- }
1512
+ "ref": 355
311
1513
  },
312
1514
  {
313
- "ref": 5
1515
+ "properties": {
1516
+ "image": 356,
1517
+ "rating": 357,
1518
+ "personalInfo": 358,
1519
+ "blockInfo": 359,
1520
+ "meta": 360
1521
+ }
314
1522
  },
315
1523
  {
316
- "ref": 9
1524
+ "ref": 13
317
1525
  },
318
1526
  {
319
- "ref": 12
1527
+ "ref": 17
320
1528
  },
321
1529
  {
322
- "ref": 34
1530
+ "ref": 20
323
1531
  },
324
1532
  {
325
- "ref": 14
1533
+ "ref": 42
326
1534
  },
327
1535
  {
328
- "ref": 51
1536
+ "ref": 22
329
1537
  },
330
1538
  {
331
- "properties": {
332
- "includeResp": 52
333
- }
1539
+ "items": 362
334
1540
  },
335
1541
  {
336
- "ref": 53
1542
+ "ref": 355
337
1543
  },
338
1544
  {
339
- "properties": {
340
- "linkMetaList": 54
341
- }
1545
+ "ref": 355
342
1546
  },
343
1547
  {
344
- "items": 55
1548
+ "items": 365
345
1549
  },
346
1550
  {
347
- "ref": 56
1551
+ "ref": 366
348
1552
  },
349
1553
  {
350
1554
  "properties": {
351
- "info": 57
1555
+ "itemObject": 367,
1556
+ "itemLink": 368,
1557
+ "personalViewInfo": 369,
1558
+ "image": 370
352
1559
  }
353
1560
  },
354
1561
  {
355
- "ref": 14
1562
+ "ref": 51
356
1563
  },
357
1564
  {
358
- "ref": 59
1565
+ "ref": 54
359
1566
  },
360
1567
  {
361
- "properties": {
362
- "meta": 60,
363
- "subscriptionList": 61
364
- }
1568
+ "ref": 57
365
1569
  },
366
1570
  {
367
- "ref": 14
1571
+ "ref": 13
368
1572
  },
369
1573
  {
370
- "items": 62
1574
+ "items": 372
371
1575
  },
372
1576
  {
373
- "ref": 29
1577
+ "ref": 366
1578
+ }
1579
+ ];
1580
+ var responseDateRoutes = [
1581
+ {
1582
+ "method": "GET",
1583
+ "path": "/api/v1/loyaltycards/personallist",
1584
+ "responses": {
1585
+ "200": 65
1586
+ }
374
1587
  },
375
1588
  {
376
- "items": 64
1589
+ "method": "GET",
1590
+ "path": "/api/v1/loyaltysystems/personallist",
1591
+ "responses": {
1592
+ "200": 79
1593
+ }
377
1594
  },
378
1595
  {
379
- "ref": 65
1596
+ "method": "GET",
1597
+ "path": "/api/v1/services/personallist",
1598
+ "responses": {
1599
+ "200": 129
1600
+ }
380
1601
  },
381
1602
  {
382
- "properties": {
383
- "file": 66,
384
- "files": 67,
385
- "itemObject": 69,
386
- "itemLink": 70,
387
- "personalViewInfo": 73,
388
- "image": 79
1603
+ "method": "GET",
1604
+ "path": "/api/v1/search/services",
1605
+ "responses": {
1606
+ "200": 142
389
1607
  }
390
1608
  },
391
1609
  {
392
- "ref": 5
1610
+ "method": "GET",
1611
+ "path": "/api/v1/resources/personallist",
1612
+ "responses": {
1613
+ "200": 169
1614
+ }
393
1615
  },
394
1616
  {
395
- "items": 68
1617
+ "method": "GET",
1618
+ "path": "/api/v1/search/resources",
1619
+ "responses": {
1620
+ "200": 184
1621
+ }
396
1622
  },
397
1623
  {
398
- "ref": 5
1624
+ "method": "GET",
1625
+ "path": "/api/v1/cases/personallist",
1626
+ "responses": {
1627
+ "200": 225
1628
+ }
399
1629
  },
400
1630
  {
401
- "ref": 40
1631
+ "method": "GET",
1632
+ "path": "/api/v1/search/cases",
1633
+ "responses": {
1634
+ "200": 242
1635
+ }
402
1636
  },
403
1637
  {
404
- "ref": 71
1638
+ "method": "GET",
1639
+ "path": "/api/v1/calendars/personallist",
1640
+ "responses": {
1641
+ "200": 252
1642
+ }
405
1643
  },
406
1644
  {
407
- "properties": {
408
- "meta": 72
1645
+ "method": "GET",
1646
+ "path": "/api/v1/search/calendars",
1647
+ "responses": {
1648
+ "200": 263
409
1649
  }
410
1650
  },
411
1651
  {
412
- "ref": 14
1652
+ "method": "POST",
1653
+ "path": "/api/v1/notes",
1654
+ "responses": {
1655
+ "200": 265
1656
+ }
413
1657
  },
414
1658
  {
415
- "ref": 74
1659
+ "method": "GET",
1660
+ "path": "/api/v1/notes/personallist",
1661
+ "responses": {
1662
+ "200": 275
1663
+ }
416
1664
  },
417
1665
  {
418
- "properties": {
419
- "meta": 75,
420
- "lastUsageTime": 76,
421
- "personalReminders": 77
1666
+ "method": "GET",
1667
+ "path": "/api/v1/search/notes",
1668
+ "responses": {
1669
+ "200": 306
422
1670
  }
423
1671
  },
424
1672
  {
425
- "ref": 14
1673
+ "method": "GET",
1674
+ "path": "/api/v1/contacts/personallist",
1675
+ "responses": {
1676
+ "200": 340
1677
+ }
426
1678
  },
427
1679
  {
428
- "date": true
1680
+ "method": "GET",
1681
+ "path": "/api/v1/search/contacts",
1682
+ "responses": {
1683
+ "200": 352
1684
+ }
429
1685
  },
430
1686
  {
431
- "items": 78
1687
+ "method": "POST",
1688
+ "path": "/api/v1/contexts",
1689
+ "responses": {
1690
+ "200": 354
1691
+ }
432
1692
  },
433
1693
  {
434
- "ref": 20
1694
+ "method": "GET",
1695
+ "path": "/api/v1/contexts/personallist",
1696
+ "responses": {
1697
+ "200": 361
1698
+ }
435
1699
  },
436
1700
  {
437
- "ref": 5
1701
+ "method": "POST",
1702
+ "path": "/api/v1/loyaltysystems/{torrowId}/loyaltycards",
1703
+ "responses": {
1704
+ "200": 1
1705
+ }
438
1706
  },
439
1707
  {
440
- "items": 81
1708
+ "method": "GET",
1709
+ "path": "/api/v1/loyaltycards/{parentId}/views/pinned",
1710
+ "responses": {
1711
+ "200": 45
1712
+ }
441
1713
  },
442
1714
  {
443
- "ref": 65
1715
+ "method": "GET",
1716
+ "path": "/api/v1/loyaltycards/{parentId}/views/user",
1717
+ "responses": {
1718
+ "200": 63
1719
+ }
444
1720
  },
445
1721
  {
446
- "items": 83
1722
+ "method": "GET",
1723
+ "path": "/api/v1/loyaltycards/{torrowId}",
1724
+ "responses": {
1725
+ "200": 67
1726
+ }
447
1727
  },
448
1728
  {
449
- "ref": 65
1729
+ "method": "GET",
1730
+ "path": "/api/v1/loyaltysystems/{parentId}/views/pinned",
1731
+ "responses": {
1732
+ "200": 68
1733
+ }
450
1734
  },
451
1735
  {
452
- "ref": 85
1736
+ "method": "GET",
1737
+ "path": "/api/v1/loyaltysystems/{parentId}/views/user",
1738
+ "responses": {
1739
+ "200": 77
1740
+ }
453
1741
  },
454
1742
  {
455
- "properties": {
456
- "image": 86,
457
- "rating": 87,
458
- "personalInfo": 88,
459
- "blockInfo": 89,
460
- "meta": 90
1743
+ "method": "GET",
1744
+ "path": "/api/v1/loyaltysystems/{torrowId}",
1745
+ "responses": {
1746
+ "200": 92
461
1747
  }
462
1748
  },
463
1749
  {
464
- "ref": 5
1750
+ "method": "GET",
1751
+ "path": "/api/v1/services/{torrowId}",
1752
+ "responses": {
1753
+ "200": 93
1754
+ }
465
1755
  },
466
1756
  {
467
- "ref": 9
1757
+ "method": "GET",
1758
+ "path": "/api/v1/services/{parentId}/views/user",
1759
+ "responses": {
1760
+ "200": 131
1761
+ }
468
1762
  },
469
1763
  {
470
- "ref": 12
1764
+ "method": "GET",
1765
+ "path": "/api/v1/services/{parentId}/views/pinned",
1766
+ "responses": {
1767
+ "200": 140
1768
+ }
471
1769
  },
472
1770
  {
473
- "ref": 34
1771
+ "method": "GET",
1772
+ "path": "/api/v1/resources/{torrowId}",
1773
+ "responses": {
1774
+ "200": 144
1775
+ }
474
1776
  },
475
1777
  {
476
- "ref": 14
1778
+ "method": "GET",
1779
+ "path": "/api/v1/resources/{parentId}/views/user",
1780
+ "responses": {
1781
+ "200": 171
1782
+ }
477
1783
  },
478
1784
  {
479
- "items": 92
1785
+ "method": "GET",
1786
+ "path": "/api/v1/resources/{parentId}/views/pinned",
1787
+ "responses": {
1788
+ "200": 182
1789
+ }
480
1790
  },
481
1791
  {
482
- "ref": 85
483
- }
484
- ];
485
- var responseDateRoutes = [
1792
+ "method": "GET",
1793
+ "path": "/api/v1/cases/{torrowId}",
1794
+ "responses": {
1795
+ "200": 186
1796
+ }
1797
+ },
486
1798
  {
487
- "method": "POST",
488
- "path": "/api/v1/notes",
1799
+ "method": "GET",
1800
+ "path": "/api/v1/cases/{parentId}/views/user",
489
1801
  "responses": {
490
- "200": 1
1802
+ "200": 227
491
1803
  }
492
1804
  },
493
1805
  {
494
1806
  "method": "GET",
495
- "path": "/api/v1/search/notes",
1807
+ "path": "/api/v1/cases/{parentId}/views/pinned",
496
1808
  "responses": {
497
- "200": 82
1809
+ "200": 240
498
1810
  }
499
1811
  },
500
1812
  {
501
- "method": "POST",
502
- "path": "/api/v1/contexts",
1813
+ "method": "GET",
1814
+ "path": "/api/v1/calendars/{torrowId}",
503
1815
  "responses": {
504
- "200": 84
1816
+ "200": 244
505
1817
  }
506
1818
  },
507
1819
  {
508
1820
  "method": "GET",
509
- "path": "/api/v1/contexts/personallist",
1821
+ "path": "/api/v1/calendars/{parentId}/views/user",
510
1822
  "responses": {
511
- "200": 91
1823
+ "200": 254
512
1824
  }
513
1825
  },
514
1826
  {
515
1827
  "method": "GET",
516
- "path": "/api/v1/notes/personallist",
517
- "responses": {},
518
- "legacy": true
1828
+ "path": "/api/v1/calendars/{parentId}/views/pinned",
1829
+ "responses": {
1830
+ "200": 261
1831
+ }
519
1832
  },
520
1833
  {
521
1834
  "method": "GET",
522
1835
  "path": "/api/v1/notes/{torrowId}",
523
1836
  "responses": {
524
- "200": 37
1837
+ "200": 274
525
1838
  }
526
1839
  },
527
1840
  {
528
1841
  "method": "PUT",
529
1842
  "path": "/api/v1/notes/{torrowId}",
530
1843
  "responses": {
531
- "200": 38
1844
+ "200": 277
532
1845
  }
533
1846
  },
534
1847
  {
@@ -542,49 +1855,91 @@ var responseDateRoutes = [
542
1855
  "method": "PUT",
543
1856
  "path": "/api/v1/notes/{torrowId}/tags",
544
1857
  "responses": {
545
- "200": 39
1858
+ "200": 278
546
1859
  }
547
1860
  },
548
1861
  {
549
1862
  "method": "PUT",
550
1863
  "path": "/api/v1/notes/{torrowId}/solutiondata",
551
1864
  "responses": {
552
- "200": 42
1865
+ "200": 279
553
1866
  }
554
1867
  },
555
1868
  {
556
1869
  "method": "PUT",
557
1870
  "path": "/api/v1/notes/{torrowId}/group/set",
558
1871
  "responses": {
559
- "200": 43
1872
+ "200": 280
560
1873
  }
561
1874
  },
562
1875
  {
563
1876
  "method": "PUT",
564
1877
  "path": "/api/v1/notes/{torrowId}/updategroups",
565
1878
  "responses": {
566
- "200": 50
1879
+ "200": 281
567
1880
  }
568
1881
  },
569
1882
  {
570
1883
  "method": "PUT",
571
1884
  "path": "/api/v1/notes/{torrowId}/savetomindmap",
572
1885
  "responses": {
573
- "200": 58
1886
+ "200": 289
574
1887
  }
575
1888
  },
576
1889
  {
577
1890
  "method": "GET",
578
1891
  "path": "/api/v1/notes/{parentId}/views/user",
579
1892
  "responses": {
580
- "200": 63
1893
+ "200": 294
581
1894
  }
582
1895
  },
583
1896
  {
584
1897
  "method": "GET",
585
1898
  "path": "/api/v1/notes/{parentId}/views/pinned",
586
1899
  "responses": {
587
- "200": 80
1900
+ "200": 304
1901
+ }
1902
+ },
1903
+ {
1904
+ "method": "GET",
1905
+ "path": "/api/v1/contacts/{torrowId}",
1906
+ "responses": {
1907
+ "200": 308
1908
+ }
1909
+ },
1910
+ {
1911
+ "method": "GET",
1912
+ "path": "/api/v1/contacts/{parentId}/views/user",
1913
+ "responses": {
1914
+ "200": 342
1915
+ }
1916
+ },
1917
+ {
1918
+ "method": "GET",
1919
+ "path": "/api/v1/contacts/{parentId}/views/pinned",
1920
+ "responses": {
1921
+ "200": 350
1922
+ }
1923
+ },
1924
+ {
1925
+ "method": "GET",
1926
+ "path": "/api/v1/contexts/{torrowId}",
1927
+ "responses": {
1928
+ "200": 363
1929
+ }
1930
+ },
1931
+ {
1932
+ "method": "GET",
1933
+ "path": "/api/v1/contexts/{parentId}/views/user",
1934
+ "responses": {
1935
+ "200": 364
1936
+ }
1937
+ },
1938
+ {
1939
+ "method": "GET",
1940
+ "path": "/api/v1/contexts/{parentId}/views/pinned",
1941
+ "responses": {
1942
+ "200": 371
588
1943
  }
589
1944
  }
590
1945
  ];
@@ -679,49 +2034,59 @@ var HttpClient = class {
679
2034
  this.config = config;
680
2035
  }
681
2036
  config;
2037
+ /** Выполняет запрос; сетевые и подготовительные отказы возвращает как TorrowSdkError. */
682
2038
  async requestJson(init, onDispatch) {
683
- const { fetch: fetchFn = globalThis.fetch } = this.config;
684
- const url = this.buildUrl(init.path, init.query);
685
- const authHeaders = await buildAuthHeaders(this.config);
686
- const headers = {
687
- Accept: JSON_MIME,
688
- ...authHeaders,
689
- ...this.config.defaultHeaders,
690
- ...init.headers
691
- };
692
- if (this.config.userAgent) {
693
- headers["User-Agent"] = this.config.userAgent;
694
- }
695
- const needsBody = init.body !== void 0 && init.method !== "GET" && init.method !== "DELETE";
696
- if (needsBody) {
697
- headers["Content-Type"] = JSON_MIME;
698
- }
699
- const requestInit = {
700
- method: init.method,
701
- headers,
702
- body: needsBody ? stringifyJsonBody(init.body) : void 0,
703
- signal: init.signal
704
- };
705
- if (onDispatch) init.signal?.throwIfAborted();
706
- onDispatch?.();
707
- const res = await fetchFn(url, requestInit);
708
- const requestId = res.headers.get("x-request-id") ?? void 0;
709
- const traceIdentifier = res.headers.get("trace-identifier") ?? void 0;
710
- const text = await res.text();
711
- if (!res.ok) {
712
- const errBody = tryParseErrorBody(text, res.headers.get("content-type"));
713
- throw new TorrowHttpError({
714
- status: res.status,
715
- body: errBody,
716
- url,
717
- requestId,
718
- traceIdentifier
719
- });
720
- }
721
- if (text === "") {
722
- return void 0;
2039
+ let request = "NotStarted" /* NotStarted */;
2040
+ let url;
2041
+ let parsing = false;
2042
+ try {
2043
+ const { fetch: fetchFn = globalThis.fetch } = this.config;
2044
+ url = this.buildUrl(init.path, init.query);
2045
+ const authHeaders = await buildAuthHeaders(this.config);
2046
+ const headers = {
2047
+ Accept: JSON_MIME,
2048
+ ...authHeaders,
2049
+ ...this.config.defaultHeaders,
2050
+ ...init.headers
2051
+ };
2052
+ if (this.config.userAgent) {
2053
+ headers["User-Agent"] = this.config.userAgent;
2054
+ }
2055
+ const needsBody = init.body !== void 0 && init.method !== "GET" && init.method !== "DELETE";
2056
+ if (needsBody) {
2057
+ headers["Content-Type"] = JSON_MIME;
2058
+ }
2059
+ const requestInit = {
2060
+ method: init.method,
2061
+ headers,
2062
+ body: needsBody ? stringifyJsonBody(init.body) : void 0,
2063
+ signal: init.signal
2064
+ };
2065
+ init.signal?.throwIfAborted();
2066
+ onDispatch?.();
2067
+ request = "Started" /* Started */;
2068
+ const res = await fetchFn(url, requestInit);
2069
+ const requestId = res.headers.get("x-request-id") ?? void 0;
2070
+ const traceIdentifier = res.headers.get("trace-identifier") ?? void 0;
2071
+ const text = await res.text();
2072
+ if (!res.ok) {
2073
+ const errBody = tryParseErrorBody(text, res.headers.get("content-type"));
2074
+ throw createHttpError({
2075
+ status: res.status,
2076
+ body: errBody,
2077
+ url,
2078
+ requestId,
2079
+ traceIdentifier
2080
+ });
2081
+ }
2082
+ if (text === "") {
2083
+ return void 0;
2084
+ }
2085
+ parsing = true;
2086
+ return parseOperationResponse(text, init.method, init.path, res.status);
2087
+ } catch (cause) {
2088
+ throw normalizeTransportError(cause, request, init.signal, url, parsing);
723
2089
  }
724
- return parseOperationResponse(text, init.method, init.path, res.status);
725
2090
  }
726
2091
  buildUrl(path, query) {
727
2092
  const origin = this.config.baseUrl ?? DEFAULT_TORROW_API_BASE_URL;
@@ -3079,6 +4444,28 @@ var RelationsFacade = class {
3079
4444
  }
3080
4445
  };
3081
4446
 
4447
+ // ../../src/resources/common/behavior-settings-errors.ts
4448
+ function behaviorSettingsError(category) {
4449
+ return new TorrowSdkError({ category, detail: { domain: "BehaviorSettings" /* BehaviorSettings */ } });
4450
+ }
4451
+ function contextualizeBehaviorError(cause, operation, failureAt, state) {
4452
+ const error = cause instanceof TorrowSdkError ? cause : new TorrowSdkError({
4453
+ category: "Unknown" /* Unknown */,
4454
+ sensitive: { cause }
4455
+ });
4456
+ return error.withContext({
4457
+ operation,
4458
+ failureAt,
4459
+ detail: error.detail ?? { domain: "BehaviorSettings" /* BehaviorSettings */ },
4460
+ effects: state === void 0 ? void 0 : [{ area: "Remote" /* Remote */, step: "Write" /* Write */, state }]
4461
+ });
4462
+ }
4463
+ function isBehaviorCasRefusal(cause) {
4464
+ if (!(cause instanceof TorrowSdkError) || cause.request !== "Started" /* Started */ || cause.http?.status !== 500) return false;
4465
+ const body = cause.getSensitiveDetails().body;
4466
+ return body !== null && typeof body === "object" && "name" in body && body.name === "OBJECT_HAS_WRONG_VERSION" /* VersionConflict */ && "code" in body && (body.code === 208213 /* VersionConflict */ || body.code === String(208213 /* VersionConflict */));
4467
+ }
4468
+
3082
4469
  // ../../src/resources/common/implicit-tag-params.ts
3083
4470
  var SERVICE_IMPLICIT_TAG_SUFFIX = {
3084
4471
  orderNameLegacy: ":ordername",
@@ -3486,39 +4873,77 @@ var ResourcesFacade = class extends TorrowItemFacade {
3486
4873
  return this.getBehaviorSettingsFromResource(resource);
3487
4874
  }
3488
4875
  async updateBehaviorSettings(resourceId, settingsPatch, options) {
3489
- const resource = await this.getById(resourceId, {
3490
- includeDeleted: options?.includeDeleted,
3491
- isNeedItem: options?.isNeedItem,
3492
- isNeedParentResource: options?.isNeedParentResource,
3493
- includeChildTypes: options?.includeChildTypes,
3494
- securityToken: options?.securityToken,
3495
- signal: options?.signal
3496
- });
3497
- const mergeParameters = options?.mergeParameters ?? true;
3498
- const nextSettings = mergeParameters ? {
3499
- ...this.getBehaviorSettingsFromResource(resource),
3500
- ...settingsPatch
3501
- } : { ...settingsPatch };
3502
- const nextTags = mergeResourceBehaviorTags(resource.tags, nextSettings);
3503
- await this.updateTags(resourceId, nextTags, {
3504
- versionToCheck: options?.checkVersion ? resource.meta?.version ?? void 0 : void 0,
3505
- isNeedAnnouncement: options?.isNeedAnnouncement,
3506
- signal: options?.signal
3507
- });
3508
- return this.getById(resourceId, {
3509
- includeDeleted: options?.includeDeleted,
3510
- isNeedItem: options?.isNeedItem,
3511
- isNeedParentResource: options?.isNeedParentResource,
3512
- includeChildTypes: options?.includeChildTypes,
3513
- securityToken: options?.securityToken,
3514
- signal: options?.signal
3515
- });
4876
+ return this.writeBehaviorSettings(resourceId, settingsPatch, options, "ResourcesFacade.updateBehaviorSettings" /* ResourceUpdate */);
4877
+ }
4878
+ /** Контекст локален вызову; алгоритм и число запросов двух публичных операций совпадают. */
4879
+ async writeBehaviorSettings(resourceId, settingsPatch, options, operation) {
4880
+ let failureAt = "ReadCurrent" /* ReadCurrent */;
4881
+ let effect = "NotApplied" /* NotApplied */;
4882
+ try {
4883
+ const resource = await this.getById(resourceId, {
4884
+ includeDeleted: options?.includeDeleted,
4885
+ isNeedItem: options?.isNeedItem,
4886
+ isNeedParentResource: options?.isNeedParentResource,
4887
+ includeChildTypes: options?.includeChildTypes,
4888
+ securityToken: options?.securityToken,
4889
+ signal: options?.signal
4890
+ });
4891
+ failureAt = "PrepareWrite" /* PrepareWrite */;
4892
+ const mergeParameters = options?.mergeParameters ?? true;
4893
+ const nextSettings = mergeParameters ? {
4894
+ ...this.getBehaviorSettingsFromResource(resource),
4895
+ ...settingsPatch
4896
+ } : { ...settingsPatch };
4897
+ const nextTags = mergeResourceBehaviorTags(resource.tags, nextSettings);
4898
+ failureAt = "WriteSettings" /* WriteSettings */;
4899
+ let dispatched = false;
4900
+ let acknowledgement;
4901
+ try {
4902
+ acknowledgement = await this.http.requestJson({
4903
+ method: "PUT",
4904
+ path: `${BASE7}/${encodePathSegment(resourceId)}/tags`,
4905
+ body: nextTags,
4906
+ query: {
4907
+ versionToCheck: options?.checkVersion ? resource.meta?.version ?? void 0 : void 0,
4908
+ isNeedAnnouncement: options?.isNeedAnnouncement
4909
+ },
4910
+ signal: options?.signal
4911
+ }, () => {
4912
+ dispatched = true;
4913
+ });
4914
+ } catch (cause) {
4915
+ effect = dispatched ? "Unknown" /* Unknown */ : "NotApplied" /* NotApplied */;
4916
+ const error = contextualizeBehaviorError(cause, operation, failureAt, effect).withContext({
4917
+ request: dispatched ? "Started" /* Started */ : "NotStarted" /* NotStarted */
4918
+ });
4919
+ if (dispatched && isBehaviorCasRefusal(error)) {
4920
+ effect = "NotApplied" /* NotApplied */;
4921
+ throw error.withContext({
4922
+ category: "VersionConflict" /* VersionConflict */,
4923
+ detail: { domain: "BehaviorSettings" /* BehaviorSettings */ }
4924
+ });
4925
+ }
4926
+ throw error;
4927
+ }
4928
+ effect = acknowledgement?.id === resourceId ? "Applied" /* Applied */ : "Unknown" /* Unknown */;
4929
+ failureAt = "ReadBack" /* ReadBack */;
4930
+ return await this.getById(resourceId, {
4931
+ includeDeleted: options?.includeDeleted,
4932
+ isNeedItem: options?.isNeedItem,
4933
+ isNeedParentResource: options?.isNeedParentResource,
4934
+ includeChildTypes: options?.includeChildTypes,
4935
+ securityToken: options?.securityToken,
4936
+ signal: options?.signal
4937
+ });
4938
+ } catch (cause) {
4939
+ throw contextualizeBehaviorError(cause, operation, failureAt, effect);
4940
+ }
3516
4941
  }
3517
4942
  setBehaviorSettings(resourceId, settings, options) {
3518
- return this.updateBehaviorSettings(resourceId, settings, {
4943
+ return this.writeBehaviorSettings(resourceId, settings, {
3519
4944
  ...options,
3520
4945
  mergeParameters: false
3521
- });
4946
+ }, "ResourcesFacade.setBehaviorSettings" /* ResourceSet */);
3522
4947
  }
3523
4948
  /** `GET /api/v1/resources/personallist` */
3524
4949
  listPersonal(options) {
@@ -3590,61 +5015,39 @@ var ResourcesFacade = class extends TorrowItemFacade {
3590
5015
  };
3591
5016
 
3592
5017
  // ../../src/resources/services/behavior-settings.ts
3593
- var ServiceBehaviorSettingsErrorCategory = /* @__PURE__ */ ((ServiceBehaviorSettingsErrorCategory2) => {
3594
- ServiceBehaviorSettingsErrorCategory2["InvalidInput"] = "InvalidInput";
3595
- ServiceBehaviorSettingsErrorCategory2["AccessDenied"] = "AccessDenied";
3596
- ServiceBehaviorSettingsErrorCategory2["InsufficientData"] = "InsufficientData";
3597
- ServiceBehaviorSettingsErrorCategory2["InvalidResponse"] = "InvalidResponse";
3598
- ServiceBehaviorSettingsErrorCategory2["VersionConflict"] = "VersionConflict";
3599
- ServiceBehaviorSettingsErrorCategory2["WriteOutcomeUnknown"] = "WriteOutcomeUnknown";
3600
- ServiceBehaviorSettingsErrorCategory2["RequestNotSent"] = "RequestNotSent";
3601
- return ServiceBehaviorSettingsErrorCategory2;
3602
- })(ServiceBehaviorSettingsErrorCategory || {});
3603
5018
  var ServiceBehaviorSettingsIssueReason = /* @__PURE__ */ ((ServiceBehaviorSettingsIssueReason2) => {
3604
5019
  ServiceBehaviorSettingsIssueReason2["InvalidValue"] = "InvalidValue";
3605
5020
  ServiceBehaviorSettingsIssueReason2["AmbiguousValue"] = "AmbiguousValue";
3606
5021
  return ServiceBehaviorSettingsIssueReason2;
3607
5022
  })(ServiceBehaviorSettingsIssueReason || {});
3608
- var ServiceBehaviorSettingsError = class extends Error {
3609
- /** Предметная категория; не зависит от кодов MCP. */
3610
- category;
3611
- /** Исходная ошибка транспорта или сервера, если она существует. */
3612
- cause;
3613
- constructor(category, cause) {
3614
- super(`Service BehaviorSettings: ${category}`);
3615
- this.name = "ServiceBehaviorSettingsError";
3616
- this.category = category;
3617
- this.cause = cause;
3618
- }
3619
- };
3620
5023
  var configs = Object.values(SERVICE_IMPLICIT_TAG_REGISTRY);
3621
5024
  function isBehaviorVersion(value) {
3622
5025
  return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 2147483647;
3623
5026
  }
3624
- function record(value) {
5027
+ function record2(value) {
3625
5028
  return value !== null && typeof value === "object" && !Array.isArray(value);
3626
5029
  }
3627
5030
  function validateBehaviorResponse(value, serviceId) {
3628
- if (!record(value) || value.id !== serviceId) throw new ServiceBehaviorSettingsError("InvalidResponse" /* InvalidResponse */);
5031
+ if (!record2(value) || value.id !== serviceId) throw behaviorSettingsError("InvalidResponse" /* InvalidResponse */);
3629
5032
  const personal = value.personalInfo;
3630
- if (record(personal) && (personal.itemContentType === "NoRights" /* NoRights */ || personal.itemContentType === "SubscriptionIsNotValid" /* SubscriptionIsNotValid */)) {
3631
- throw new ServiceBehaviorSettingsError("AccessDenied" /* AccessDenied */);
5033
+ if (record2(personal) && (personal.itemContentType === "NoRights" /* NoRights */ || personal.itemContentType === "SubscriptionIsNotValid" /* SubscriptionIsNotValid */)) {
5034
+ throw behaviorSettingsError("AccessDenied" /* AccessDenied */);
3632
5035
  }
3633
- if (!record(personal) || personal.itemContentType !== "Full" /* Full */ || value.tags == null || !record(value.meta) || !isBehaviorVersion(value.meta.version)) {
3634
- throw new ServiceBehaviorSettingsError("InsufficientData" /* InsufficientData */);
5036
+ if (!record2(personal) || personal.itemContentType !== "Full" /* Full */ || value.tags == null || !record2(value.meta) || !isBehaviorVersion(value.meta.version)) {
5037
+ throw behaviorSettingsError("InsufficientData" /* InsufficientData */);
3635
5038
  }
3636
5039
  if (!Array.isArray(value.tags) || !value.tags.every((tag) => typeof tag === "string")) {
3637
- throw new ServiceBehaviorSettingsError("InvalidResponse" /* InvalidResponse */);
5040
+ throw behaviorSettingsError("InvalidResponse" /* InvalidResponse */);
3638
5041
  }
3639
5042
  const operations = personal.operationList;
3640
5043
  if (operations != null && (!Array.isArray(operations) || !operations.every((operation) => typeof operation === "string" || typeof operation === "number" && Number.isSafeInteger(operation)))) {
3641
- throw new ServiceBehaviorSettingsError("InvalidResponse" /* InvalidResponse */);
5044
+ throw behaviorSettingsError("InvalidResponse" /* InvalidResponse */);
3642
5045
  }
3643
5046
  return { tags: [...new Set(value.tags)], version: value.meta.version, operations };
3644
5047
  }
3645
5048
  function assertBehaviorPermission(operations) {
3646
- if (!Array.isArray(operations)) throw new ServiceBehaviorSettingsError("InsufficientData" /* InsufficientData */);
3647
- if (!operations.includes("SetItemTags" /* SetItemTags */)) throw new ServiceBehaviorSettingsError("AccessDenied" /* AccessDenied */);
5049
+ if (!Array.isArray(operations)) throw behaviorSettingsError("InsufficientData" /* InsufficientData */);
5050
+ if (!operations.includes("SetItemTags" /* SetItemTags */)) throw behaviorSettingsError("AccessDenied" /* AccessDenied */);
3648
5051
  }
3649
5052
  function suffixPrefix(tag, suffix, ignoreCase = false) {
3650
5053
  const matches = ignoreCase ? tag.toLowerCase().endsWith(suffix.toLowerCase()) : tag.endsWith(suffix);
@@ -3724,9 +5127,9 @@ function readBehaviorSettings(tags) {
3724
5127
  }
3725
5128
  function normalizeBehaviorInput(input) {
3726
5129
  function fail() {
3727
- throw new ServiceBehaviorSettingsError("InvalidInput" /* InvalidInput */);
5130
+ throw behaviorSettingsError("InvalidInput" /* InvalidInput */);
3728
5131
  }
3729
- if (!record(input) || Object.keys(input).some((key) => !Object.hasOwn(SERVICE_IMPLICIT_TAG_REGISTRY, key))) fail();
5132
+ if (!record2(input) || Object.keys(input).some((key) => !Object.hasOwn(SERVICE_IMPLICIT_TAG_REGISTRY, key))) fail();
3730
5133
  const output = {};
3731
5134
  for (const config of configs) {
3732
5135
  if (!Object.hasOwn(input, config.field)) continue;
@@ -3744,7 +5147,7 @@ function normalizeBehaviorInput(input) {
3744
5147
  if (!Array.isArray(value)) fail();
3745
5148
  const seen = /* @__PURE__ */ new Set();
3746
5149
  output[config.field] = value.map((entry) => {
3747
- if (!record(entry) || Object.keys(entry).some((key) => !["index", "text", "link"].includes(key)) || typeof entry.index !== "number" || !Number.isSafeInteger(entry.index) || entry.index <= 0 || seen.has(entry.index)) fail();
5150
+ if (!record2(entry) || Object.keys(entry).some((key) => !["index", "text", "link"].includes(key)) || typeof entry.index !== "number" || !Number.isSafeInteger(entry.index) || entry.index <= 0 || seen.has(entry.index)) fail();
3748
5151
  seen.add(entry.index);
3749
5152
  const normalized = { index: entry.index };
3750
5153
  for (const attribute of ["text", "link"]) {
@@ -3897,7 +5300,7 @@ var ServicesFacade = class extends TorrowItemFacade {
3897
5300
  /** Читает сырой OpenAPI DTO до проекции, чтобы malformed tags не маскировались парсером. */
3898
5301
  async readBehaviorState(serviceId, options) {
3899
5302
  if (typeof serviceId !== "string" || !serviceId.trim()) {
3900
- throw new ServiceBehaviorSettingsError("InvalidInput" /* InvalidInput */);
5303
+ throw behaviorSettingsError("InvalidInput" /* InvalidInput */);
3901
5304
  }
3902
5305
  const value = await this.http.requestJson({
3903
5306
  method: "GET",
@@ -3915,8 +5318,12 @@ var ServicesFacade = class extends TorrowItemFacade {
3915
5318
  }
3916
5319
  /** Один GET: версия всей услуги, предметные настройки и диагностика неполного снимка. */
3917
5320
  async getBehaviorSettings(serviceId, options) {
3918
- const state = await this.readBehaviorState(serviceId, options);
3919
- return { serviceId, version: state.version, ...readBehaviorSettings(state.tags) };
5321
+ try {
5322
+ const state = await this.readBehaviorState(serviceId, options);
5323
+ return { serviceId, version: state.version, ...readBehaviorSettings(state.tags) };
5324
+ } catch (cause) {
5325
+ throw contextualizeBehaviorError(cause, "ServicesFacade.getBehaviorSettings" /* ServiceGet */, "ReadCurrent" /* ReadCurrent */);
5326
+ }
3920
5327
  }
3921
5328
  /**
3922
5329
  * GET → локальный patch → PUT /tags с необязательной проверкой версии; автоматического readback нет.
@@ -3924,56 +5331,84 @@ var ServicesFacade = class extends TorrowItemFacade {
3924
5331
  * Порядок и одинаковые дубли сервер не сохраняет; no-op определяется множеством строк.
3925
5332
  */
3926
5333
  async updateBehaviorSettings(serviceId, settingsPatch, options = {}) {
3927
- if (!options || options.versionToCheck !== void 0 && !isBehaviorVersion(options.versionToCheck) || Object.hasOwn(options, "checkVersion") && options.checkVersion !== true || Object.hasOwn(options, "mergeParameters") && typeof options.mergeParameters !== "boolean" || options.isNeedAnnouncement != null && typeof options.isNeedAnnouncement !== "boolean" || Object.keys(options).some((key) => !["versionToCheck", "checkVersion", "mergeParameters", "profileId", "securityToken", "isNeedAnnouncement", "signal"].includes(key))) {
3928
- throw new ServiceBehaviorSettingsError("InvalidInput" /* InvalidInput */);
3929
- }
3930
- const normalized = normalizeBehaviorInput(settingsPatch);
3931
- options = { ...options };
3932
- const state = await this.readBehaviorState(serviceId, {
3933
- profileId: options.profileId,
3934
- securityToken: options.securityToken,
3935
- signal: options.signal
3936
- });
3937
- assertBehaviorPermission(state.operations);
3938
- if (options.versionToCheck !== void 0 && state.version !== options.versionToCheck) {
3939
- throw new ServiceBehaviorSettingsError("VersionConflict" /* VersionConflict */);
3940
- }
3941
- const tags = mergeBehaviorSettings(state.tags, normalized, options.mergeParameters ?? true);
3942
- const projected = readBehaviorSettings(tags);
3943
- const unchanged = tags.length === state.tags.length && tags.every((tag) => state.tags.includes(tag));
3944
- if (unchanged) return { serviceId, version: state.version, ...projected, changed: false };
3945
- let dispatched = false;
3946
- let result;
5334
+ return this.writeBehaviorSettings(serviceId, settingsPatch, options, "ServicesFacade.updateBehaviorSettings" /* ServiceUpdate */);
5335
+ }
5336
+ /** Общий алгоритм двух публичных операций; контекст и эффект принадлежат только текущему вызову. */
5337
+ async writeBehaviorSettings(serviceId, settingsPatch, options, operation) {
5338
+ let failureAt = "ValidateInput" /* ValidateInput */;
5339
+ let effect = "NotApplied" /* NotApplied */;
3947
5340
  try {
3948
- result = await this.http.requestJson({
3949
- method: "PUT",
3950
- path: `${BASE9}/${encodePathSegment(serviceId)}/tags`,
3951
- query: { versionToCheck: options.versionToCheck ?? (options.checkVersion ? state.version : void 0), isNeedAnnouncement: options.isNeedAnnouncement ?? false },
3952
- body: tags,
5341
+ if (!options || options.versionToCheck !== void 0 && !isBehaviorVersion(options.versionToCheck) || Object.hasOwn(options, "checkVersion") && options.checkVersion !== true || Object.hasOwn(options, "mergeParameters") && typeof options.mergeParameters !== "boolean" || options.isNeedAnnouncement != null && typeof options.isNeedAnnouncement !== "boolean" || Object.keys(options).some((key) => !["versionToCheck", "checkVersion", "mergeParameters", "profileId", "securityToken", "isNeedAnnouncement", "signal"].includes(key))) {
5342
+ throw behaviorSettingsError("InvalidInput" /* InvalidInput */);
5343
+ }
5344
+ const normalized = normalizeBehaviorInput(settingsPatch);
5345
+ options = { ...options };
5346
+ failureAt = "ReadCurrent" /* ReadCurrent */;
5347
+ const state = await this.readBehaviorState(serviceId, {
5348
+ profileId: options.profileId,
5349
+ securityToken: options.securityToken,
3953
5350
  signal: options.signal
3954
- }, () => {
3955
- dispatched = true;
3956
5351
  });
3957
- } catch (cause) {
3958
- if (dispatched && cause instanceof TorrowHttpError && cause.status === 500 && cause.body !== null && typeof cause.body === "object" && "name" in cause.body && cause.body.name === "OBJECT_HAS_WRONG_VERSION" /* VersionConflict */ && "code" in cause.body && (cause.body.code === 208213 /* VersionConflict */ || cause.body.code === String(208213 /* VersionConflict */))) {
3959
- throw new ServiceBehaviorSettingsError("VersionConflict" /* VersionConflict */, cause);
5352
+ failureAt = "PrepareWrite" /* PrepareWrite */;
5353
+ assertBehaviorPermission(state.operations);
5354
+ if (options.versionToCheck !== void 0 && state.version !== options.versionToCheck) {
5355
+ throw behaviorSettingsError("VersionConflict" /* VersionConflict */);
3960
5356
  }
3961
- throw new ServiceBehaviorSettingsError(dispatched ? "WriteOutcomeUnknown" /* WriteOutcomeUnknown */ : "RequestNotSent" /* RequestNotSent */, cause);
3962
- }
3963
- if (!result || result.id !== serviceId || !isBehaviorVersion(result.meta?.version)) {
3964
- throw new ServiceBehaviorSettingsError("WriteOutcomeUnknown" /* WriteOutcomeUnknown */);
5357
+ const tags = mergeBehaviorSettings(state.tags, normalized, options.mergeParameters ?? true);
5358
+ const projected = readBehaviorSettings(tags);
5359
+ const unchanged = tags.length === state.tags.length && tags.every((tag) => state.tags.includes(tag));
5360
+ if (unchanged) return { serviceId, version: state.version, ...projected, changed: false };
5361
+ failureAt = "WriteSettings" /* WriteSettings */;
5362
+ let result;
5363
+ let dispatched = false;
5364
+ try {
5365
+ result = await this.http.requestJson({
5366
+ method: "PUT",
5367
+ path: `${BASE9}/${encodePathSegment(serviceId)}/tags`,
5368
+ query: { versionToCheck: options.versionToCheck ?? (options.checkVersion ? state.version : void 0), isNeedAnnouncement: options.isNeedAnnouncement ?? false },
5369
+ body: tags,
5370
+ signal: options.signal
5371
+ }, () => {
5372
+ dispatched = true;
5373
+ });
5374
+ } catch (cause) {
5375
+ effect = dispatched ? "Unknown" /* Unknown */ : "NotApplied" /* NotApplied */;
5376
+ const error = contextualizeBehaviorError(cause, operation, failureAt, effect).withContext({
5377
+ request: dispatched ? "Started" /* Started */ : "NotStarted" /* NotStarted */
5378
+ });
5379
+ if (dispatched && isBehaviorCasRefusal(error)) {
5380
+ effect = "NotApplied" /* NotApplied */;
5381
+ throw error.withContext({
5382
+ category: "VersionConflict" /* VersionConflict */,
5383
+ detail: { domain: "BehaviorSettings" /* BehaviorSettings */ }
5384
+ });
5385
+ }
5386
+ throw error;
5387
+ }
5388
+ effect = "Unknown" /* Unknown */;
5389
+ failureAt = "ValidateWriteResponse" /* ValidateWriteResponse */;
5390
+ if (!result || result.id !== serviceId || !isBehaviorVersion(result.meta?.version)) {
5391
+ throw new TorrowSdkError({
5392
+ category: "InvalidResponse" /* InvalidResponse */,
5393
+ request: "Started" /* Started */,
5394
+ detail: { domain: "BehaviorSettings" /* BehaviorSettings */ },
5395
+ sensitive: { body: result }
5396
+ });
5397
+ }
5398
+ return { serviceId, version: result.meta.version, ...projected, changed: true };
5399
+ } catch (cause) {
5400
+ throw contextualizeBehaviorError(cause, operation, failureAt, effect);
3965
5401
  }
3966
- return { serviceId, version: result.meta.version, ...projected, changed: true };
3967
5402
  }
3968
5403
  /** Полная замена: пропущенные поля очищаются, посторонние данные сохраняются. */
3969
5404
  setBehaviorSettings(serviceId, settings, options = {}) {
3970
- return this.updateBehaviorSettings(serviceId, settings, { ...options, mergeParameters: false });
5405
+ return this.writeBehaviorSettings(serviceId, settings, { ...options, mergeParameters: false }, "ServicesFacade.setBehaviorSettings" /* ServiceSet */);
3971
5406
  }
3972
5407
  /**
3973
5408
  * Запись на услугу — `POST /api/v1/services/{serviceId}/order`.
3974
5409
  * Минимум в теле: непустой смысл в `checkInProperties` (слот, участник, контакты — по правилам услуги и OpenAPI).
3975
5410
  * Успех: `OrderResp` (часто интересен `order` как кейс и `consumerSecurityToken` для гостевого доступа).
3976
- * Типичные отказы: нет слота, услуга недоступна по времени, подписка/баланс — разбирай тело `TorrowHttpError` (`name` / `code`); эталон UX — `torrow-apps` `CreateOrderTask`.
5411
+ * Типичные отказы: нет слота, услуга недоступна по времени, подписка/баланс — разбирай тело `TorrowSdkError` (`name` / `code`); эталон UX — `torrow-apps` `CreateOrderTask`.
3977
5412
  */
3978
5413
  createOrder(serviceId, body, options) {
3979
5414
  return createOrder(this.http, serviceId, body, options);
@@ -5800,21 +7235,30 @@ var ShortUrlFacade = class {
5800
7235
  * Возвращает заголовок `Location` без следования редиректу.
5801
7236
  */
5802
7237
  async getRedirectLocation(shortUrl, options) {
5803
- const fetchFn = this.config.fetch ?? globalThis.fetch;
5804
- const origin = this.config.baseUrl ?? DEFAULT_TORROW_API_BASE_URL;
5805
- const url = joinBaseUrlAndPath(origin, `${BASE27}/${encodePathSegment(shortUrl)}`);
5806
- const authHeaders = await buildAuthHeaders(this.config);
5807
- const res = await fetchFn(url, {
5808
- method: "GET",
5809
- redirect: "manual",
5810
- headers: {
5811
- Accept: "*/*",
5812
- ...authHeaders,
5813
- ...this.config.defaultHeaders
5814
- },
5815
- signal: options?.signal
5816
- });
5817
- return res.headers.get("Location");
7238
+ let request = "NotStarted" /* NotStarted */;
7239
+ let url;
7240
+ try {
7241
+ const fetchFn = this.config.fetch ?? globalThis.fetch;
7242
+ const origin = this.config.baseUrl ?? DEFAULT_TORROW_API_BASE_URL;
7243
+ url = joinBaseUrlAndPath(origin, `${BASE27}/${encodePathSegment(shortUrl)}`);
7244
+ const authHeaders = await buildAuthHeaders(this.config);
7245
+ const init = {
7246
+ method: "GET",
7247
+ redirect: "manual",
7248
+ headers: {
7249
+ Accept: "*/*",
7250
+ ...authHeaders,
7251
+ ...this.config.defaultHeaders
7252
+ },
7253
+ signal: options?.signal
7254
+ };
7255
+ options?.signal?.throwIfAborted();
7256
+ request = "Started" /* Started */;
7257
+ const res = await fetchFn(url, init);
7258
+ return res.headers.get("Location");
7259
+ } catch (cause) {
7260
+ throw normalizeTransportError(cause, request, options?.signal, url);
7261
+ }
5818
7262
  }
5819
7263
  };
5820
7264
 
@@ -6966,8 +8410,8 @@ var ServiceOrderConflictErrorNameValues = {
6966
8410
  ServiceUnavailableAtTime: "SERVICE_IS_NOT_AVAILABLE_AT_TIME"
6967
8411
  };
6968
8412
  function getServiceOrderConflictReason(error) {
6969
- if (!(error instanceof TorrowHttpError)) return void 0;
6970
- switch (error.apiErrorName) {
8413
+ if (!(error instanceof TorrowSdkError)) return void 0;
8414
+ switch (error.http?.apiErrorName) {
6971
8415
  case ServiceOrderConflictErrorNameValues.ResourceUnavailable:
6972
8416
  return "resource-unavailable";
6973
8417
  case ServiceOrderConflictErrorNameValues.QuantityUnavailable:
@@ -7171,6 +8615,9 @@ export {
7171
8615
  AuthFacade,
7172
8616
  AuthScopeValueList,
7173
8617
  AuthScopeValues,
8618
+ AuthSessionEffectStep,
8619
+ AuthSessionErrorReason,
8620
+ BehaviorSettingsEffectStep,
7174
8621
  BlockReasonsFacade,
7175
8622
  CalendarsFacade,
7176
8623
  CaseStateValues,
@@ -7206,6 +8653,7 @@ export {
7206
8653
  LoyaltySystemsFacade,
7207
8654
  NoteTypeValues,
7208
8655
  NotesFacade,
8656
+ OtpErrorReason,
7209
8657
  ParticipationFieldRequirementTypeValues,
7210
8658
  ParticipationFieldTypeValues,
7211
8659
  PinnedViewsFacade,
@@ -7219,8 +8667,6 @@ export {
7219
8667
  SearchFacade,
7220
8668
  SendCodeAccountTypeValueList,
7221
8669
  SendCodeAccountTypeValues,
7222
- ServiceBehaviorSettingsError,
7223
- ServiceBehaviorSettingsErrorCategory,
7224
8670
  ServiceBehaviorSettingsIssueReason,
7225
8671
  ServiceBuilder,
7226
8672
  ServiceCheckInWizardStepParameterName,
@@ -7241,11 +8687,16 @@ export {
7241
8687
  TokenStatusValueList,
7242
8688
  TokenStatusValues,
7243
8689
  TorrowClient,
7244
- TorrowHttpError,
7245
8690
  TorrowIdError,
7246
8691
  TorrowItemTypeValueList,
7247
8692
  TorrowItemTypeValues,
7248
8693
  TorrowObjectTypeCode,
8694
+ TorrowSdkEffectArea,
8695
+ TorrowSdkEffectState,
8696
+ TorrowSdkError,
8697
+ TorrowSdkErrorCategory,
8698
+ TorrowSdkErrorDomain,
8699
+ TorrowSdkRequestState,
7249
8700
  UsageConditionTypeValues,
7250
8701
  UsageTypeValues,
7251
8702
  UserAccessLevelValues,