@curless/hotel-storefront 0.61.0 → 0.62.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.
Files changed (64) hide show
  1. package/dist/account/fake-ota.d.ts +69 -0
  2. package/dist/account/fake-ota.d.ts.map +1 -0
  3. package/dist/account/fake-ota.js +264 -0
  4. package/dist/account/fake-ota.js.map +1 -0
  5. package/dist/account/index.d.ts +32 -22
  6. package/dist/account/index.d.ts.map +1 -1
  7. package/dist/account/index.js +227 -200
  8. package/dist/account/index.js.map +1 -1
  9. package/dist/account/mask.d.ts +15 -0
  10. package/dist/account/mask.d.ts.map +1 -0
  11. package/dist/account/mask.js +51 -0
  12. package/dist/account/mask.js.map +1 -0
  13. package/dist/account/ota-member.d.ts +106 -11
  14. package/dist/account/ota-member.d.ts.map +1 -1
  15. package/dist/account/ota-member.js +191 -50
  16. package/dist/account/ota-member.js.map +1 -1
  17. package/dist/account/pages.d.ts +13 -2
  18. package/dist/account/pages.d.ts.map +1 -1
  19. package/dist/account/pages.js +34 -10
  20. package/dist/account/pages.js.map +1 -1
  21. package/dist/account/requests.d.ts +1 -1
  22. package/dist/account/requests.js +2 -2
  23. package/dist/account/requests.js.map +1 -1
  24. package/dist/account/said.d.ts +14 -0
  25. package/dist/account/said.d.ts.map +1 -0
  26. package/dist/account/said.js +96 -0
  27. package/dist/account/said.js.map +1 -0
  28. package/dist/account/store.d.ts +16 -15
  29. package/dist/account/store.d.ts.map +1 -1
  30. package/dist/account/store.js +29 -23
  31. package/dist/account/store.js.map +1 -1
  32. package/dist/otaless/backend.d.ts +19 -3
  33. package/dist/otaless/backend.d.ts.map +1 -1
  34. package/dist/otaless/backend.js +51 -20
  35. package/dist/otaless/backend.js.map +1 -1
  36. package/dist/otaless/booking.d.ts +189 -0
  37. package/dist/otaless/booking.d.ts.map +1 -0
  38. package/dist/otaless/booking.js +1227 -0
  39. package/dist/otaless/booking.js.map +1 -0
  40. package/dist/otaless/client.d.ts +180 -0
  41. package/dist/otaless/client.d.ts.map +1 -1
  42. package/dist/otaless/client.js +166 -15
  43. package/dist/otaless/client.js.map +1 -1
  44. package/dist/otaless/fake.d.ts +73 -0
  45. package/dist/otaless/fake.d.ts.map +1 -1
  46. package/dist/otaless/fake.js +270 -2
  47. package/dist/otaless/fake.js.map +1 -1
  48. package/dist/otaless/make.d.ts +2 -0
  49. package/dist/otaless/make.d.ts.map +1 -1
  50. package/dist/otaless/make.js +32 -0
  51. package/dist/otaless/make.js.map +1 -1
  52. package/dist/server.d.ts +1 -1
  53. package/dist/server.d.ts.map +1 -1
  54. package/dist/server.js +4 -1
  55. package/dist/server.js.map +1 -1
  56. package/package.json +1 -1
  57. package/dist/account/fake-mall.d.ts +0 -61
  58. package/dist/account/fake-mall.d.ts.map +0 -1
  59. package/dist/account/fake-mall.js +0 -239
  60. package/dist/account/fake-mall.js.map +0 -1
  61. package/dist/account/mall.d.ts +0 -85
  62. package/dist/account/mall.d.ts.map +0 -1
  63. package/dist/account/mall.js +0 -239
  64. package/dist/account/mall.js.map +0 -1
@@ -1,85 +0,0 @@
1
- /** Where the mall is, and for whom. */
2
- export type MallOptions = {
3
- baseUrl: string;
4
- tenant: string;
5
- fetch?: typeof fetch;
6
- timeoutMs?: number;
7
- now?: () => number;
8
- };
9
- /** A member as this connector keeps them: what the account page shows, and no more. */
10
- export type MallMember = {
11
- id: string;
12
- userName?: string;
13
- nickname?: string;
14
- name?: string;
15
- /** Kept only to be masked (`maskEmail`) - never shown, logged or sent on whole. */
16
- email?: string;
17
- mobile?: string;
18
- };
19
- export type MallTokens = {
20
- access: string;
21
- refresh?: string;
22
- /** When the access token stops working, by this process's clock. */
23
- accessExpires: number;
24
- refreshExpires?: number;
25
- };
26
- /**
27
- * A failure from the mall, with the code it came with - HTTP's, or their
28
- * envelope's - and never their words: a refusal is said in ours (web.ts), so a
29
- * page cannot tell a taken user name from a wrong password.
30
- */
31
- export declare class MallError extends Error {
32
- readonly code: string | number;
33
- /** Their envelope said no (`code` not 200 inside an answer) - a refusal, not a blip on the way. */
34
- readonly envelope: boolean;
35
- constructor(message: string, code: string | number,
36
- /** Their envelope said no (`code` not 200 inside an answer) - a refusal, not a blip on the way. */
37
- envelope?: boolean);
38
- }
39
- /** A user name, phone or email; a password; as the page's form caps them. */
40
- export declare const LIMITS: {
41
- account: number;
42
- userName: number;
43
- email: number;
44
- password: number;
45
- mobile: number;
46
- nickname: number;
47
- };
48
- /** Their user_info / member/info, cut to what the account page shows. */
49
- export declare const memberOf: (u: unknown) => MallMember | null;
50
- export type Mall = {
51
- login(input: {
52
- account: string;
53
- password: string;
54
- }): Promise<{
55
- tokens: MallTokens;
56
- member: MallMember | null;
57
- }>;
58
- register(input: {
59
- userName: string;
60
- email: string;
61
- password: string;
62
- mobile?: string;
63
- nickname?: string;
64
- }): Promise<void>;
65
- /** Who this token is, or null when the mall does not say it is a member's (signed out there). */
66
- info(tokens: MallTokens): Promise<MallMember | null>;
67
- refresh(tokens: MallTokens): Promise<MallTokens>;
68
- logout(tokens: MallTokens): Promise<void>;
69
- };
70
- export declare const makeMall: (opts: MallOptions) => Mall;
71
- /**
72
- * An email with most of it hidden: the first letter of the name and its
73
- * domain's first letter and ending - `r•••@g•••.com`. Enough for the guest to
74
- * know which address it is, too little to write to.
75
- */
76
- export declare const maskEmail: (email: string | undefined) => string | undefined;
77
- /**
78
- * A phone with all but its country code and last four hidden -
79
- * `+86 •••• 0000`. The country code is the "+" and the digits a space or the
80
- * number's own grouping ends, where it has one - and where it has none (our
81
- * register page sends it without spaces, 0.59.0 review L7: 「+1 •••• 2288」 at
82
- * the mall read 「•••• 2288」 here), the code E.164 says it starts with.
83
- */
84
- export declare const maskMobile: (mobile: string | undefined) => string | undefined;
85
- //# sourceMappingURL=mall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mall.d.ts","sourceRoot":"","sources":["../../src/account/mall.ts"],"names":[],"mappings":"AAYA,uCAAuC;AACvC,MAAM,MAAM,WAAW,G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AAC;QACnB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;KAC3B,CAAC,CAAC;IACH,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClB,iGAAiG;IACjG,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACrD,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,WAAW,KAAG,IAqH5C,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAU9D,CAAC;AAmBF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAShE,CAAC"}
@@ -1,239 +0,0 @@
1
- // The Otaless account's own service: the Curless mall's member API (robin,
2
- // 2026-11-06: 「Otaless 账号就是商城会员」). The same calls Nexva One makes
3
- // (marketplace server/sources/mall.mjs memberLogin / memberRegister /
4
- // memberRefresh / memberLogout / memberInfo), on the Otaless tenant.
5
- //
6
- // ⚠️ ONLY OUR OWN PAGE CALLS login AND register (web.ts): a password, an email or
7
- // a phone reaches this file from a form on mcp.otaless.ai, never from a tool -
8
- // no tool takes one (OpenAI refused Nexva One 1.0.0 for exactly that).
9
- //
10
- // ⚠️ NOTHING HERE IS LOGGED: not a body, not a token, not their message. A
11
- // caller logs the `code` of a failure, and that alone.
12
- /**
13
- * A failure from the mall, with the code it came with - HTTP's, or their
14
- * envelope's - and never their words: a refusal is said in ours (web.ts), so a
15
- * page cannot tell a taken user name from a wrong password.
16
- */
17
- export class MallError extends Error {
18
- code;
19
- envelope;
20
- constructor(message, code,
21
- /** Their envelope said no (`code` not 200 inside an answer) - a refusal, not a blip on the way. */
22
- envelope = false) {
23
- super(message);
24
- this.code = code;
25
- this.envelope = envelope;
26
- }
27
- }
28
- /** A user name, phone or email; a password; as the page's form caps them. */
29
- export const LIMITS = {
30
- account: 120,
31
- userName: 50,
32
- email: 254,
33
- password: 128,
34
- mobile: 24,
35
- nickname: 50,
36
- };
37
- const str = (v, max) => {
38
- if (typeof v !== 'string' && typeof v !== 'number')
39
- return undefined;
40
- // One line, no control or bidi characters: their fields are shown on our page.
41
- const s = Array.from(String(v))
42
- .filter((ch) => {
43
- const c = ch.codePointAt(0) ?? 0;
44
- return !(c < 0x20 ||
45
- (c >= 0x7f && c <= 0x9f) ||
46
- (c >= 0x200b && c <= 0x200f) ||
47
- (c >= 0x202a && c <= 0x202e) ||
48
- (c >= 0x2066 && c <= 0x2069) ||
49
- c === 0xfeff);
50
- })
51
- .join('')
52
- .trim();
53
- return s ? s.slice(0, max) : undefined;
54
- };
55
- /** Their user_info / member/info, cut to what the account page shows. */
56
- export const memberOf = (u) => {
57
- if (!u || typeof u !== 'object')
58
- return null;
59
- const d = u;
60
- const id = str(d.id, 40);
61
- if (!id)
62
- return null;
63
- const out = { id };
64
- const userName = str(d.userName, 60);
65
- const nickname = str(d.nickname, 60);
66
- const name = str(d.name, 60);
67
- const email = str(d.email, LIMITS.email);
68
- const mobile = str(d.mobile, 40);
69
- if (userName)
70
- out.userName = userName;
71
- if (nickname)
72
- out.nickname = nickname;
73
- if (name)
74
- out.name = name;
75
- if (email)
76
- out.email = email;
77
- if (mobile)
78
- out.mobile = mobile;
79
- return out;
80
- };
81
- export const makeMall = (opts) => {
82
- const base = opts.baseUrl.replace(/\/+$/, '');
83
- const doFetch = opts.fetch ?? fetch;
84
- const timeoutMs = opts.timeoutMs ?? 10_000;
85
- const now = opts.now ?? (() => Date.now());
86
- const send = async (path, { method = 'GET', body, token } = {}) => {
87
- const ctl = new AbortController();
88
- const timer = setTimeout(() => ctl.abort(), timeoutMs);
89
- let r;
90
- let text = '';
91
- try {
92
- r = await doFetch(`${base}/api/v1${path}`, {
93
- method,
94
- signal: ctl.signal,
95
- // ⚠️ NEVER AFTER A REDIRECT (Nexva's audit M-28): it would follow with
96
- // the member's token on it, to wherever it pointed.
97
- redirect: 'error',
98
- headers: {
99
- Accept: 'application/json',
100
- 'X-Tenant-Id': opts.tenant,
101
- ...(token ? { 'Member-Token': token } : {}),
102
- ...(body !== undefined ? { 'Content-Type': 'application/json' } : {}),
103
- },
104
- ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
105
- });
106
- text = await r.text();
107
- }
108
- catch (e) {
109
- throw new MallError(ctl.signal.aborted ? 'the mall did not answer in time' : 'the mall could not be reached', ctl.signal.aborted ? 'timeout' : 'unreachable');
110
- }
111
- finally {
112
- clearTimeout(timer);
113
- }
114
- if (!r.ok)
115
- throw new MallError(`HTTP ${r.status}`, r.status);
116
- // member/info without a member answers HTTP 200 with nothing at all (apidev, 2026-11-06).
117
- if (!text.trim())
118
- return null;
119
- let payload;
120
- try {
121
- payload = JSON.parse(text);
122
- }
123
- catch {
124
- throw new MallError('the mall answered something that is not JSON', 'not_json');
125
- }
126
- // Their envelope carries its own status: an HTTP 200 is not on its own a yes.
127
- if (payload.code != null && payload.code !== 200 && payload.code !== '200')
128
- throw new MallError(`code ${String(payload.code).slice(0, 12)}`, Number(payload.code) || String(payload.code).slice(0, 12), true);
129
- return payload;
130
- };
131
- const tokensOf = (d, was) => {
132
- const access = typeof d?.access_token === 'string' ? d.access_token : '';
133
- if (!access)
134
- throw new MallError('no token in the answer', 'no_token');
135
- const ttl = Number(d?.expire_in);
136
- const rttl = Number(d?.refresh_expire_in);
137
- const refresh = typeof d?.refresh_token === 'string' && d.refresh_token ? d.refresh_token : was?.refresh;
138
- return {
139
- access,
140
- ...(refresh ? { refresh } : {}),
141
- // No lifetime said: two hours, the shortest any of their tokens has had.
142
- accessExpires: now() + (Number.isFinite(ttl) && ttl > 0 ? ttl * 1000 : 2 * 3_600_000),
143
- ...(Number.isFinite(rttl) && rttl > 0
144
- ? { refreshExpires: now() + rttl * 1000 }
145
- : was?.refreshExpires
146
- ? { refreshExpires: was.refreshExpires }
147
- : {}),
148
- };
149
- };
150
- const dataOf = (p) => p?.data && typeof p.data === 'object' ? p.data : undefined;
151
- return {
152
- async login({ account, password }) {
153
- // By user name since 2026-10-07 (`username`); `account` rides along for
154
- // a mall that has not moved yet - as Nexva One sends it.
155
- const p = await send('/member/login', {
156
- method: 'POST',
157
- body: { username: account, account, password },
158
- });
159
- const d = dataOf(p);
160
- return { tokens: tokensOf(d), member: memberOf(d?.user_info) };
161
- },
162
- async register({ userName, email, password, mobile, nickname }) {
163
- await send('/member/register', {
164
- method: 'POST',
165
- body: {
166
- username: userName,
167
- email,
168
- password,
169
- ...(mobile ? { mobile } : {}),
170
- ...(nickname ? { nickname } : {}),
171
- },
172
- });
173
- },
174
- async info(tokens) {
175
- return memberOf(dataOf(await send('/member/info', { token: tokens.access })));
176
- },
177
- async refresh(tokens) {
178
- if (!tokens.refresh)
179
- throw new MallError('no refresh token', 401, true);
180
- const p = await send('/member/refresh', {
181
- method: 'POST',
182
- body: { refresh_token: tokens.refresh },
183
- });
184
- return tokensOf(dataOf(p), tokens);
185
- },
186
- async logout(tokens) {
187
- await send('/member/logout', { method: 'POST', token: tokens.access });
188
- },
189
- };
190
- };
191
- // ── What of a member is shown ──────────────────────────────────────────────
192
- /**
193
- * An email with most of it hidden: the first letter of the name and its
194
- * domain's first letter and ending - `r•••@g•••.com`. Enough for the guest to
195
- * know which address it is, too little to write to.
196
- */
197
- export const maskEmail = (email) => {
198
- if (!email)
199
- return undefined;
200
- const at = email.lastIndexOf('@');
201
- if (at < 1)
202
- return '•••';
203
- const name = email.slice(0, at);
204
- const domain = email.slice(at + 1);
205
- const dot = domain.lastIndexOf('.');
206
- const host = dot > 0 ? domain.slice(0, dot) : domain;
207
- const end = dot > 0 ? domain.slice(dot) : '';
208
- return `${Array.from(name)[0]}•••@${Array.from(host)[0] ?? ''}•••${end}`;
209
- };
210
- /**
211
- * The one- and two-digit country codes (ITU-T E.164). Country codes are
212
- * prefix-free, so a "+" number's code is one of these or its first three digits.
213
- */
214
- const CC1 = new Set(['1', '7']);
215
- const CC2 = new Set('20 27 30 31 32 33 34 36 39 40 41 43 44 45 46 47 48 49 51 52 53 54 55 56 57 58 60 61 62 63 64 65 66 81 82 84 86 90 91 92 93 94 95 98'.split(' '));
216
- const countryCodeOf = (digits) => CC1.has(digits.slice(0, 1))
217
- ? digits.slice(0, 1)
218
- : CC2.has(digits.slice(0, 2))
219
- ? digits.slice(0, 2)
220
- : digits.slice(0, 3);
221
- /**
222
- * A phone with all but its country code and last four hidden -
223
- * `+86 •••• 0000`. The country code is the "+" and the digits a space or the
224
- * number's own grouping ends, where it has one - and where it has none (our
225
- * register page sends it without spaces, 0.59.0 review L7: 「+1 •••• 2288」 at
226
- * the mall read 「•••• 2288」 here), the code E.164 says it starts with.
227
- */
228
- export const maskMobile = (mobile) => {
229
- if (!mobile)
230
- return undefined;
231
- const digits = mobile.replace(/\D/g, '');
232
- if (digits.length < 5)
233
- return '••••';
234
- const m = mobile.trim();
235
- const cc = /^\+(\d{1,3})[\s\-(.]/.exec(m)?.[1] ??
236
- (/^\+\d+$/.test(m) && digits.length >= 8 ? countryCodeOf(digits) : undefined);
237
- return `${cc ? `+${cc} ` : ''}•••• ${digits.slice(-4)}`;
238
- };
239
- //# sourceMappingURL=mall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mall.js","sourceRoot":"","sources":["../../src/account/mall.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,kEAAkE;AAClE,sEAAsE;AACtE,qEAAqE;AACrE,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