payload-reserve 2.0.0 → 2.1.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/README.md +30 -2
- package/dist/collections/Reservations.js +3 -2
- package/dist/collections/Reservations.js.map +1 -1
- package/dist/components/AvailabilityOverview/index.js +34 -1
- package/dist/components/AvailabilityOverview/index.js.map +1 -1
- package/dist/components/CalendarView/index.js +33 -1
- package/dist/components/CalendarView/index.js.map +1 -1
- package/dist/components/DashboardWidget/DashboardWidgetServer.js +14 -3
- package/dist/components/DashboardWidget/DashboardWidgetServer.js.map +1 -1
- package/dist/defaults.js +2 -1
- package/dist/defaults.js.map +1 -1
- package/dist/endpoints/customerSearch.js +12 -0
- package/dist/endpoints/customerSearch.js.map +1 -1
- package/dist/endpoints/effectiveTimezone.d.ts +13 -0
- package/dist/endpoints/effectiveTimezone.js +41 -0
- package/dist/endpoints/effectiveTimezone.js.map +1 -0
- package/dist/endpoints/resourceAvailability.d.ts +2 -0
- package/dist/endpoints/resourceAvailability.js +18 -2
- package/dist/endpoints/resourceAvailability.js.map +1 -1
- package/dist/plugin.js +2 -1
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.js.map +1 -1
- package/dist/utilities/tenantTimezone.d.ts +41 -0
- package/dist/utilities/tenantTimezone.js +77 -0
- package/dist/utilities/tenantTimezone.js.map +1 -0
- package/dist/utilities/timezoneUtils.d.ts +5 -0
- package/dist/utilities/timezoneUtils.js +14 -2
- package/dist/utilities/timezoneUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { isValidTimezone } from './timezoneUtils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pure precedence resolver for a tenant's effective timezone:
|
|
4
|
+
*
|
|
5
|
+
* selected tenant's zone → global default → 'UTC'
|
|
6
|
+
*
|
|
7
|
+
* An absent or invalid zone at any step is skipped, never thrown — so a tenant
|
|
8
|
+
* with a bad/empty timezone value transparently falls back to the global default.
|
|
9
|
+
*/ export function resolveTenantTimezone(args) {
|
|
10
|
+
const { globalTimezone, tenantTimezone } = args;
|
|
11
|
+
if (isValidTimezone(tenantTimezone)) {
|
|
12
|
+
return tenantTimezone;
|
|
13
|
+
}
|
|
14
|
+
if (isValidTimezone(globalTimezone)) {
|
|
15
|
+
return globalTimezone;
|
|
16
|
+
}
|
|
17
|
+
return 'UTC';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The tenant collection's slug, read off the scoped collection's tenant
|
|
21
|
+
* relationship field (`relationTo`). Keeps the plugin tenant-agnostic — it never
|
|
22
|
+
* hardcodes a tenants slug. Returns null for an absent, polymorphic, or
|
|
23
|
+
* non-relationship tenant field.
|
|
24
|
+
*/ export function tenantCollectionSlug(collection, tenantField) {
|
|
25
|
+
const fields = collection?.fields;
|
|
26
|
+
if (!Array.isArray(fields)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
for (const f of fields){
|
|
30
|
+
if (typeof f === 'object' && f !== null && f.name === tenantField) {
|
|
31
|
+
const rel = f.relationTo;
|
|
32
|
+
return typeof rel === 'string' ? rel : null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the effective timezone for the selected tenant in multiTenant mode.
|
|
39
|
+
*
|
|
40
|
+
* Loads the tenant document (slug derived from the scoped collection's tenant
|
|
41
|
+
* relationship) and reads `timezoneField`, then applies {@link resolveTenantTimezone}
|
|
42
|
+
* precedence. Returns the global default — without a DB read — when no tenant is
|
|
43
|
+
* selected, when the scoped collection lacks a tenant relationship, or when the
|
|
44
|
+
* lookup fails. Never throws.
|
|
45
|
+
*/ export async function getEffectiveTenantTimezone(args) {
|
|
46
|
+
const { globalTimezone, payload, scopedCollection, tenantField, tenantId, timezoneField } = args;
|
|
47
|
+
if (!tenantId) {
|
|
48
|
+
return resolveTenantTimezone({
|
|
49
|
+
globalTimezone
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const tenantSlug = tenantCollectionSlug(scopedCollection, tenantField);
|
|
53
|
+
if (!tenantSlug) {
|
|
54
|
+
return resolveTenantTimezone({
|
|
55
|
+
globalTimezone
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
let tenantTimezone = null;
|
|
59
|
+
try {
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
const tenant = await payload.findByID({
|
|
62
|
+
id: tenantId,
|
|
63
|
+
collection: tenantSlug,
|
|
64
|
+
depth: 0
|
|
65
|
+
});
|
|
66
|
+
const raw = tenant?.[timezoneField];
|
|
67
|
+
tenantTimezone = typeof raw === 'string' ? raw : null;
|
|
68
|
+
} catch {
|
|
69
|
+
tenantTimezone = null;
|
|
70
|
+
}
|
|
71
|
+
return resolveTenantTimezone({
|
|
72
|
+
globalTimezone,
|
|
73
|
+
tenantTimezone
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=tenantTimezone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/tenantTimezone.ts"],"sourcesContent":["import type { Payload } from 'payload'\n\nimport { isValidTimezone } from './timezoneUtils.js'\n\ntype CollectionLike = { fields?: unknown[] } | null | undefined\n\ntype FieldLike = { name?: string; relationTo?: string | string[]; type?: string }\n\n/**\n * Pure precedence resolver for a tenant's effective timezone:\n *\n * selected tenant's zone → global default → 'UTC'\n *\n * An absent or invalid zone at any step is skipped, never thrown — so a tenant\n * with a bad/empty timezone value transparently falls back to the global default.\n */\nexport function resolveTenantTimezone(args: {\n globalTimezone: string\n tenantTimezone?: null | string\n}): string {\n const { globalTimezone, tenantTimezone } = args\n if (isValidTimezone(tenantTimezone)) {\n return tenantTimezone\n }\n if (isValidTimezone(globalTimezone)) {\n return globalTimezone\n }\n return 'UTC'\n}\n\n/**\n * The tenant collection's slug, read off the scoped collection's tenant\n * relationship field (`relationTo`). Keeps the plugin tenant-agnostic — it never\n * hardcodes a tenants slug. Returns null for an absent, polymorphic, or\n * non-relationship tenant field.\n */\nexport function tenantCollectionSlug(collection: CollectionLike, tenantField: string): null | string {\n const fields = collection?.fields\n if (!Array.isArray(fields)) {\n return null\n }\n for (const f of fields) {\n if (typeof f === 'object' && f !== null && (f as FieldLike).name === tenantField) {\n const rel = (f as FieldLike).relationTo\n return typeof rel === 'string' ? rel : null\n }\n }\n return null\n}\n\n/**\n * Resolve the effective timezone for the selected tenant in multiTenant mode.\n *\n * Loads the tenant document (slug derived from the scoped collection's tenant\n * relationship) and reads `timezoneField`, then applies {@link resolveTenantTimezone}\n * precedence. Returns the global default — without a DB read — when no tenant is\n * selected, when the scoped collection lacks a tenant relationship, or when the\n * lookup fails. Never throws.\n */\nexport async function getEffectiveTenantTimezone(args: {\n globalTimezone: string\n payload: Payload\n scopedCollection: CollectionLike\n tenantField: string\n tenantId: null | string\n timezoneField: string\n}): Promise<string> {\n const { globalTimezone, payload, scopedCollection, tenantField, tenantId, timezoneField } = args\n if (!tenantId) {\n return resolveTenantTimezone({ globalTimezone })\n }\n const tenantSlug = tenantCollectionSlug(scopedCollection, tenantField)\n if (!tenantSlug) {\n return resolveTenantTimezone({ globalTimezone })\n }\n let tenantTimezone: null | string = null\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const tenant = await (payload.findByID as any)({\n id: tenantId,\n collection: tenantSlug,\n depth: 0,\n })\n const raw = (tenant as null | Record<string, unknown>)?.[timezoneField]\n tenantTimezone = typeof raw === 'string' ? raw : null\n } catch {\n tenantTimezone = null\n }\n return resolveTenantTimezone({ globalTimezone, tenantTimezone })\n}\n"],"names":["isValidTimezone","resolveTenantTimezone","args","globalTimezone","tenantTimezone","tenantCollectionSlug","collection","tenantField","fields","Array","isArray","f","name","rel","relationTo","getEffectiveTenantTimezone","payload","scopedCollection","tenantId","timezoneField","tenantSlug","tenant","findByID","id","depth","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iBAAiB;IACnB;IACA,OAAOH,sBAAsB;QAAEE;QAAgBC;IAAe;AAChE"}
|
|
@@ -8,6 +8,11 @@ export declare function getHourInTimezone(date: Date, timeZone: string): number;
|
|
|
8
8
|
* (round-trip check rejects shape-valid impossibilities like 2026-02-30).
|
|
9
9
|
*/
|
|
10
10
|
export declare function isValidDayKey(dayKey: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* True when the given string is a usable IANA timezone name. Non-throwing
|
|
13
|
+
* counterpart to {@link validateTimezone}; an empty/nullish value is not valid.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidTimezone(timeZone: null | string | undefined): timeZone is string;
|
|
11
16
|
/**
|
|
12
17
|
* Throws when the given string is not a valid IANA timezone name.
|
|
13
18
|
*/
|
|
@@ -61,13 +61,25 @@ function getWallClockFormatter(timeZone) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
|
|
64
|
+
* True when the given string is a usable IANA timezone name. Non-throwing
|
|
65
|
+
* counterpart to {@link validateTimezone}; an empty/nullish value is not valid.
|
|
66
|
+
*/ export function isValidTimezone(timeZone) {
|
|
67
|
+
if (!timeZone) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
66
70
|
try {
|
|
67
71
|
new Intl.DateTimeFormat('en-US', {
|
|
68
72
|
timeZone
|
|
69
73
|
});
|
|
74
|
+
return true;
|
|
70
75
|
} catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Throws when the given string is not a valid IANA timezone name.
|
|
81
|
+
*/ export function validateTimezone(timeZone) {
|
|
82
|
+
if (!isValidTimezone(timeZone)) {
|
|
71
83
|
throw new Error(`Invalid timezone "${timeZone}" — use an IANA name like 'Europe/Paris' or 'UTC'`);
|
|
72
84
|
}
|
|
73
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/timezoneUtils.ts"],"sourcesContent":["import type { DayOfWeek } from '../types.js'\n\nconst DAY_BY_UTC_INDEX: DayOfWeek[] = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']\n\nconst DAY_KEY_RE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nconst TIME_RE = /^(?:[01]\\d|2[0-3]):[0-5]\\d$/\n\nconst dayKeyFormatters = new Map<string, Intl.DateTimeFormat>()\nconst wallClockFormatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction getDayKeyFormatter(timeZone: string): Intl.DateTimeFormat {\n let formatter = dayKeyFormatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-CA', {\n day: '2-digit',\n month: '2-digit',\n timeZone,\n year: 'numeric',\n })\n dayKeyFormatters.set(timeZone, formatter)\n }\n return formatter\n}\n\nfunction getWallClockFormatter(timeZone: string): Intl.DateTimeFormat {\n let formatter = wallClockFormatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-CA', {\n day: '2-digit',\n hour: '2-digit',\n hourCycle: 'h23',\n minute: '2-digit',\n month: '2-digit',\n second: '2-digit',\n timeZone,\n year: 'numeric',\n })\n wallClockFormatters.set(timeZone, formatter)\n }\n return formatter\n}\n\n/**\n * Wall-clock hour (0-23) of an instant as seen in the given timezone.\n */\nexport function getHourInTimezone(date: Date, timeZone: string): number {\n const parts = getWallClockFormatter(timeZone).formatToParts(date)\n return Number(parts.find((p) => p.type === 'hour')?.value ?? '0')\n}\n\n/**\n * True when the string is a real calendar date in YYYY-MM-DD form\n * (round-trip check rejects shape-valid impossibilities like 2026-02-30).\n */\nexport function isValidDayKey(dayKey: string): boolean {\n if (!DAY_KEY_RE.test(dayKey)) {\n return false\n }\n try {\n return new Date(`${dayKey}T00:00:00Z`).toISOString().slice(0, 10) === dayKey\n } catch {\n return false\n }\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/timezoneUtils.ts"],"sourcesContent":["import type { DayOfWeek } from '../types.js'\n\nconst DAY_BY_UTC_INDEX: DayOfWeek[] = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']\n\nconst DAY_KEY_RE = /^\\d{4}-\\d{2}-\\d{2}$/\n\nconst TIME_RE = /^(?:[01]\\d|2[0-3]):[0-5]\\d$/\n\nconst dayKeyFormatters = new Map<string, Intl.DateTimeFormat>()\nconst wallClockFormatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction getDayKeyFormatter(timeZone: string): Intl.DateTimeFormat {\n let formatter = dayKeyFormatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-CA', {\n day: '2-digit',\n month: '2-digit',\n timeZone,\n year: 'numeric',\n })\n dayKeyFormatters.set(timeZone, formatter)\n }\n return formatter\n}\n\nfunction getWallClockFormatter(timeZone: string): Intl.DateTimeFormat {\n let formatter = wallClockFormatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-CA', {\n day: '2-digit',\n hour: '2-digit',\n hourCycle: 'h23',\n minute: '2-digit',\n month: '2-digit',\n second: '2-digit',\n timeZone,\n year: 'numeric',\n })\n wallClockFormatters.set(timeZone, formatter)\n }\n return formatter\n}\n\n/**\n * Wall-clock hour (0-23) of an instant as seen in the given timezone.\n */\nexport function getHourInTimezone(date: Date, timeZone: string): number {\n const parts = getWallClockFormatter(timeZone).formatToParts(date)\n return Number(parts.find((p) => p.type === 'hour')?.value ?? '0')\n}\n\n/**\n * True when the string is a real calendar date in YYYY-MM-DD form\n * (round-trip check rejects shape-valid impossibilities like 2026-02-30).\n */\nexport function isValidDayKey(dayKey: string): boolean {\n if (!DAY_KEY_RE.test(dayKey)) {\n return false\n }\n try {\n return new Date(`${dayKey}T00:00:00Z`).toISOString().slice(0, 10) === dayKey\n } catch {\n return false\n }\n}\n\n/**\n * True when the given string is a usable IANA timezone name. Non-throwing\n * counterpart to {@link validateTimezone}; an empty/nullish value is not valid.\n */\nexport function isValidTimezone(timeZone: null | string | undefined): timeZone is string {\n if (!timeZone) {\n return false\n }\n try {\n new Intl.DateTimeFormat('en-US', { timeZone })\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Throws when the given string is not a valid IANA timezone name.\n */\nexport function validateTimezone(timeZone: string): void {\n if (!isValidTimezone(timeZone)) {\n throw new Error(\n `Invalid timezone \"${timeZone}\" — use an IANA name like 'Europe/Paris' or 'UTC'`,\n )\n }\n}\n\n/**\n * Calendar day key (YYYY-MM-DD) of an instant as seen in the given timezone.\n * en-CA locale formats dates as YYYY-MM-DD natively.\n */\nexport function getDayKeyInTimezone(date: Date, timeZone: string): string {\n return getDayKeyFormatter(timeZone).format(date)\n}\n\n/**\n * Day of week for a calendar date — TZ-independent pure calendar math.\n */\nexport function getDayOfWeekFromDayKey(dayKey: string): DayOfWeek {\n if (!DAY_KEY_RE.test(dayKey)) {\n throw new Error(`Invalid day key \"${dayKey}\" — expected YYYY-MM-DD`)\n }\n return DAY_BY_UTC_INDEX[new Date(`${dayKey}T00:00:00Z`).getUTCDay()]\n}\n\n/**\n * Wall-clock parts of a UTC instant in the given timezone, reconstructed as a\n * UTC timestamp — the difference to the instant is the zone's offset.\n */\nfunction offsetMs(timeZone: string, utcDate: Date): number {\n const parts = getWallClockFormatter(timeZone).formatToParts(utcDate)\n const get = (type: string): number =>\n Number(parts.find((p) => p.type === type)?.value ?? '0')\n const asUTC = Date.UTC(\n get('year'),\n get('month') - 1,\n get('day'),\n get('hour'),\n get('minute'),\n get('second'),\n )\n return asUTC - utcDate.getTime()\n}\n\n/**\n * The UTC instant of wall-clock `HH:mm` on calendar day `dayKey` in `timeZone`.\n * Two-pass offset algorithm; DST-safe. Spring-forward gap times resolve to a\n * nearby valid instant (for midnight-gap zones like America/Santiago this can be\n * late on the prior calendar day); fall-back ambiguous times resolve to one\n * consistent occurrence.\n */\nexport function combineDayKeyAndTime(dayKey: string, time: string, timeZone: string): Date {\n if (!DAY_KEY_RE.test(dayKey)) {\n throw new Error(`Invalid day key \"${dayKey}\" — expected YYYY-MM-DD`)\n }\n if (!TIME_RE.test(time)) {\n throw new Error(`Invalid time \"${time}\" — expected HH:mm`)\n }\n const [y, mo, d] = dayKey.split('-').map(Number)\n const [h, mi] = time.split(':').map(Number)\n const guess = Date.UTC(y, mo - 1, d, h, mi)\n const candidate = guess - offsetMs(timeZone, new Date(guess))\n return new Date(guess - offsetMs(timeZone, new Date(candidate)))\n}\n\n/**\n * Instant of 23:59:59.999 (in `timeZone`) on the day containing `date`.\n */\nexport function endOfDayInTimezone(date: Date, timeZone: string): Date {\n const dayKey = getDayKeyInTimezone(date, timeZone)\n const lastMinute = combineDayKeyAndTime(dayKey, '23:59', timeZone)\n return new Date(lastMinute.getTime() + 59_999)\n}\n\n/**\n * Pure calendar arithmetic on day keys — DST-proof day iteration.\n */\nexport function addDaysToDayKey(dayKey: string, days: number): string {\n if (!DAY_KEY_RE.test(dayKey)) {\n throw new Error(`Invalid day key \"${dayKey}\" — expected YYYY-MM-DD`)\n }\n const base = new Date(`${dayKey}T00:00:00Z`)\n const shifted = new Date(base.getTime() + days * 86_400_000)\n return shifted.toISOString().slice(0, 10)\n}\n"],"names":["DAY_BY_UTC_INDEX","DAY_KEY_RE","TIME_RE","dayKeyFormatters","Map","wallClockFormatters","getDayKeyFormatter","timeZone","formatter","get","Intl","DateTimeFormat","day","month","year","set","getWallClockFormatter","hour","hourCycle","minute","second","getHourInTimezone","date","parts","formatToParts","Number","find","p","type","value","isValidDayKey","dayKey","test","Date","toISOString","slice","isValidTimezone","validateTimezone","Error","getDayKeyInTimezone","format","getDayOfWeekFromDayKey","getUTCDay","offsetMs","utcDate","asUTC","UTC","getTime","combineDayKeyAndTime","time","y","mo","d","split","map","h","mi","guess","candidate","endOfDayInTimezone","lastMinute","addDaysToDayKey","days","base","shifted"],"mappings":"AAEA,MAAMA,mBAAgC;IAAC;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;CAAM;AAEvF,MAAMC,aAAa;AAEnB,MAAMC,UAAU;AAEhB,MAA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