Fix DTO after updating cms
This commit is contained in:
parent
4f23b02097
commit
3b3b6951fe
2
TODO.md
2
TODO.md
|
@ -72,4 +72,4 @@
|
|||
|
||||
- [Feat] Static HTML site export for archival
|
||||
- [Feat] Secret Terminal mode
|
||||
- [Feat] Add RSS
|
||||
- [Feat] Add RSS
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
---
|
||||
import type {
|
||||
EndpointImage,
|
||||
EndpointMediaThumbnail,
|
||||
EndpointPayloadImage,
|
||||
EndpointScanImage,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
import { getRandomId } from "src/utils/random";
|
||||
import { sizesToSrcset } from "src/utils/img";
|
||||
|
||||
interface Props {
|
||||
img: EndpointImage | EndpointMediaThumbnail | EndpointScanImage;
|
||||
img: EndpointImage | EndpointPayloadImage | EndpointScanImage;
|
||||
}
|
||||
|
||||
const {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { getI18n } from "src/i18n/i18n";
|
|||
import type {
|
||||
EndpointAudio,
|
||||
EndpointImage,
|
||||
EndpointMediaThumbnail,
|
||||
EndpointPayloadImage,
|
||||
EndpointVideo,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
import { cache } from "src/utils/payload";
|
||||
|
@ -14,7 +14,7 @@ interface Props {
|
|||
| {
|
||||
title?: string | undefined;
|
||||
description?: string | undefined;
|
||||
thumbnail?: EndpointImage | EndpointMediaThumbnail | undefined;
|
||||
thumbnail?: EndpointImage | EndpointPayloadImage | undefined;
|
||||
audio?: EndpointAudio | undefined;
|
||||
video?: EndpointVideo | undefined;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
import type { EndpointAudio } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointAudioPreview } from "src/shared/payload/payload-sdk";
|
||||
|
||||
interface Props {
|
||||
audio: EndpointAudio;
|
||||
audio: EndpointAudioPreview;
|
||||
class?: string | undefined;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import {
|
||||
type EndpointCredit,
|
||||
type EndpointImage,
|
||||
type EndpointMediaThumbnail,
|
||||
type EndpointPayloadImage,
|
||||
type EndpointScanImage,
|
||||
type RichTextContent,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
|
@ -18,7 +18,7 @@ import RichText from "./RichText/RichText.astro";
|
|||
interface Props {
|
||||
previousImageHref?: string | undefined;
|
||||
nextImageHref?: string | undefined;
|
||||
image: EndpointImage | EndpointScanImage | EndpointMediaThumbnail;
|
||||
image: EndpointImage | EndpointScanImage | EndpointPayloadImage;
|
||||
pretitle?: string | undefined;
|
||||
title: string;
|
||||
subtitle?: string | undefined;
|
||||
|
@ -59,8 +59,7 @@ const hasNavigation = previousImageHref || nextImageHref;
|
|||
<a
|
||||
id="previous-button"
|
||||
class:list={{ hidden: !previousImageHref, pressable: true }}
|
||||
href={previousImageHref}
|
||||
data-astro-history="replace">
|
||||
href={previousImageHref}>
|
||||
<Icon name="material-symbols:chevron-left" />
|
||||
</a>
|
||||
)
|
||||
|
@ -81,8 +80,7 @@ const hasNavigation = previousImageHref || nextImageHref;
|
|||
<a
|
||||
id="next-button"
|
||||
class:list={{ hidden: !nextImageHref, pressable: true }}
|
||||
href={nextImageHref}
|
||||
data-astro-history="replace">
|
||||
href={nextImageHref}>
|
||||
<Icon name="material-symbols:chevron-right" />
|
||||
</a>
|
||||
)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
import type { EndpointAudio } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointAudioPreview } from "src/shared/payload/payload-sdk";
|
||||
|
||||
interface Props {
|
||||
audio: EndpointAudio;
|
||||
audio: EndpointAudioPreview;
|
||||
}
|
||||
|
||||
const { getLocalizedMatch, getLocalizedUrl, t, formatDuration } = await getI18n(
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
import type { EndpointCollectible } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointCollectiblePreview } from "src/shared/payload/payload-sdk";
|
||||
import type { Attribute } from "src/utils/attributes";
|
||||
import { convert } from "src/utils/currencies";
|
||||
import { formatLocale } from "src/utils/format";
|
||||
|
||||
interface Props {
|
||||
collectible: EndpointCollectible;
|
||||
collectible: EndpointCollectiblePreview;
|
||||
}
|
||||
|
||||
const { getLocalizedMatch, getLocalizedUrl, t, formatPrice, formatDate } = await getI18n(
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
import {
|
||||
AttributeTypes,
|
||||
type EndpointAttribute,
|
||||
type EndpointImage,
|
||||
type EndpointMediaThumbnail,
|
||||
type EndpointImagePreview,
|
||||
type EndpointPayloadImage,
|
||||
type EndpointScanImage,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
import Card from "components/Card.astro";
|
||||
|
@ -15,7 +15,7 @@ import { sizesToSrcset, sizesForGridLayout } from "src/utils/img";
|
|||
import type { Attribute } from "src/utils/attributes";
|
||||
|
||||
interface Props {
|
||||
thumbnail?: EndpointImage | EndpointMediaThumbnail | EndpointScanImage | undefined;
|
||||
thumbnail?: EndpointImagePreview | EndpointPayloadImage | EndpointScanImage | undefined;
|
||||
pretitle?: string | undefined;
|
||||
title: string;
|
||||
subtitle?: string | undefined;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
import type { EndpointImage } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointImagePreview } from "src/shared/payload/payload-sdk";
|
||||
|
||||
interface Props {
|
||||
image: EndpointImage;
|
||||
image: EndpointImagePreview;
|
||||
}
|
||||
|
||||
const { getLocalizedMatch, getLocalizedUrl, t } = await getI18n(Astro.locals.currentLocale);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
import type { EndpointPage } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointPagePreview } from "src/shared/payload/payload-sdk";
|
||||
import type { Attribute } from "src/utils/attributes";
|
||||
|
||||
interface Props {
|
||||
page: EndpointPage;
|
||||
page: EndpointPagePreview;
|
||||
}
|
||||
|
||||
const { getLocalizedMatch, getLocalizedUrl, t, formatDate } = await getI18n(
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
import GenericPreview from "components/Previews/GenericPreview.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
import type { EndpointVideo } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointVideoPreview } from "src/shared/payload/payload-sdk";
|
||||
|
||||
interface Props {
|
||||
video: EndpointVideo;
|
||||
video: EndpointVideoPreview;
|
||||
}
|
||||
|
||||
const { getLocalizedMatch, getLocalizedUrl, t, formatDuration } = await getI18n(
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import type { EndpointVideo } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointVideoPreview } from "src/shared/payload/payload-sdk";
|
||||
import { formatLocale } from "src/utils/format";
|
||||
|
||||
interface Props {
|
||||
video: EndpointVideo;
|
||||
video: EndpointVideoPreview;
|
||||
class?: string | undefined;
|
||||
}
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ export const getI18n = async (locale: string) => {
|
|||
return {
|
||||
href: getLocalizedUrl(`/folders/${source.folder.slug}`),
|
||||
typeLabel: t("global.sources.typeLabel.folder"),
|
||||
label: getLocalizedMatch(source.folder.translations).name,
|
||||
label: formatInlineTitle(translation),
|
||||
lang: translation.language,
|
||||
};
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ export const getI18n = async (locale: string) => {
|
|||
return {
|
||||
href: getLocalizedUrl(`/collectibles/${source.collectible.slug}/scans`),
|
||||
typeLabel: t("global.sources.typeLabel.scans"),
|
||||
label: formatInlineTitle(getLocalizedMatch(source.collectible.translations)),
|
||||
label: formatInlineTitle(translation),
|
||||
lang: translation.language,
|
||||
};
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ export const getI18n = async (locale: string) => {
|
|||
return {
|
||||
href: getLocalizedUrl(`/collectibles/${source.collectible.slug}/gallery`),
|
||||
typeLabel: t("global.sources.typeLabel.gallery"),
|
||||
label: formatInlineTitle(getLocalizedMatch(source.collectible.translations)),
|
||||
label: formatInlineTitle(translation),
|
||||
lang: translation.language,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import type { EndpointImage } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointPayloadImage } from "src/shared/payload/payload-sdk";
|
||||
import { sizesForGridLayout, sizesToSrcset } from "src/utils/img";
|
||||
|
||||
interface Props {
|
||||
img?: { light: EndpointImage; dark: EndpointImage } | undefined;
|
||||
img?: { light: EndpointPayloadImage; dark: EndpointPayloadImage } | undefined;
|
||||
name: string;
|
||||
href: string;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ const { getLocalizedUrl, getLocalizedMatch } = await getI18n(Astro.locals.curren
|
|||
img={
|
||||
darkThumbnail && lightThumbnail ? { dark: darkThumbnail, light: lightThumbnail } : undefined
|
||||
}
|
||||
name={getLocalizedMatch(translations).name}
|
||||
name={getLocalizedMatch(translations).title}
|
||||
href={getLocalizedUrl(`/folders/${slug}`)}
|
||||
/>
|
||||
))
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
import type {
|
||||
EndpointImage,
|
||||
EndpointMediaThumbnail,
|
||||
EndpointPayloadImage,
|
||||
EndpointScanImage,
|
||||
} from "src/shared/payload/payload-sdk";
|
||||
import { sizesToSrcset } from "src/utils/img";
|
||||
|
||||
interface Props {
|
||||
image: EndpointImage | EndpointScanImage | EndpointMediaThumbnail;
|
||||
image: EndpointImage | EndpointScanImage | EndpointPayloadImage;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
href: string;
|
||||
|
|
|
@ -17,7 +17,7 @@ if (scanPage instanceof Response) {
|
|||
return scanPage;
|
||||
}
|
||||
|
||||
const { parentPages, previousIndex, nextIndex, image, translations, thumbnail } = scanPage;
|
||||
const { parentPages, previousIndex, nextIndex, image, translations } = scanPage;
|
||||
const translation = getLocalizedMatch(translations);
|
||||
---
|
||||
|
||||
|
@ -27,7 +27,6 @@ const translation = getLocalizedMatch(translations);
|
|||
openGraph={{
|
||||
title: `${formatInlineTitle(translation)} (${index})`,
|
||||
description: translation.description && formatRichTextToString(translation.description),
|
||||
thumbnail,
|
||||
}}
|
||||
parentPages={parentPages}>
|
||||
<Lightbox
|
||||
|
|
|
@ -30,12 +30,12 @@ const meta = getLocalizedMatch(folder.translations);
|
|||
|
||||
<AppLayout
|
||||
openGraph={{
|
||||
title: meta.name,
|
||||
title: meta.title,
|
||||
description: meta.description && formatRichTextToString(meta.description),
|
||||
}}
|
||||
parentPages={folder.parentPages}
|
||||
class="app">
|
||||
<AppLayoutTitle title={meta.name} lang={meta.language} />
|
||||
<AppLayoutTitle title={meta.title} lang={meta.language} />
|
||||
{meta.description && <RichText content={meta.description} context={{ lang: meta.language }} />}
|
||||
|
||||
<div id="main" class:list={{ complex: folder.sections.type === "multiple" }}>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
import type { EndpointFolder } from "src/shared/payload/payload-sdk";
|
||||
import type { EndpointFolderPreview } from "src/shared/payload/payload-sdk";
|
||||
import FolderCard from "./FolderCard.astro";
|
||||
import { getI18n } from "src/i18n/i18n";
|
||||
|
||||
interface Props {
|
||||
title?: string | undefined;
|
||||
lang?: string | undefined;
|
||||
folders: EndpointFolder[];
|
||||
folders: EndpointFolderPreview[];
|
||||
}
|
||||
|
||||
const { title, folders, lang } = Astro.props;
|
||||
|
@ -27,10 +27,10 @@ const { getLocalizedUrl, getLocalizedMatch } = await getI18n(Astro.locals.curren
|
|||
<section>
|
||||
{
|
||||
folders.map(({ slug, translations, icon }) => {
|
||||
const { name, language } = getLocalizedMatch(translations);
|
||||
const { title, language } = getLocalizedMatch(translations);
|
||||
return (
|
||||
<FolderCard
|
||||
title={name}
|
||||
title={title}
|
||||
lang={language}
|
||||
icon={icon}
|
||||
href={getLocalizedUrl(`/folders/${slug}`)}
|
||||
|
|
|
@ -1,177 +1,177 @@
|
|||
{
|
||||
"disclaimer": "Usage subject to terms: https://openexchangerates.org/terms",
|
||||
"license": "https://openexchangerates.org/license",
|
||||
"timestamp": 1717740000,
|
||||
"timestamp": 1718449213,
|
||||
"base": "USD",
|
||||
"rates": {
|
||||
"AED": 3.673,
|
||||
"AFN": 70.453638,
|
||||
"ALL": 91.912021,
|
||||
"AMD": 387.678915,
|
||||
"ANG": 1.79986,
|
||||
"AOA": 854.407667,
|
||||
"ARS": 898.5413,
|
||||
"AUD": 1.498617,
|
||||
"AWG": 1.8,
|
||||
"AFN": 70.629925,
|
||||
"ALL": 93.766029,
|
||||
"AMD": 387.09398,
|
||||
"ANG": 1.79792,
|
||||
"AOA": 855.5,
|
||||
"ARS": 901.78997,
|
||||
"AUD": 1.513088,
|
||||
"AWG": 1.80125,
|
||||
"AZN": 1.7,
|
||||
"BAM": 1.795869,
|
||||
"BAM": 1.825818,
|
||||
"BBD": 2,
|
||||
"BDT": 117.294372,
|
||||
"BGN": 1.79491,
|
||||
"BHD": 0.376872,
|
||||
"BIF": 2869.308172,
|
||||
"BDT": 117.237829,
|
||||
"BGN": 1.828515,
|
||||
"BHD": 0.376276,
|
||||
"BIF": 2867.428126,
|
||||
"BMD": 1,
|
||||
"BND": 1.345362,
|
||||
"BOB": 6.901365,
|
||||
"BRL": 5.258701,
|
||||
"BND": 1.350399,
|
||||
"BOB": 6.893272,
|
||||
"BRL": 5.3773,
|
||||
"BSD": 1,
|
||||
"BTC": 0.000014026029,
|
||||
"BTN": 83.367902,
|
||||
"BWP": 13.755584,
|
||||
"BYN": 3.268278,
|
||||
"BZD": 2.013085,
|
||||
"CAD": 1.366955,
|
||||
"CDF": 2822.733026,
|
||||
"CHF": 0.89004,
|
||||
"CLF": 0.032927,
|
||||
"CLP": 908.55,
|
||||
"CNH": 7.255147,
|
||||
"CNY": 7.2447,
|
||||
"COP": 3927.880338,
|
||||
"CRC": 527.874933,
|
||||
"BTC": 0.000015094941,
|
||||
"BTN": 83.342478,
|
||||
"BWP": 13.582319,
|
||||
"BYN": 3.264326,
|
||||
"BZD": 2.010911,
|
||||
"CAD": 1.37535,
|
||||
"CDF": 2819.794327,
|
||||
"CHF": 0.89102,
|
||||
"CLF": 0.033781,
|
||||
"CLP": 932.13,
|
||||
"CNH": 7.27105,
|
||||
"CNY": 7.2548,
|
||||
"COP": 4140.0662,
|
||||
"CRC": 525.947274,
|
||||
"CUC": 1,
|
||||
"CUP": 25.75,
|
||||
"CVE": 101.249236,
|
||||
"CZK": 22.552099,
|
||||
"DJF": 177.811501,
|
||||
"DKK": 6.849959,
|
||||
"DOP": 59.242392,
|
||||
"DZD": 134.471532,
|
||||
"EGP": 47.5129,
|
||||
"CVE": 102.825557,
|
||||
"CZK": 23.0983,
|
||||
"DJF": 177.628631,
|
||||
"DKK": 6.9657,
|
||||
"DOP": 59.234388,
|
||||
"DZD": 134.823,
|
||||
"EGP": 47.71,
|
||||
"ERN": 15,
|
||||
"ETB": 57.42215,
|
||||
"EUR": 0.918217,
|
||||
"FJD": 2.25895,
|
||||
"FKP": 0.782189,
|
||||
"GBP": 0.782189,
|
||||
"GEL": 2.785,
|
||||
"GGP": 0.782189,
|
||||
"GHS": 14.880927,
|
||||
"GIP": 0.782189,
|
||||
"GMD": 67.775,
|
||||
"GNF": 8600.013522,
|
||||
"GTQ": 7.76001,
|
||||
"GYD": 209.061081,
|
||||
"HKD": 7.809645,
|
||||
"HNL": 24.673005,
|
||||
"HRK": 6.918151,
|
||||
"HTG": 132.552876,
|
||||
"HUF": 358.085123,
|
||||
"IDR": 16216.760923,
|
||||
"ILS": 3.720825,
|
||||
"IMP": 0.782189,
|
||||
"INR": 83.458757,
|
||||
"IQD": 1308.290714,
|
||||
"ETB": 57.057587,
|
||||
"EUR": 0.933053,
|
||||
"FJD": 2.2387,
|
||||
"FKP": 0.789079,
|
||||
"GBP": 0.789079,
|
||||
"GEL": 2.87,
|
||||
"GGP": 0.789079,
|
||||
"GHS": 15.01562,
|
||||
"GIP": 0.789079,
|
||||
"GMD": 67.75,
|
||||
"GNF": 8588.587525,
|
||||
"GTQ": 7.749335,
|
||||
"GYD": 208.737801,
|
||||
"HKD": 7.81055,
|
||||
"HNL": 24.65706,
|
||||
"HRK": 7.03975,
|
||||
"HTG": 132.335527,
|
||||
"HUF": 372.07,
|
||||
"IDR": 16486.5,
|
||||
"ILS": 3.7242,
|
||||
"IMP": 0.789079,
|
||||
"INR": 83.55155,
|
||||
"IQD": 1306.849431,
|
||||
"IRR": 42100,
|
||||
"ISK": 137.46,
|
||||
"JEP": 0.782189,
|
||||
"JMD": 155.295453,
|
||||
"JOD": 0.7088,
|
||||
"JPY": 155.5174,
|
||||
"KES": 130,
|
||||
"KGS": 87.3013,
|
||||
"KHR": 4101.618815,
|
||||
"KMF": 452.450119,
|
||||
"ISK": 139.040389,
|
||||
"JEP": 0.789079,
|
||||
"JMD": 155.257148,
|
||||
"JOD": 0.7089,
|
||||
"JPY": 157.42503042,
|
||||
"KES": 129.202198,
|
||||
"KGS": 87.1182,
|
||||
"KHR": 4108.729824,
|
||||
"KMF": 457.499995,
|
||||
"KPW": 900,
|
||||
"KRW": 1367.937913,
|
||||
"KWD": 0.306384,
|
||||
"KYD": 0.832281,
|
||||
"KZT": 446.221602,
|
||||
"LAK": 21498.895118,
|
||||
"LBP": 89418.618549,
|
||||
"LKR": 302.314319,
|
||||
"LRD": 193.950039,
|
||||
"LSL": 18.953322,
|
||||
"LYD": 4.829787,
|
||||
"MAD": 9.877784,
|
||||
"MDL": 17.619678,
|
||||
"MGA": 4467.052458,
|
||||
"MKD": 56.57657,
|
||||
"MMK": 2101.212378,
|
||||
"KRW": 1383.27,
|
||||
"KWD": 0.306225,
|
||||
"KYD": 0.831445,
|
||||
"KZT": 451.01908,
|
||||
"LAK": 21788.785264,
|
||||
"LBP": 89337.02505,
|
||||
"LKR": 303.408359,
|
||||
"LRD": 193.537555,
|
||||
"LSL": 18.318086,
|
||||
"LYD": 4.83704,
|
||||
"MAD": 10.025552,
|
||||
"MDL": 17.730591,
|
||||
"MGA": 4440.702811,
|
||||
"MKD": 57.457919,
|
||||
"MMK": 2201.379322,
|
||||
"MNT": 3450,
|
||||
"MOP": 8.033479,
|
||||
"MRU": 39.126423,
|
||||
"MUR": 46.32,
|
||||
"MVR": 15.4,
|
||||
"MWK": 1731.539932,
|
||||
"MXN": 17.987572,
|
||||
"MYR": 4.6955,
|
||||
"MZN": 63.92499,
|
||||
"NAD": 18.953497,
|
||||
"NGN": 1485.31,
|
||||
"NIO": 36.764809,
|
||||
"NOK": 10.558218,
|
||||
"NPR": 133.383523,
|
||||
"NZD": 1.613954,
|
||||
"OMR": 0.384963,
|
||||
"MOP": 8.026577,
|
||||
"MRU": 39.295939,
|
||||
"MUR": 46.775637,
|
||||
"MVR": 15.41,
|
||||
"MWK": 1729.752588,
|
||||
"MXN": 18.4648,
|
||||
"MYR": 4.719499,
|
||||
"MZN": 63.899991,
|
||||
"NAD": 18.318086,
|
||||
"NGN": 1495.5,
|
||||
"NIO": 36.723084,
|
||||
"NOK": 10.68245,
|
||||
"NPR": 133.348263,
|
||||
"NZD": 1.627075,
|
||||
"OMR": 0.384948,
|
||||
"PAB": 1,
|
||||
"PEN": 3.738103,
|
||||
"PGK": 3.887667,
|
||||
"PHP": 58.519502,
|
||||
"PKR": 278.529362,
|
||||
"PLN": 3.932408,
|
||||
"PYG": 7514.698541,
|
||||
"QAR": 3.642917,
|
||||
"RON": 4.569,
|
||||
"RSD": 107.495,
|
||||
"RUB": 89.173363,
|
||||
"RWF": 1298.427641,
|
||||
"SAR": 3.750551,
|
||||
"SBD": 8.482503,
|
||||
"SCR": 13.845723,
|
||||
"PEN": 3.770504,
|
||||
"PGK": 3.887723,
|
||||
"PHP": 58.700001,
|
||||
"PKR": 277.884288,
|
||||
"PLN": 4.092232,
|
||||
"PYG": 7503.069605,
|
||||
"QAR": 3.638178,
|
||||
"RON": 4.653,
|
||||
"RSD": 109.359,
|
||||
"RUB": 89.307513,
|
||||
"RWF": 1308.992161,
|
||||
"SAR": 3.752179,
|
||||
"SBD": 8.4616,
|
||||
"SCR": 13.560479,
|
||||
"SDG": 586,
|
||||
"SEK": 10.38479,
|
||||
"SGD": 1.34481,
|
||||
"SHP": 0.782189,
|
||||
"SEK": 10.63185,
|
||||
"SGD": 1.3535,
|
||||
"SHP": 0.789079,
|
||||
"SLL": 20969.5,
|
||||
"SOS": 570.753969,
|
||||
"SRD": 31.7645,
|
||||
"SOS": 570.149738,
|
||||
"SRD": 31.572,
|
||||
"SSP": 130.26,
|
||||
"STD": 22281.8,
|
||||
"STN": 22.496155,
|
||||
"SVC": 8.738769,
|
||||
"STN": 22.847018,
|
||||
"SVC": 8.729426,
|
||||
"SYP": 2512.53,
|
||||
"SZL": 18.948934,
|
||||
"THB": 36.351667,
|
||||
"TJS": 10.696062,
|
||||
"TMT": 3.51,
|
||||
"TND": 3.10175,
|
||||
"TOP": 2.352606,
|
||||
"TRY": 32.310647,
|
||||
"TTD": 6.757172,
|
||||
"TWD": 32.282,
|
||||
"TZS": 2615,
|
||||
"UAH": 40.094667,
|
||||
"UGX": 3788.628608,
|
||||
"SZL": 18.307455,
|
||||
"THB": 36.630765,
|
||||
"TJS": 10.669464,
|
||||
"TMT": 3.5,
|
||||
"TND": 3.122488,
|
||||
"TOP": 2.35645,
|
||||
"TRY": 32.7375,
|
||||
"TTD": 6.779503,
|
||||
"TWD": 32.3458,
|
||||
"TZS": 2619.02838,
|
||||
"UAH": 40.593838,
|
||||
"UGX": 3705.886831,
|
||||
"USD": 1,
|
||||
"UYU": 38.896466,
|
||||
"UZS": 12659.755435,
|
||||
"VES": 36.442787,
|
||||
"VND": 25422.651993,
|
||||
"UYU": 39.291418,
|
||||
"UZS": 12584.375498,
|
||||
"VES": 36.372315,
|
||||
"VND": 25455.008685,
|
||||
"VUV": 118.722,
|
||||
"WST": 2.8,
|
||||
"XAF": 602.310759,
|
||||
"XAG": 0.03205488,
|
||||
"XAU": 0.0004209,
|
||||
"XAF": 612.042932,
|
||||
"XAG": 0.03380837,
|
||||
"XAU": 0.00042863,
|
||||
"XCD": 2.70255,
|
||||
"XDR": 0.75467,
|
||||
"XOF": 602.310759,
|
||||
"XPD": 0.00108737,
|
||||
"XPF": 109.572414,
|
||||
"XPT": 0.00099467,
|
||||
"YER": 250.425029,
|
||||
"ZAR": 18.932716,
|
||||
"ZMW": 26.240618,
|
||||
"XDR": 0.756096,
|
||||
"XOF": 612.042932,
|
||||
"XPD": 0.00113108,
|
||||
"XPF": 111.342892,
|
||||
"XPT": 0.00104433,
|
||||
"YER": 250.33747,
|
||||
"ZAR": 18.35321,
|
||||
"ZMW": 26.168747,
|
||||
"ZWL": 322
|
||||
}
|
||||
}
|
|
@ -1334,17 +1334,17 @@ export interface RichTextUploadNode extends RichTextNode {
|
|||
|
||||
export interface RichTextUploadImageNode extends RichTextUploadNode {
|
||||
relationTo: Collections.Images;
|
||||
value: EndpointImage;
|
||||
value: EndpointImagePreview;
|
||||
}
|
||||
|
||||
export interface RichTextUploadVideoNode extends RichTextUploadNode {
|
||||
relationTo: Collections.Videos;
|
||||
value: EndpointVideo;
|
||||
value: EndpointVideoPreview;
|
||||
}
|
||||
|
||||
export interface RichTextUploadAudioNode extends RichTextUploadNode {
|
||||
relationTo: Collections.Audios;
|
||||
value: EndpointAudio;
|
||||
value: EndpointAudioPreview;
|
||||
}
|
||||
|
||||
export interface RichTextTextNode extends RichTextNode {
|
||||
|
@ -1496,43 +1496,49 @@ export const isBlockLineBlock = (block: GenericBlock): block is LineBlock =>
|
|||
////////////////// SDK //////////////////
|
||||
|
||||
|
||||
export type EndpointFolder = {
|
||||
export type EndpointFolderPreview = {
|
||||
id: string;
|
||||
slug: string;
|
||||
icon?: string;
|
||||
translations: {
|
||||
language: string;
|
||||
name: string;
|
||||
description?: RichTextContent;
|
||||
title: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type EndpointFolder = EndpointFolderPreview & {
|
||||
translations: (EndpointFolderPreview["translations"][number] & {
|
||||
description?: RichTextContent;
|
||||
})[];
|
||||
sections:
|
||||
| { type: "single"; subfolders: EndpointFolder[] }
|
||||
| { type: "single"; subfolders: EndpointFolderPreview[] }
|
||||
| {
|
||||
type: "multiple";
|
||||
sections: {
|
||||
translations: { language: string; name: string }[];
|
||||
subfolders: EndpointFolder[];
|
||||
subfolders: EndpointFolderPreview[];
|
||||
}[];
|
||||
};
|
||||
files: (
|
||||
| {
|
||||
relationTo: Collections.Collectibles;
|
||||
value: EndpointCollectible;
|
||||
value: EndpointCollectiblePreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Pages;
|
||||
value: EndpointPage;
|
||||
value: EndpointPagePreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Images;
|
||||
value: EndpointImage;
|
||||
value: EndpointImagePreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Audios;
|
||||
value: EndpointAudio;
|
||||
value: EndpointAudioPreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Videos;
|
||||
value: EndpointVideo;
|
||||
value: EndpointVideoPreview;
|
||||
}
|
||||
)[];
|
||||
parentPages: EndpointSource[];
|
||||
|
@ -1540,14 +1546,14 @@ export type EndpointFolder = {
|
|||
|
||||
export type EndpointWebsiteConfig = {
|
||||
home: {
|
||||
backgroundImage?: EndpointImage;
|
||||
folders: (EndpointFolder & {
|
||||
lightThumbnail?: EndpointImage;
|
||||
darkThumbnail?: EndpointImage;
|
||||
backgroundImage?: EndpointPayloadImage;
|
||||
folders: (EndpointFolderPreview & {
|
||||
lightThumbnail?: EndpointPayloadImage;
|
||||
darkThumbnail?: EndpointPayloadImage;
|
||||
})[];
|
||||
};
|
||||
timeline: {
|
||||
backgroundImage?: EndpointImage;
|
||||
backgroundImage?: EndpointPayloadImage;
|
||||
breaks: number[];
|
||||
eventCount: number;
|
||||
eras: {
|
||||
|
@ -1556,13 +1562,16 @@ export type EndpointWebsiteConfig = {
|
|||
name: string;
|
||||
}[];
|
||||
};
|
||||
defaultOpenGraphImage?: EndpointImage;
|
||||
defaultOpenGraphImage?: EndpointPayloadImage;
|
||||
};
|
||||
|
||||
export type EndpointRecorder = {
|
||||
export type EndpointRecorderPreview = {
|
||||
id: string;
|
||||
username: string;
|
||||
avatar?: EndpointImage;
|
||||
};
|
||||
|
||||
export type EndpointRecorder = EndpointRecorderPreview & {
|
||||
avatar?: EndpointPayloadImage;
|
||||
translations: {
|
||||
language: string;
|
||||
biography: RichTextContent;
|
||||
|
@ -1579,8 +1588,9 @@ export type EndpointWording = {
|
|||
};
|
||||
|
||||
export type EndpointTag = {
|
||||
id: string;
|
||||
slug: string;
|
||||
page?: EndpointPage;
|
||||
page?: { slug: string };
|
||||
translations: {
|
||||
language: string;
|
||||
name: string;
|
||||
|
@ -1588,6 +1598,7 @@ export type EndpointTag = {
|
|||
};
|
||||
|
||||
export type EndpointGenericAttribute = {
|
||||
id: string;
|
||||
slug: string;
|
||||
icon: string;
|
||||
translations: {
|
||||
|
@ -1617,6 +1628,7 @@ export type EndpointAttribute =
|
|||
| EndpointTagsAttribute;
|
||||
|
||||
export type EndpointRole = {
|
||||
id: string;
|
||||
icon: string;
|
||||
translations: {
|
||||
language: string;
|
||||
|
@ -1626,53 +1638,65 @@ export type EndpointRole = {
|
|||
|
||||
export type EndpointCredit = {
|
||||
role: EndpointRole;
|
||||
recorders: EndpointRecorder[];
|
||||
recorders: EndpointRecorderPreview[];
|
||||
};
|
||||
|
||||
export type EndpointPage = {
|
||||
export type EndpointPagePreview = {
|
||||
id: string;
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
attributes: EndpointAttribute[];
|
||||
backgroundImage?: EndpointImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
}[];
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type EndpointPage = EndpointPagePreview & {
|
||||
backgroundImage?: EndpointPayloadImage;
|
||||
translations: (EndpointPagePreview["translations"][number] & {
|
||||
sourceLanguage: string;
|
||||
summary?: RichTextContent;
|
||||
content: RichTextContent;
|
||||
credits: EndpointCredit[];
|
||||
toc: TableOfContentEntry[];
|
||||
}[];
|
||||
})[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
updatedBy?: EndpointRecorder;
|
||||
updatedBy?: EndpointRecorderPreview;
|
||||
parentPages: EndpointSource[];
|
||||
};
|
||||
|
||||
export type EndpointCollectible = {
|
||||
export type EndpointCollectiblePreview = {
|
||||
id: string;
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
description?: RichTextContent;
|
||||
}[];
|
||||
attributes: EndpointAttribute[];
|
||||
releaseDate?: string;
|
||||
languages: string[];
|
||||
backgroundImage?: EndpointImage;
|
||||
nature: CollectibleNature;
|
||||
gallery?: { count: number; thumbnail: EndpointImage };
|
||||
scans?: { count: number; thumbnail: EndpointScanImage };
|
||||
urls: { url: string; label: string }[];
|
||||
price?: {
|
||||
amount: number;
|
||||
currency: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type EndpointCollectible = EndpointCollectiblePreview & {
|
||||
translations: (EndpointCollectiblePreview["translations"][number] & {
|
||||
description?: RichTextContent;
|
||||
})[];
|
||||
backgroundImage?: EndpointPayloadImage;
|
||||
nature: CollectibleNature;
|
||||
gallery?: { count: number; thumbnail: EndpointPayloadImage };
|
||||
scans?: { count: number; thumbnail: EndpointPayloadImage };
|
||||
urls: { url: string; label: string }[];
|
||||
size?: {
|
||||
width: number;
|
||||
height: number;
|
||||
|
@ -1684,20 +1708,20 @@ export type EndpointCollectible = {
|
|||
bindingType?: CollectibleBindingTypes;
|
||||
pageOrder?: CollectiblePageOrders;
|
||||
};
|
||||
subitems: EndpointCollectible[];
|
||||
subitems: EndpointCollectiblePreview[];
|
||||
contents: {
|
||||
content:
|
||||
| {
|
||||
relationTo: Collections.Pages;
|
||||
value: EndpointPage;
|
||||
value: EndpointPagePreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Audios;
|
||||
value: EndpointAudio;
|
||||
value: EndpointAudioPreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.Videos;
|
||||
value: EndpointVideo;
|
||||
value: EndpointVideoPreview;
|
||||
}
|
||||
| {
|
||||
relationTo: Collections.GenericContents;
|
||||
|
@ -1730,13 +1754,13 @@ export type EndpointCollectible = {
|
|||
}[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
updatedBy?: EndpointRecorder;
|
||||
updatedBy?: EndpointRecorderPreview;
|
||||
parentPages: EndpointSource[];
|
||||
};
|
||||
|
||||
export type EndpointCollectibleScans = {
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
|
@ -1786,7 +1810,7 @@ export type EndpointCollectibleScans = {
|
|||
|
||||
export type EndpointCollectibleGallery = {
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
|
@ -1794,13 +1818,12 @@ export type EndpointCollectibleGallery = {
|
|||
subtitle?: string;
|
||||
description?: RichTextContent;
|
||||
}[];
|
||||
images: EndpointImage[];
|
||||
images: EndpointPayloadImage[];
|
||||
parentPages: EndpointSource[];
|
||||
};
|
||||
|
||||
export type EndpointCollectibleGalleryImage = {
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
|
@ -1816,7 +1839,6 @@ export type EndpointCollectibleGalleryImage = {
|
|||
|
||||
export type EndpointCollectibleScanPage = {
|
||||
slug: string;
|
||||
thumbnail?: EndpointImage;
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
|
@ -1863,40 +1885,58 @@ export type EndpointChronologyEvent = {
|
|||
}[];
|
||||
};
|
||||
|
||||
export type EndpointSourcePreview = {
|
||||
id: string;
|
||||
slug: string;
|
||||
translations: { language: string; pretitle?: string; title: string; subtitle?: string }[];
|
||||
};
|
||||
|
||||
export type EndpointSource =
|
||||
| { type: "url"; url: string; label: string }
|
||||
| {
|
||||
type: "collectible";
|
||||
collectible: EndpointCollectible;
|
||||
collectible: EndpointSourcePreview;
|
||||
range?:
|
||||
| { type: "page"; page: number }
|
||||
| { type: "timestamp"; timestamp: string }
|
||||
| { type: "custom"; translations: { language: string; note: string }[] };
|
||||
}
|
||||
| { type: "page"; page: EndpointPage }
|
||||
| { type: "folder"; folder: EndpointFolder }
|
||||
| { type: "scans"; collectible: EndpointCollectible }
|
||||
| { type: "gallery"; collectible: EndpointCollectible };
|
||||
| { type: "page"; page: EndpointSourcePreview }
|
||||
| { type: "folder"; folder: EndpointSourcePreview }
|
||||
| { type: "scans"; collectible: EndpointSourcePreview }
|
||||
| { type: "gallery"; collectible: EndpointSourcePreview };
|
||||
|
||||
export type EndpointMedia = {
|
||||
export type EndpointMediaPreview = {
|
||||
id: string;
|
||||
url: string;
|
||||
filename: string;
|
||||
mimeType: string;
|
||||
filesize: number;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
attributes: EndpointAttribute[];
|
||||
translations: {
|
||||
language: string;
|
||||
pretitle?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
description?: RichTextContent;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type EndpointMedia = EndpointMediaPreview & {
|
||||
filesize: number;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
translations: (EndpointMediaPreview["translations"][number] & {
|
||||
description?: RichTextContent;
|
||||
})[];
|
||||
credits: EndpointCredit[];
|
||||
};
|
||||
|
||||
export type EndpointImagePreview = EndpointMediaPreview & {
|
||||
width: number;
|
||||
height: number;
|
||||
sizes: PayloadImage[];
|
||||
openGraph?: PayloadImage;
|
||||
};
|
||||
|
||||
export type EndpointImage = EndpointMedia & {
|
||||
width: number;
|
||||
height: number;
|
||||
|
@ -1904,13 +1944,27 @@ export type EndpointImage = EndpointMedia & {
|
|||
openGraph?: PayloadImage;
|
||||
};
|
||||
|
||||
export type EndpointAudioPreview = EndpointMediaPreview & {
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
duration: number;
|
||||
};
|
||||
|
||||
export type EndpointAudio = EndpointMedia & {
|
||||
thumbnail?: EndpointMediaThumbnail;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
duration: number;
|
||||
};
|
||||
|
||||
export type EndpointVideoPreview = EndpointMediaPreview & {
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
subtitles: {
|
||||
language: string;
|
||||
url: string;
|
||||
}[];
|
||||
duration: number;
|
||||
};
|
||||
|
||||
export type EndpointVideo = EndpointMedia & {
|
||||
thumbnail?: EndpointMediaThumbnail;
|
||||
thumbnail?: EndpointPayloadImage;
|
||||
subtitles: {
|
||||
language: string;
|
||||
url: string;
|
||||
|
@ -1930,12 +1984,13 @@ export type EndpointVideo = EndpointMedia & {
|
|||
duration: number;
|
||||
};
|
||||
|
||||
export type EndpointMediaThumbnail = PayloadImage & {
|
||||
export type EndpointPayloadImage = PayloadImage & {
|
||||
sizes: PayloadImage[];
|
||||
openGraph?: PayloadImage;
|
||||
};
|
||||
|
||||
export type PayloadMedia = {
|
||||
id: string;
|
||||
url: string;
|
||||
mimeType: string;
|
||||
filename: string;
|
||||
|
@ -1953,17 +2008,25 @@ type GetPayloadSDKParams = {
|
|||
apiURL: string;
|
||||
email: string;
|
||||
password: string;
|
||||
cache: Cache;
|
||||
};
|
||||
|
||||
type Cache = {
|
||||
set: (token: string, expirationTimestamp: number) => void;
|
||||
get: () => string | undefined;
|
||||
tokenCache?: {
|
||||
set: (token: string, expirationTimestamp: number) => void;
|
||||
get: () => string | undefined;
|
||||
};
|
||||
responseCache?: {
|
||||
set: (url: string, response: any) => void;
|
||||
get: (url: string) => any | undefined;
|
||||
};
|
||||
};
|
||||
|
||||
const logResponse = (res: Response) => console.log(res.status, res.statusText, res.url);
|
||||
|
||||
export const getPayloadSDK = ({ apiURL, email, password, cache }: GetPayloadSDKParams) => {
|
||||
export const getPayloadSDK = ({
|
||||
apiURL,
|
||||
email,
|
||||
password,
|
||||
tokenCache,
|
||||
responseCache,
|
||||
}: GetPayloadSDKParams) => {
|
||||
const refreshToken = async () => {
|
||||
const loginUrl = payloadApiUrl(Collections.Recorders, "login");
|
||||
const loginResult = await fetch(loginUrl, {
|
||||
|
@ -1981,72 +2044,75 @@ export const getPayloadSDK = ({ apiURL, email, password, cache }: GetPayloadSDKP
|
|||
token: string;
|
||||
exp: number;
|
||||
};
|
||||
cache.set(token, exp);
|
||||
tokenCache?.set(token, exp);
|
||||
return token;
|
||||
};
|
||||
|
||||
const payloadApiUrl = (collection: Collections, endpoint?: string, isGlobal?: boolean): string =>
|
||||
`${apiURL}/${isGlobal === undefined ? "" : "globals/"}${collection}${endpoint === undefined ? "" : `/${endpoint}`}`;
|
||||
|
||||
const request = async (url: string): Promise<Response> => {
|
||||
const request = async (url: string): Promise<any> => {
|
||||
const cachedResponse = responseCache?.get(url);
|
||||
if (cachedResponse) {
|
||||
return cachedResponse;
|
||||
}
|
||||
|
||||
const result = await fetch(url, {
|
||||
headers: {
|
||||
Authorization: `JWT ${cache.get() ?? (await refreshToken())}`,
|
||||
Authorization: `JWT ${tokenCache?.get() ?? (await refreshToken())}`,
|
||||
},
|
||||
});
|
||||
logResponse(result);
|
||||
|
||||
if (result.status !== 200) {
|
||||
if (!result.ok) {
|
||||
throw new Error("Unhandled fetch error");
|
||||
}
|
||||
|
||||
return result;
|
||||
const data = await result.json();
|
||||
responseCache?.set(url, data);
|
||||
return data;
|
||||
};
|
||||
|
||||
return {
|
||||
getConfig: async (): Promise<EndpointWebsiteConfig> =>
|
||||
await (await request(payloadApiUrl(Collections.WebsiteConfig, `config`, true))).json(),
|
||||
await request(payloadApiUrl(Collections.WebsiteConfig, `config`, true)),
|
||||
getFolder: async (slug: string): Promise<EndpointFolder> =>
|
||||
await (await request(payloadApiUrl(Collections.Folders, `slug/${slug}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Folders, `slug/${slug}`)),
|
||||
getLanguages: async (): Promise<Language[]> =>
|
||||
await (await request(payloadApiUrl(Collections.Languages, `all`))).json(),
|
||||
await request(payloadApiUrl(Collections.Languages, `all`)),
|
||||
getCurrencies: async (): Promise<Currency[]> =>
|
||||
await (await request(payloadApiUrl(Collections.Currencies, `all`))).json(),
|
||||
await request(payloadApiUrl(Collections.Currencies, `all`)),
|
||||
getWordings: async (): Promise<EndpointWording[]> =>
|
||||
await (await request(payloadApiUrl(Collections.Wordings, `all`))).json(),
|
||||
await request(payloadApiUrl(Collections.Wordings, `all`)),
|
||||
getPage: async (slug: string): Promise<EndpointPage> =>
|
||||
await (await request(payloadApiUrl(Collections.Pages, `slug/${slug}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Pages, `slug/${slug}`)),
|
||||
getCollectible: async (slug: string): Promise<EndpointCollectible> =>
|
||||
await (await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}`)),
|
||||
getCollectibleScans: async (slug: string): Promise<EndpointCollectibleScans> =>
|
||||
await (await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/scans`))).json(),
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/scans`)),
|
||||
getCollectibleScanPage: async (
|
||||
slug: string,
|
||||
index: string
|
||||
): Promise<EndpointCollectibleScanPage> =>
|
||||
await (
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/scans/${index}`))
|
||||
).json(),
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/scans/${index}`)),
|
||||
getCollectibleGallery: async (slug: string): Promise<EndpointCollectibleGallery> =>
|
||||
await (await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/gallery`))).json(),
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/gallery`)),
|
||||
getCollectibleGalleryImage: async (
|
||||
slug: string,
|
||||
index: string
|
||||
): Promise<EndpointCollectibleGalleryImage> =>
|
||||
await (
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/gallery/${index}`))
|
||||
).json(),
|
||||
await request(payloadApiUrl(Collections.Collectibles, `slug/${slug}/gallery/${index}`)),
|
||||
getChronologyEvents: async (): Promise<EndpointChronologyEvent[]> =>
|
||||
await (await request(payloadApiUrl(Collections.ChronologyEvents, `all`))).json(),
|
||||
await request(payloadApiUrl(Collections.ChronologyEvents, `all`)),
|
||||
getChronologyEventByID: async (id: string): Promise<EndpointChronologyEvent> =>
|
||||
await (await request(payloadApiUrl(Collections.ChronologyEvents, `id/${id}`))).json(),
|
||||
await request(payloadApiUrl(Collections.ChronologyEvents, `id/${id}`)),
|
||||
getImageByID: async (id: string): Promise<EndpointImage> =>
|
||||
await (await request(payloadApiUrl(Collections.Images, `id/${id}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Images, `id/${id}`)),
|
||||
getAudioByID: async (id: string): Promise<EndpointAudio> =>
|
||||
await (await request(payloadApiUrl(Collections.Audios, `id/${id}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Audios, `id/${id}`)),
|
||||
getVideoByID: async (id: string): Promise<EndpointVideo> =>
|
||||
await (await request(payloadApiUrl(Collections.Videos, `id/${id}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Videos, `id/${id}`)),
|
||||
getRecorderByID: async (id: string): Promise<EndpointRecorder> =>
|
||||
await (await request(payloadApiUrl(Collections.Recorders, `id/${id}`))).json(),
|
||||
await request(payloadApiUrl(Collections.Recorders, `id/${id}`)),
|
||||
};
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@ export const payload = getPayloadSDK({
|
|||
apiURL: import.meta.env.PAYLOAD_API_URL,
|
||||
email: import.meta.env.PAYLOAD_USER,
|
||||
password: import.meta.env.PAYLOAD_PASSWORD,
|
||||
cache: {
|
||||
tokenCache: {
|
||||
get: () => {
|
||||
const cachedToken = nodeCache.get<string>(TOKEN_KEY);
|
||||
if (cachedToken !== undefined) {
|
||||
|
|
Loading…
Reference in New Issue