@curless/hotel-storefront 0.58.2 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/fake-mall.d.ts +19 -0
- package/dist/account/fake-mall.d.ts.map +1 -1
- package/dist/account/fake-mall.js +81 -10
- package/dist/account/fake-mall.js.map +1 -1
- package/dist/account/index.d.ts +75 -3
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +765 -31
- package/dist/account/index.js.map +1 -1
- package/dist/account/mall.d.ts +3 -1
- package/dist/account/mall.d.ts.map +1 -1
- package/dist/account/mall.js +17 -2
- package/dist/account/mall.js.map +1 -1
- package/dist/account/ota-member.d.ts +72 -0
- package/dist/account/ota-member.d.ts.map +1 -0
- package/dist/account/ota-member.js +127 -0
- package/dist/account/ota-member.js.map +1 -0
- package/dist/account/pages.d.ts +99 -4
- package/dist/account/pages.d.ts.map +1 -1
- package/dist/account/pages.js +221 -16
- package/dist/account/pages.js.map +1 -1
- package/dist/account/requests.d.ts +13 -1
- package/dist/account/requests.d.ts.map +1 -1
- package/dist/account/requests.js +2 -1
- package/dist/account/requests.js.map +1 -1
- package/dist/account/store.d.ts +8 -0
- package/dist/account/store.d.ts.map +1 -1
- package/dist/account/store.js.map +1 -1
- package/dist/aggregate/places.d.ts +10 -0
- package/dist/aggregate/places.d.ts.map +1 -1
- package/dist/aggregate/places.js +21 -0
- package/dist/aggregate/places.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/choices.d.ts +88 -0
- package/dist/choices.d.ts.map +1 -0
- package/dist/choices.js +126 -0
- package/dist/choices.js.map +1 -0
- package/dist/otaless/backend.d.ts +28 -0
- package/dist/otaless/backend.d.ts.map +1 -1
- package/dist/otaless/backend.js +349 -93
- package/dist/otaless/backend.js.map +1 -1
- package/dist/otaless/client.d.ts +46 -4
- package/dist/otaless/client.d.ts.map +1 -1
- package/dist/otaless/client.js +138 -35
- package/dist/otaless/client.js.map +1 -1
- package/dist/otaless/limits.d.ts +58 -0
- package/dist/otaless/limits.d.ts.map +1 -0
- package/dist/otaless/limits.js +132 -0
- package/dist/otaless/limits.js.map +1 -0
- package/dist/otaless/make.d.ts.map +1 -1
- package/dist/otaless/make.js +14 -1
- package/dist/otaless/make.js.map +1 -1
- package/dist/otaless/places.d.ts +40 -4
- package/dist/otaless/places.d.ts.map +1 -1
- package/dist/otaless/places.js +152 -2
- package/dist/otaless/places.js.map +1 -1
- package/dist/present.d.ts +12 -1
- package/dist/present.d.ts.map +1 -1
- package/dist/present.js +27 -1
- package/dist/present.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +53 -35
- package/dist/server.js.map +1 -1
- package/dist/sessions.d.ts +23 -4
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +57 -7
- package/dist/sessions.js.map +1 -1
- package/dist/supplier.d.ts +6 -0
- package/dist/supplier.d.ts.map +1 -1
- package/dist/supplier.js.map +1 -1
- package/dist/surface.js +1 -1
- package/dist/surface.js.map +1 -1
- package/dist/tools.d.ts +11 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +424 -169
- package/dist/tools.js.map +1 -1
- package/dist/trip-ids.d.ts +35 -4
- package/dist/trip-ids.d.ts.map +1 -1
- package/dist/trip-ids.js +87 -19
- package/dist/trip-ids.js.map +1 -1
- package/dist/types.d.ts +35 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.generated.js","sourceRoot":"","sources":["../src/card.generated.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wEAAwE;AACxE,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAChD,
|
|
1
|
+
{"version":3,"file":"card.generated.js","sourceRoot":"","sources":["../src/card.generated.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wEAAwE;AACxE,gFAAgF;AAChF,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAW,MAAM,CAAC,IAAI,CAChD,8gizCAA8gizC,EAC9gizC,QAAQ,CACT,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEnB,6GAA6G;AAC7G,MAAM,CAAC,MAAM,qBAAqB,GAChC,kEAAkE,CAAC;AAErE,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAChC,iLAAiL,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numbered choices a client that draws no card is told - a hotel's rooms,
|
|
3
|
+
* a list of hotels - as paragraphs (robin 11-09, after RollingGo's text answers:
|
|
4
|
+
* 「我们的文字版本的你看看可以按照我后面那个图优化吗」). Every brand alike: the
|
|
5
|
+
* wording of a rate or a hotel is tools.ts's; how a list of them is laid out is
|
|
6
|
+
* here.
|
|
7
|
+
*
|
|
8
|
+
* **1. Deluxe King Room(豪华大床房)**
|
|
9
|
+
* 2.0米大床. Free to cancel until Wed 18 Nov, 14:00. ¥478 a night before taxes.
|
|
10
|
+
* Cheapest · Free cancellation · ¥507
|
|
11
|
+
*
|
|
12
|
+
* - The title is bold and numbered, a paragraph and not a Markdown list: Manus
|
|
13
|
+
* renumbers a list and hangs its wrapped lines (robin's screenshot), and the
|
|
14
|
+
* number is what the guest answers with.
|
|
15
|
+
* - The sentence is only what sets this one apart; what every one of them has
|
|
16
|
+
* is said once, before them - and what most have, once, as "unless one says
|
|
17
|
+
* otherwise", with the rest saying theirs (总线程 11-09, ①).
|
|
18
|
+
* - Two tags at most, then the price; a tag every one of them - or more than
|
|
19
|
+
* half - would carry sets none apart, and is not given (总线程 11-09, 2).
|
|
20
|
+
* - Lines, not a table (robin). Single newlines hold in Claude Code's terminal
|
|
21
|
+
* (checked 11-09) and in chat views that break on them; a view that joins
|
|
22
|
+
* them shows each choice as one paragraph, still numbered and apart.
|
|
23
|
+
*/
|
|
24
|
+
/** One choice: its title, the sentence of what sets it apart, its tags and its price. */
|
|
25
|
+
export type Choice = {
|
|
26
|
+
title: string;
|
|
27
|
+
sentence: string;
|
|
28
|
+
tags: string[];
|
|
29
|
+
price: string;
|
|
30
|
+
};
|
|
31
|
+
/** At most this many tags before the price. */
|
|
32
|
+
export declare const TAGS_SHOWN = 2;
|
|
33
|
+
/** A choice as its lines - the title bold and numbered, then what sets it apart, then its tags. */
|
|
34
|
+
export declare const choiceBlock: (n: number, c: Choice) => string;
|
|
35
|
+
/**
|
|
36
|
+
* How one fact runs across a list: the same for every one ('all', said once
|
|
37
|
+
* before them); the same for more than half, two at least ('most', said once
|
|
38
|
+
* as what holds unless one says otherwise); or each its own ('each'). A list of
|
|
39
|
+
* one is always 'each': its one choice says everything.
|
|
40
|
+
*/
|
|
41
|
+
export type Spread = {
|
|
42
|
+
kind: 'all' | 'most';
|
|
43
|
+
value: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'each';
|
|
46
|
+
};
|
|
47
|
+
export declare const spreadOf: (values: string[]) => Spread;
|
|
48
|
+
/** A spread said before the list only when every one is the same - a price, a bed, a count. */
|
|
49
|
+
export declare const allOrEach: (s: Spread) => Spread;
|
|
50
|
+
/** Whether one choice says the fact itself: when it is not what all - or most - of them have. */
|
|
51
|
+
export declare const saysOwn: (s: Spread, value: string) => boolean;
|
|
52
|
+
/** A fact the same for every one - but never its majority, which needs the rest said. */
|
|
53
|
+
export declare const sharedBy: (s: Spread) => string;
|
|
54
|
+
/** A tag sets one apart only if some carry it - not every one, and not more than half. */
|
|
55
|
+
export declare const setsApart: (carried: boolean[]) => boolean;
|
|
56
|
+
/** "2.0米大床", "free to cancel until …" → one sentence of capitalised parts, one full stop each. */
|
|
57
|
+
export declare const sentenceOf: (parts: string[]) => string;
|
|
58
|
+
/** How a rate is paid, as a list tells it: paid in advance and not booked here, paid in advance, or at the hotel. */
|
|
59
|
+
export type Pay = 'not-sold' | 'prepaid' | 'at-hotel';
|
|
60
|
+
export declare const payOf: (r: {
|
|
61
|
+
payment?: string;
|
|
62
|
+
notSoldHere?: unknown;
|
|
63
|
+
}) => Pay;
|
|
64
|
+
/** A choice's own payment, in its sentence - a list of one, where no tag sets it apart. */
|
|
65
|
+
export declare const PAY_WORDS: Record<Pay, string>;
|
|
66
|
+
/**
|
|
67
|
+
* How a list is paid, said once before it, and the tag on each choice that is
|
|
68
|
+
* paid otherwise.
|
|
69
|
+
*
|
|
70
|
+
* ⚠️ EVERY CHOICE'S PAYMENT CAN BE TOLD (2026-11-02 audit, P1-5): a rate paid in
|
|
71
|
+
* advance cannot be booked here, and a list that said only its price would let
|
|
72
|
+
* the model offer it. With some paid in advance among those paid at the hotel,
|
|
73
|
+
* each one paid in advance carries "Prepaid – not bookable here" (robin 11-09);
|
|
74
|
+
* with more than half paid in advance, the sentence says they are, unless one
|
|
75
|
+
* is marked, and those paid at the hotel are the ones marked. The ids line
|
|
76
|
+
* after the list marks each one too, for the model.
|
|
77
|
+
*/
|
|
78
|
+
export declare const paymentOf: (pays: Pay[],
|
|
79
|
+
/** "room" or "hotel" - what the list is of. */
|
|
80
|
+
noun: string,
|
|
81
|
+
/** The group a guest books a stay paid in advance with - its own app or website. */
|
|
82
|
+
group: string,
|
|
83
|
+
/** What is said where every one is paid in advance and not booked here, if not the rooms' sentence. */
|
|
84
|
+
allNotSold?: string) => {
|
|
85
|
+
said: string;
|
|
86
|
+
tags: string[];
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=choices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,yFAAyF;AACzF,MAAM,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC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GACpB,MAAM,GAAG,EAAE;AACX,+CAA+C;AAC/C,MAAM,MAAM;AACZ,oFAAoF;AACpF,OAAO,MAAM;AACb,uGAAuG;AACvG,mBAAqJ,KACpJ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAsChC,CAAC"}
|
package/dist/choices.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The numbered choices a client that draws no card is told - a hotel's rooms,
|
|
3
|
+
* a list of hotels - as paragraphs (robin 11-09, after RollingGo's text answers:
|
|
4
|
+
* 「我们的文字版本的你看看可以按照我后面那个图优化吗」). Every brand alike: the
|
|
5
|
+
* wording of a rate or a hotel is tools.ts's; how a list of them is laid out is
|
|
6
|
+
* here.
|
|
7
|
+
*
|
|
8
|
+
* **1. Deluxe King Room(豪华大床房)**
|
|
9
|
+
* 2.0米大床. Free to cancel until Wed 18 Nov, 14:00. ¥478 a night before taxes.
|
|
10
|
+
* Cheapest · Free cancellation · ¥507
|
|
11
|
+
*
|
|
12
|
+
* - The title is bold and numbered, a paragraph and not a Markdown list: Manus
|
|
13
|
+
* renumbers a list and hangs its wrapped lines (robin's screenshot), and the
|
|
14
|
+
* number is what the guest answers with.
|
|
15
|
+
* - The sentence is only what sets this one apart; what every one of them has
|
|
16
|
+
* is said once, before them - and what most have, once, as "unless one says
|
|
17
|
+
* otherwise", with the rest saying theirs (总线程 11-09, ①).
|
|
18
|
+
* - Two tags at most, then the price; a tag every one of them - or more than
|
|
19
|
+
* half - would carry sets none apart, and is not given (总线程 11-09, 2).
|
|
20
|
+
* - Lines, not a table (robin). Single newlines hold in Claude Code's terminal
|
|
21
|
+
* (checked 11-09) and in chat views that break on them; a view that joins
|
|
22
|
+
* them shows each choice as one paragraph, still numbered and apart.
|
|
23
|
+
*/
|
|
24
|
+
/** At most this many tags before the price. */
|
|
25
|
+
export const TAGS_SHOWN = 2;
|
|
26
|
+
/** A choice as its lines - the title bold and numbered, then what sets it apart, then its tags. */
|
|
27
|
+
export const choiceBlock = (n, c) => [
|
|
28
|
+
`**${n}. ${c.title}**`,
|
|
29
|
+
c.sentence,
|
|
30
|
+
[...c.tags.slice(0, TAGS_SHOWN), c.price].filter(Boolean).join(' · '),
|
|
31
|
+
]
|
|
32
|
+
.filter(Boolean)
|
|
33
|
+
.join('\n');
|
|
34
|
+
export const spreadOf = (values) => {
|
|
35
|
+
if (values.length < 2)
|
|
36
|
+
return { kind: 'each' };
|
|
37
|
+
const counts = new Map();
|
|
38
|
+
for (const v of values)
|
|
39
|
+
counts.set(v, (counts.get(v) ?? 0) + 1);
|
|
40
|
+
const [value, k] = [...counts].reduce((a, b) => (b[1] > a[1] ? b : a));
|
|
41
|
+
if (k === values.length)
|
|
42
|
+
return { kind: 'all', value };
|
|
43
|
+
if (k >= 2 && k > values.length / 2)
|
|
44
|
+
return { kind: 'most', value };
|
|
45
|
+
return { kind: 'each' };
|
|
46
|
+
};
|
|
47
|
+
/** A spread said before the list only when every one is the same - a price, a bed, a count. */
|
|
48
|
+
export const allOrEach = (s) => (s.kind === 'most' ? { kind: 'each' } : s);
|
|
49
|
+
/** Whether one choice says the fact itself: when it is not what all - or most - of them have. */
|
|
50
|
+
export const saysOwn = (s, value) => !!value && (s.kind === 'each' || (s.kind === 'most' && value !== s.value));
|
|
51
|
+
/** A fact the same for every one - but never its majority, which needs the rest said. */
|
|
52
|
+
export const sharedBy = (s) => (s.kind === 'all' ? s.value : '');
|
|
53
|
+
/** A tag sets one apart only if some carry it - not every one, and not more than half. */
|
|
54
|
+
export const setsApart = (carried) => {
|
|
55
|
+
const k = carried.filter(Boolean).length;
|
|
56
|
+
return k > 0 && k < carried.length && k <= carried.length / 2;
|
|
57
|
+
};
|
|
58
|
+
/** "2.0米大床", "free to cancel until …" → one sentence of capitalised parts, one full stop each. */
|
|
59
|
+
export const sentenceOf = (parts) => parts
|
|
60
|
+
.map((p) => p.trim().replace(/[.。\s]+$/u, ''))
|
|
61
|
+
.filter(Boolean)
|
|
62
|
+
.map((p) => `${p.charAt(0).toUpperCase()}${p.slice(1)}.`)
|
|
63
|
+
.join(' ');
|
|
64
|
+
export const payOf = (r) => r.notSoldHere ? 'not-sold' : r.payment === 'prepaid' ? 'prepaid' : 'at-hotel';
|
|
65
|
+
/** A choice's own payment, in its sentence - a list of one, where no tag sets it apart. */
|
|
66
|
+
export const PAY_WORDS = {
|
|
67
|
+
'not-sold': 'paid in advance - not bookable here',
|
|
68
|
+
prepaid: 'paid in advance',
|
|
69
|
+
'at-hotel': '',
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* How a list is paid, said once before it, and the tag on each choice that is
|
|
73
|
+
* paid otherwise.
|
|
74
|
+
*
|
|
75
|
+
* ⚠️ EVERY CHOICE'S PAYMENT CAN BE TOLD (2026-11-02 audit, P1-5): a rate paid in
|
|
76
|
+
* advance cannot be booked here, and a list that said only its price would let
|
|
77
|
+
* the model offer it. With some paid in advance among those paid at the hotel,
|
|
78
|
+
* each one paid in advance carries "Prepaid – not bookable here" (robin 11-09);
|
|
79
|
+
* with more than half paid in advance, the sentence says they are, unless one
|
|
80
|
+
* is marked, and those paid at the hotel are the ones marked. The ids line
|
|
81
|
+
* after the list marks each one too, for the model.
|
|
82
|
+
*/
|
|
83
|
+
export const paymentOf = (pays,
|
|
84
|
+
/** "room" or "hotel" - what the list is of. */
|
|
85
|
+
noun,
|
|
86
|
+
/** The group a guest books a stay paid in advance with - its own app or website. */
|
|
87
|
+
group,
|
|
88
|
+
/** What is said where every one is paid in advance and not booked here, if not the rooms' sentence. */
|
|
89
|
+
allNotSold = `All are paid in advance, so none can be booked here yet: book with ${group} in its own app or on its website, or ask for other nights.`) => {
|
|
90
|
+
const s = spreadOf(pays);
|
|
91
|
+
if (pays.length < 2)
|
|
92
|
+
return { said: '', tags: pays.map(() => '') };
|
|
93
|
+
if (s.kind === 'all')
|
|
94
|
+
return {
|
|
95
|
+
said: s.value === 'not-sold'
|
|
96
|
+
? allNotSold
|
|
97
|
+
: s.value === 'prepaid'
|
|
98
|
+
? 'All are paid in advance.'
|
|
99
|
+
: '',
|
|
100
|
+
tags: pays.map(() => ''),
|
|
101
|
+
};
|
|
102
|
+
const base = s.kind === 'most' ? s.value : 'at-hotel';
|
|
103
|
+
const anyNotSold = pays.includes('not-sold');
|
|
104
|
+
const tag = (p) => p === base
|
|
105
|
+
? ''
|
|
106
|
+
: p === 'not-sold'
|
|
107
|
+
? 'Prepaid – not bookable here'
|
|
108
|
+
: base === 'not-sold'
|
|
109
|
+
? p === 'prepaid'
|
|
110
|
+
? 'Prepaid – bookable here'
|
|
111
|
+
: 'Pay at the hotel – bookable here'
|
|
112
|
+
: p === 'prepaid'
|
|
113
|
+
? anyNotSold
|
|
114
|
+
? 'Prepaid – bookable here'
|
|
115
|
+
: 'Prepaid'
|
|
116
|
+
: 'Pay at the hotel';
|
|
117
|
+
const said = base === 'not-sold'
|
|
118
|
+
? `Unless a ${noun} is marked otherwise, these are paid in advance and cannot be booked here yet.`
|
|
119
|
+
: anyNotSold
|
|
120
|
+
? 'Those marked not bookable here are paid in advance and cannot be booked here yet; the others can be.'
|
|
121
|
+
: base === 'prepaid'
|
|
122
|
+
? `Unless a ${noun} is marked otherwise, these are paid in advance.`
|
|
123
|
+
: '';
|
|
124
|
+
return { said, tags: pays.map(tag) };
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=choices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choices.js","sourceRoot":"","sources":["../src/choices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAE5B,mGAAmG;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAC1D;IACE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;IACtB,CAAC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,CAAC,CAAE,CAAC,CAAC,KAAa,CAAC,CAAC,CAAC,UAAU,CAAC;IACpE,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,CAAC,CAAM,EAAU,EAAE,CAC7B,CAAC,KAAK,IAAI;QACR,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,CAAC,KAAK,UAAU;YAChB,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,IAAI,KAAK,UAAU;gBACnB,CAAC,CAAC,CAAC,KAAK,SAAS;oBACf,CAAC,CAAC,yBAAyB;oBAC3B,CAAC,CAAC,kCAAkC;gBACtC,CAAC,CAAC,CAAC,KAAK,SAAS;oBACf,CAAC,CAAC,UAAU;wBACV,CAAC,CAAC,yBAAyB;wBAC3B,CAAC,CAAC,SAAS;oBACb,CAAC,CAAC,kBAAkB,CAAC;IAC/B,MAAM,IAAI,GACR,IAAI,KAAK,UAAU;QACjB,CAAC,CAAC,YAAY,IAAI,gFAAgF;QAClG,CAAC,CAAC,UAAU;YACV,CAAC,CAAC,sGAAsG;YACxG,CAAC,CAAC,IAAI,KAAK,SAAS;gBAClB,CAAC,CAAC,YAAY,IAAI,kDAAkD;gBACpE,CAAC,CAAC,EAAE,CAAC;IACb,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AACvC,CAAC,CAAC"}
|
|
@@ -16,6 +16,20 @@ export type OtalessGroup = {
|
|
|
16
16
|
* enough for any one line here, and never said or drawn.
|
|
17
17
|
*/
|
|
18
18
|
export declare const UNCOUNTED_ROOMS = 99;
|
|
19
|
+
/**
|
|
20
|
+
* The most of a place's words sent to the backend, in characters (2026-11-09
|
|
21
|
+
* audit, C6): they went as they came - to the request body's 1 MB - into the
|
|
22
|
+
* request, the backend's logs and our cache's keys. A place is a few words.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAX_PLACE = 200;
|
|
25
|
+
/**
|
|
26
|
+
* A trip's rooms are priced this many at a time, and all within this long
|
|
27
|
+
* (2026-11-09 audit, C11). One after another, a trip of six with the backend
|
|
28
|
+
* slow was six times two time limits - longer than a host waits for an answer.
|
|
29
|
+
* A room not priced by then is said as one the group gave no price for in time.
|
|
30
|
+
*/
|
|
31
|
+
export declare const QUOTE_PARALLEL = 4;
|
|
32
|
+
export declare const QUOTE_DEADLINE_MS = 15000;
|
|
19
33
|
/** `{providerCode}:{roomId}` → the `roomId` the quote asks for (the document's ID rule, §1). */
|
|
20
34
|
export declare const originalPart: (unified: string) => string;
|
|
21
35
|
export type OtalessHotelsOptions = {
|
|
@@ -26,6 +40,20 @@ export type OtalessHotelsOptions = {
|
|
|
26
40
|
groups?: OtalessGroup[];
|
|
27
41
|
/** Where the hotels seen are kept across a restart - or nowhere. */
|
|
28
42
|
state?: StateFile;
|
|
43
|
+
/** For tests: a trip's rooms priced how many at a time (`QUOTE_PARALLEL`), and within how long (`QUOTE_DEADLINE_MS`). */
|
|
44
|
+
quoteParallel?: number;
|
|
45
|
+
quoteDeadlineMs?: number;
|
|
46
|
+
/**
|
|
47
|
+
* The conversation's linked membership of a group, as the backend's token
|
|
48
|
+
* (0.59.0, account/index.ts `tokenFor`): its rooms and quotes are asked for as
|
|
49
|
+
* that member. Absent, or no link - every request is as it was.
|
|
50
|
+
*/
|
|
51
|
+
memberAuth?: MemberAuth;
|
|
52
|
+
};
|
|
53
|
+
/** Filled in once the account exists (server.ts): the token for a conversation's group, and its end. */
|
|
54
|
+
export type MemberAuth = {
|
|
55
|
+
for?: (key: string, group: string) => string | undefined;
|
|
56
|
+
expired?: (key: string, group: string) => void;
|
|
29
57
|
};
|
|
30
58
|
export declare const createOtalessHotels: (opts: OtalessHotelsOptions) => HotelBackend;
|
|
31
59
|
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/otaless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