@curless/hotel-storefront 0.71.3 → 0.71.5
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/index.d.ts +6 -17
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +20 -47
- package/dist/account/index.js.map +1 -1
- package/dist/account/pages.d.ts +3 -7
- package/dist/account/pages.d.ts.map +1 -1
- package/dist/account/pages.js +7 -13
- package/dist/account/pages.js.map +1 -1
- package/dist/backend.d.ts +10 -0
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +14 -0
- package/dist/backend.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/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -25
- package/dist/server.js.map +1 -1
- package/dist/tools.d.ts +5 -16
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +109 -81
- package/dist/tools.js.map +1 -1
- package/dist/vocab.d.ts.map +1 -1
- package/dist/vocab.js +6 -1
- package/dist/vocab.js.map +1 -1
- package/package.json +1 -1
package/dist/account/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Context, Hono } from 'hono';
|
|
2
2
|
import type { TermsToAgree } from '../otaless/booking.js';
|
|
3
3
|
import { type Lang } from './requests.js';
|
|
4
|
-
import { type GuestProfile, type ProfileShown } from './store.js';
|
|
5
4
|
export type AccountConfig = {
|
|
6
5
|
/** The hotel backend's own `/api/v1/ota/*` (0.62.0) - the only kind there is. */
|
|
7
6
|
source: 'ota';
|
|
@@ -19,14 +18,13 @@ export type AccountConfig = {
|
|
|
19
18
|
*/
|
|
20
19
|
signInProvider?: string;
|
|
21
20
|
/**
|
|
22
|
-
* What the account is signed in with on our pages (0.66.0,
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* membership's own sign-in (`link_*`) is not this.
|
|
21
|
+
* What the account is signed in with on our pages: an email, and only that (0.66.0,
|
|
22
|
+
* 总线程 11-11 - the channel takes an email only; 0.71.4, robin 11-13 - every sign-in and
|
|
23
|
+
* link page asks for an email, `email-or-username` is gone). The field asks for an email,
|
|
24
|
+
* and anything that is not one is turned away on the page: never sent to the backend,
|
|
25
|
+
* never counted against the name. Absent: `email`; anything else stops the start.
|
|
28
26
|
*/
|
|
29
|
-
signInIdentity?: 'email'
|
|
27
|
+
signInIdentity?: 'email';
|
|
30
28
|
/**
|
|
31
29
|
* The hotel groups whose membership can be linked to the account (0.58.0) -
|
|
32
30
|
* by the backend's `providerCode`. None listed, none can: no tool, no row,
|
|
@@ -145,15 +143,6 @@ export type Account = {
|
|
|
145
143
|
* else. Undefined: not linked, or its session is over.
|
|
146
144
|
*/
|
|
147
145
|
tokenFor: (key: string, group: string) => string | undefined;
|
|
148
|
-
/**
|
|
149
|
-
* The conversation's signed-in guest's details, for a booking (0.67.0): `whole`
|
|
150
|
-
* for the server to book with and nowhere else; `shown` masked, for the card and
|
|
151
|
-
* the model. Undefined when nobody is signed in, or the sign-in said none.
|
|
152
|
-
*/
|
|
153
|
-
profileFor: (key: string) => {
|
|
154
|
-
whole: GuestProfile;
|
|
155
|
-
shown: ProfileShown;
|
|
156
|
-
} | undefined;
|
|
157
146
|
/** Who the conversation is signed in as - the account's own id (`AccountShown.id`) - or undefined (0.67.1). */
|
|
158
147
|
whoOf: (key: string) => string | undefined;
|
|
159
148
|
/** The backend's member id of the conversation's sign-in (`memberUserId`) - for the usage statistics' pseudonym only. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/account/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM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AACF,wEAAwE;AACxE,eAAO,MAAM,QAAQ,GAAU,GAAG,OAAO,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CASjF,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,YAAY;IAKrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;IACrD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;gBAG/B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,MAAM,EACjB,OAAO,SAAS;IAGnC,OAAO,CAAC,MAAM;IAKd,8FAA8F;IAC9F,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC,uEAAuE;IACvE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAMxC,wGAAwG;IACxG,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;CAyB/D;AAkCD,eAAO,MAAM,WAAW,GAAI,MAAM,cAAc,KAAG,OAywElD,CAAC"}
|
package/dist/account/index.js
CHANGED
|
@@ -320,14 +320,12 @@ export const makeAccount = (opts) => {
|
|
|
320
320
|
if (!/^[a-z0-9_-]{1,32}$/.test(signInProvider))
|
|
321
321
|
throw new Error('account: signInProvider is not a channel code');
|
|
322
322
|
// What the account signs in with (0.66.0, 总线程 11-11) - see `signInIdentity`.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
/**
|
|
328
|
-
const
|
|
329
|
-
/** Not an email, where only one is taken: said on the page, nothing sent, nothing counted. */
|
|
330
|
-
const notAnEmail = (typed) => emailOnly && !EMAIL_SHAPE.test(typed);
|
|
323
|
+
if ((opts.account.signInIdentity ?? 'email') !== 'email')
|
|
324
|
+
throw new Error('account: signInIdentity is "email" - an account signs in by its email alone (0.71.4)');
|
|
325
|
+
/** The account's no, naming what it signs in with: the email. */
|
|
326
|
+
const signInFailed = 'sign_in_failed_email';
|
|
327
|
+
/** Not an email: said on the page, nothing sent, nothing counted. */
|
|
328
|
+
const notAnEmail = (typed) => !EMAIL_SHAPE.test(typed);
|
|
331
329
|
// The backend's `/ota/*`: the account's own sign-in, and its hotel memberships'.
|
|
332
330
|
const ota = makeOtaMembers({
|
|
333
331
|
baseUrl,
|
|
@@ -381,7 +379,6 @@ export const makeAccount = (opts) => {
|
|
|
381
379
|
: {}),
|
|
382
380
|
...(opts.operator ? { operator: opts.operator } : {}),
|
|
383
381
|
...(opts.color ? { color: opts.color } : {}),
|
|
384
|
-
...(emailOnly ? { emailSignIn: true } : {}),
|
|
385
382
|
};
|
|
386
383
|
const brand = opts.brand;
|
|
387
384
|
/** "an Otaless", "a Shangri-La". */
|
|
@@ -595,19 +592,8 @@ export const makeAccount = (opts) => {
|
|
|
595
592
|
const nameOf = (s) => nameShown(s.shown);
|
|
596
593
|
const shownFor = (s) => (nameOf(s) ? { displayName: nameOf(s) } : {});
|
|
597
594
|
const whoSaid = (s) => nameOf(s) ? `the ${brand} account of ${nameOf(s)}` : `${aBrand} account`;
|
|
598
|
-
/** What a booking takes from the account (0.67.0), masked - said with the sign-in. */
|
|
599
|
-
// ⚠️ WITHOUT THE DETAILS THEMSELVES, NOT EVEN MASKED: the account's own answers tell the
|
|
600
|
-
// model no contact detail (review P2-2) - the booking's words say the masked email.
|
|
601
|
-
const profileSaid = (s) => {
|
|
602
|
-
const p = profileShown(s);
|
|
603
|
-
if (!p?.email)
|
|
604
|
-
return '';
|
|
605
|
-
const has = [p.name ? 'name' : '', 'email', p.phone ? 'phone' : ''].filter(Boolean);
|
|
606
|
-
const said = has.length > 1 ? `${has.slice(0, -1).join(', ')} and ${has.at(-1)}` : (has[0] ?? '');
|
|
607
|
-
return ` A booking here uses this account's ${said} for what the guest leaves out - do not ask them for those.`;
|
|
608
|
-
};
|
|
609
595
|
const signedInAnswer = (s, lead, noCards) => ({
|
|
610
|
-
text: `${lead} Signed in to ${whoSaid(s)}. ${linking ? '' : `${NO_PRICE} `}The guest sees the whole account - its email, partly hidden - on ${brand}'s account page, ${accountUrl}, in the browser they signed in with, for ${WEB_IDLE_MS / 60_000} minutes after. ${names.signOut} signs them out.${
|
|
596
|
+
text: `${lead} Signed in to ${whoSaid(s)}. ${linking ? '' : `${NO_PRICE} `}The guest sees the whole account - its email, partly hidden - on ${brand}'s account page, ${accountUrl}, in the browser they signed in with, for ${WEB_IDLE_MS / 60_000} minutes after. ${names.signOut} signs them out.${linking ? ` ${membershipsSaid(s, noCards)}` : ''}`.trim(),
|
|
611
597
|
structured: {
|
|
612
598
|
view: 'account',
|
|
613
599
|
brand,
|
|
@@ -705,7 +691,7 @@ export const makeAccount = (opts) => {
|
|
|
705
691
|
log(`[account] a membership link for ${tag(key)}${noCards ? ' in words' : ''}`);
|
|
706
692
|
usage({ key, kind: 'member', step: 'link', group: m.code, signUp: mode === 'up' });
|
|
707
693
|
const what = mode === 'up' ? `join ${g} and link the new membership` : `link their ${g} membership`;
|
|
708
|
-
const typed = `the ${g} email
|
|
694
|
+
const typed = `the ${g} email and password are typed on that page, never in this chat: do not ask for, or accept, them here, and never write back one the guest typed`;
|
|
709
695
|
// ⚠️ NO CODE (0.61.0) - see the top of this file: the page is the account's own browser's.
|
|
710
696
|
const where = `The page opens only in the browser they signed in to ${brand} with; anywhere else it first asks them to sign in to that same ${brand} account again.`;
|
|
711
697
|
if (noCards)
|
|
@@ -1303,7 +1289,7 @@ export const makeAccount = (opts) => {
|
|
|
1303
1289
|
const account = formStr(body.account, LIMITS.account).trim();
|
|
1304
1290
|
const password = formStr(body.password, LIMITS.password);
|
|
1305
1291
|
if (!account || !password)
|
|
1306
|
-
return reauthPage(c, code, r, lang,
|
|
1292
|
+
return reauthPage(c, code, r, lang, 'missing_in_email');
|
|
1307
1293
|
if (notAnEmail(account))
|
|
1308
1294
|
return reauthPage(c, code, r, lang, 'email_only');
|
|
1309
1295
|
// ⚠️ COUNTED AS A SIGN-IN OF THE ACCOUNT IS (总线程 11-06): by the name -
|
|
@@ -1398,6 +1384,10 @@ export const makeAccount = (opts) => {
|
|
|
1398
1384
|
}
|
|
1399
1385
|
else if (!values.identity || !password)
|
|
1400
1386
|
return again('missing_link');
|
|
1387
|
+
// ⚠️ A MEMBERSHIP IS LINKED BY ITS EMAIL TOO (0.71.4, robin 11-13): anything else is said
|
|
1388
|
+
// on the page - never sent to the group, never counted against the name.
|
|
1389
|
+
else if (!EMAIL_SHAPE.test(values.identity))
|
|
1390
|
+
return again('link_email_only');
|
|
1401
1391
|
const who = `${up ? 'j' : 'g'}:${m.code}:${(up ? values.email : values.identity)?.toLowerCase()}`;
|
|
1402
1392
|
/** A membership that was not linked - its group and category only. */
|
|
1403
1393
|
const failed = (why) => usage({ key: r.key, kind: 'member', step: 'fail', group: m.code, why, signUp: up });
|
|
@@ -1760,7 +1750,7 @@ export const makeAccount = (opts) => {
|
|
|
1760
1750
|
const account = formStr(body.account, LIMITS.account).trim();
|
|
1761
1751
|
const password = formStr(body.password, LIMITS.password);
|
|
1762
1752
|
if (!account || !password)
|
|
1763
|
-
return termsReauth(c, code, r, lang,
|
|
1753
|
+
return termsReauth(c, code, r, lang, 'missing_in_email');
|
|
1764
1754
|
if (notAnEmail(account))
|
|
1765
1755
|
return termsReauth(c, code, r, lang, 'email_only');
|
|
1766
1756
|
const named = `a:${account.toLowerCase()}`;
|
|
@@ -2021,7 +2011,7 @@ export const makeAccount = (opts) => {
|
|
|
2021
2011
|
return again('short_password');
|
|
2022
2012
|
}
|
|
2023
2013
|
else if (!values.account || !password)
|
|
2024
|
-
return again(
|
|
2014
|
+
return again('missing_in_email');
|
|
2025
2015
|
// ⚠️ AN EMAIL WHERE ONLY ONE IS TAKEN (0.66.0, 总线程 11-11): said here, before the
|
|
2026
2016
|
// name is looked at - nothing is sent, and nothing counts against the name.
|
|
2027
2017
|
else if (notAnEmail(values.account))
|
|
@@ -2130,14 +2120,9 @@ export const makeAccount = (opts) => {
|
|
|
2130
2120
|
}
|
|
2131
2121
|
// ⚠️ WHAT THE SIGN-IN SAID, AND NOTHING ELSE (0.62.0): there is no /member/info.
|
|
2132
2122
|
// Just registered here: shown by the nickname they gave (0.66.0; no user name since 0.71.1).
|
|
2133
|
-
|
|
2134
|
-
//
|
|
2135
|
-
|
|
2136
|
-
? {
|
|
2137
|
-
...(values.nickname ? { nickname: values.nickname } : {}),
|
|
2138
|
-
...(mobile ? { phone: mobile } : {}),
|
|
2139
|
-
}
|
|
2140
|
-
: undefined));
|
|
2123
|
+
// ⚠️ NO DETAILS KEPT FOR A BOOKING (0.71.4, robin 11-13): a booking takes what the
|
|
2124
|
+
// guest types (the account has no name and no phone - its 「用会员资料」 filled nothing).
|
|
2125
|
+
const s = signInWith(r.key, shownOf(got.session, got.profile, typed, up ? { nickname: values.nickname } : undefined), got.session);
|
|
2141
2126
|
// Every place taken by a live sign-in: none is pushed out (review P3-3).
|
|
2142
2127
|
if (!s) {
|
|
2143
2128
|
requests.reopen(r);
|
|
@@ -2300,15 +2285,8 @@ export const makeAccount = (opts) => {
|
|
|
2300
2285
|
// `_meta` may reach the model of one that does not. Whichever conversation the
|
|
2301
2286
|
// call names, as the hotel memberships' rows are - in claude.ai the card's calls
|
|
2302
2287
|
// all name the trip.
|
|
2303
|
-
//
|
|
2304
|
-
|
|
2305
|
-
const booking = s && cards ? profileShown(s) : undefined;
|
|
2306
|
-
const facts = s && cards
|
|
2307
|
-
? {
|
|
2308
|
-
...(s.shown.email ? { email: s.shown.email } : {}),
|
|
2309
|
-
...(booking ? { profile: booking } : {}),
|
|
2310
|
-
}
|
|
2311
|
-
: undefined;
|
|
2288
|
+
// (No 「用会员资料」 since 0.71.4, robin 11-13: a booking takes what the guest types.)
|
|
2289
|
+
const facts = s && cards && s.shown.email ? { email: s.shown.email } : undefined;
|
|
2312
2290
|
return {
|
|
2313
2291
|
[ACCOUNT_META_KEY]: {
|
|
2314
2292
|
from: opts.from,
|
|
@@ -2337,11 +2315,6 @@ export const makeAccount = (opts) => {
|
|
|
2337
2315
|
if (signOut(key))
|
|
2338
2316
|
log(`[account] ${tag(key)} signed out: taken over from another network`);
|
|
2339
2317
|
},
|
|
2340
|
-
profileFor: (key) => {
|
|
2341
|
-
const s = checked(key);
|
|
2342
|
-
const shown = s ? profileShown(s) : undefined;
|
|
2343
|
-
return s?.profile && shown ? { whole: s.profile, shown } : undefined;
|
|
2344
|
-
},
|
|
2345
2318
|
tokenFor: (key, group) => {
|
|
2346
2319
|
if (!linking)
|
|
2347
2320
|
return undefined;
|