@vimine/sdk 0.2.0 → 0.3.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,gHAAgH;AAChH,mGAAmG;AACnG,EAAE;AACF,iEAAiE;AACjE,kGAAkG;AAClG,EAAE;AACF,+FAA+F;AAC/F,uGAAuG;AACvG,6GAA6G;AAC7G,0GAA0G;AAC1G,uHAAuH;AACvH,iGAAiG;AACjG,EAAE;AACF,sGAAsG;AACtG,6EAA6E;AAC7E,OAAO,EAAE,MAAM,EAAsB,MAAM,YAAY,CAAC;AAGxD,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC,MAAM,OAAO,GAAG;IACZ,EAAE,EAAE;QACA,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,mCAAmC,EAAE,YAAY,EAAE,yCAAyC,EAAE,SAAS,EAAE,sEAAsE,EAAE,KAAK,EAAE,4BAA4B;QACxS,QAAQ,EAAE,6BAA6B,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,UAAU,EAAE,uBAAuB,EAAE,QAAQ,EAAE,2CAA2C,EAAE,OAAO,EAAE,UAAU;QAC7P,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,oDAAoD,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,eA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AE,CAAC,CAAC,CAAC;oBAC7G,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;gBACvB,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACX,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;oBACrB,MAAM,OAAO,GAAG,CAAE,GAAwC,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBACvI,CAAC,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;oBAC9D,CAAC,CAAC,SAAS,GAAG,OAAO,CAAC;gBAC1B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;QACD,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACrB,OAAO,GAAG,CAAC;IACf,CAAC;CACJ","sourcesContent":["// @vimine/sdk/elements — the low-code tier: three custom elements over the browser client, Shadow DOM,\n// styled through `--vimine-*` CSS custom properties, Italian by default (`lang=\"en\"` on the element or the page\n// switches the strings). Register them once, then use the tags anywhere (CMS pages, static sites):\n//\n// import { defineVimineElements } from '@vimine/sdk/elements';\n// defineVimineElements({ clientId: 'vmc_…', redirectUri: 'https://www.example.org/callback' });\n//\n// <vimine-sign-in scope=\"membership:read\"></vimine-sign-in> a \"Sign in with Vimine\" button\n// <vimine-card></vimine-card> the signed-in member's card (SVG + QR)\n// <vimine-enroll slug=\"your-slug\"></vimine-enroll> the hosted enrolment form (iframe, Embed v0)\n// <vimine-events slug=\"your-slug\"></vimine-events> the association's events (public ones for\n// visitors, every one for a signed-in member) with\n// a register button per type\n//\n// The callback page still calls `client.handleRedirect()` (or `<vimine-sign-in>` does it for you when\n// `handle-redirect` is set on the element and the page is the redirect URI).\nimport { Vimine, type VimineOptions } from './index.js';\nimport type { Event, Registration, RegistrationType, Scope } from './types.js';\n\nlet shared: Vimine | null = null;\n\nconst STRINGS = {\n it: {\n signIn: 'Accedi con Vimine', signOut: 'Esci', loading: 'Caricamento…', notSignedIn: 'Accedi per vedere la tua tessera.', noMembership: 'Nessuna tessera in questa associazione.', notActive: 'La tessera non è ancora attiva: il codice compare quando lo diventa.', error: 'Si è verificato un errore.',\n noEvents: 'Nessun evento in programma.', free: 'gratuita', places: 'posti', register: 'Iscriviti', signInToRegister: 'Accedi per iscriverti', registered: 'Iscrizione confermata', reserved: 'Posto riservato: in attesa del contributo', details: 'Dettagli',\n reason: { sold_out: 'esaurito', event_full: 'al completo', registration_not_open: 'iscrizioni non ancora aperte', registration_closed: 'iscrizioni chiuse', membership_required: 'riservato ai soci', membership_not_active: 'tessera non valida', membership_not_yet_valid: 'la tessera non è ancora utilizzabile a quella data', membership_type_not_allowed: 'tipo di tessera non ammesso', max_per_user: 'già iscritto', event_past: 'evento concluso', event_cancelled: 'evento annullato', event_not_published: 'non pubblicato', plan_limit: 'non disponibile', invalid_type: 'tipo non valido' } as Record<string, string>\n },\n en: {\n signIn: 'Sign in with Vimine', signOut: 'Sign out', loading: 'Loading…', notSignedIn: 'Sign in to see your card.', noMembership: 'No membership in this association.', notActive: 'The card is not active yet: its code appears once it is.', error: 'Something went wrong.',\n noEvents: 'No upcoming events.', free: 'free', places: 'places', register: 'Register', signInToRegister: 'Sign in to register', registered: 'Registration confirmed', reserved: 'Place reserved: awaiting the contribution', details: 'Details',\n reason: { sold_out: 'sold out', event_full: 'full', registration_not_open: 'registrations not open yet', registration_closed: 'registrations closed', membership_required: 'members only', membership_not_active: 'membership not valid', membership_not_yet_valid: 'your card is not usable yet on that date', membership_type_not_allowed: 'membership type not admitted', max_per_user: 'already registered', event_past: 'event over', event_cancelled: 'event cancelled', event_not_published: 'not published', plan_limit: 'not available', invalid_type: 'invalid type' } as Record<string, string>\n }\n};\ntype Lang = keyof typeof STRINGS;\nconst langOf = (el: HTMLElement): Lang => {\n const l = (el.getAttribute('lang') || el.closest('[lang]')?.getAttribute('lang') || document.documentElement.lang || 'it').slice(0, 2).toLowerCase();\n return l === 'en' ? 'en' : 'it';\n};\n\nconst BASE_CSS = `\n:host { display: inline-block; font-family: var(--vimine-font, system-ui, sans-serif); color: var(--vimine-color, #111); }\nbutton { cursor: pointer; border: 0; border-radius: var(--vimine-radius, 999px); padding: var(--vimine-padding, 0.65rem 1.1rem);\n background: var(--vimine-accent, #0a0e1a); color: var(--vimine-accent-contrast, #fff); font: inherit; font-weight: 600; }\nbutton:disabled { opacity: .6; cursor: default; }\n.muted { color: var(--vimine-muted, #666); font-size: .9em; }\n.error { color: var(--vimine-error, #a33); font-size: .9em; }\n`;\n\nconst shadow = (el: HTMLElement, css: string): ShadowRoot => {\n const root = el.shadowRoot || el.attachShadow({ mode: 'open' });\n root.innerHTML = `<style>${BASE_CSS}${css}</style>`;\n return root;\n};\n\n/** The client the elements use. Call once; pass your own instance to share it with the rest of the page. */\nexport function defineVimineElements(options: VimineOptions | Vimine): Vimine {\n shared = options instanceof Vimine ? options : new Vimine(options);\n if (typeof customElements !== 'undefined') {\n if (!customElements.get('vimine-sign-in')) customElements.define('vimine-sign-in', VimineSignIn);\n if (!customElements.get('vimine-card')) customElements.define('vimine-card', VimineCard);\n if (!customElements.get('vimine-enroll')) customElements.define('vimine-enroll', VimineEnroll);\n if (!customElements.get('vimine-events')) customElements.define('vimine-events', VimineEvents);\n }\n return shared;\n}\n\nconst client = (): Vimine => {\n if (!shared) throw new Error('Vimine elements: call defineVimineElements({ clientId, redirectUri }) first');\n return shared;\n};\n\n/** `<vimine-sign-in scope=\"…\" return-to=\"/area\" label=\"…\" handle-redirect>` — a sign-in / sign-out button. */\nexport class VimineSignIn extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n connectedCallback(): void {\n void this.boot();\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async boot(): Promise<void> {\n const mp = client();\n if (this.hasAttribute('handle-redirect')) {\n try {\n await mp.handleRedirect();\n } catch (err) {\n this.render(err instanceof Error ? err.message : String(err));\n return;\n }\n }\n this.render();\n this.unsubscribe = mp.onChange(() => this.render());\n }\n private render(error?: string): void {\n const mp = client();\n const t = STRINGS[langOf(this)];\n const root = shadow(this, '');\n const btn = document.createElement('button');\n btn.type = 'button';\n if (mp.isSignedIn()) {\n btn.textContent = this.getAttribute('label-signed-in') || t.signOut;\n btn.addEventListener('click', () => void mp.signOut({ everywhere: this.hasAttribute('everywhere') }));\n } else {\n btn.textContent = this.getAttribute('label') || t.signIn;\n btn.addEventListener('click', () => {\n const scopes = (this.getAttribute('scope') || '').split(/[\\s,]+/).filter(Boolean) as Scope[];\n void mp.signIn({ ...(scopes.length ? { scopes } : {}), ...(this.getAttribute('return-to') ? { returnTo: this.getAttribute('return-to')! } : {}) });\n });\n }\n root.appendChild(btn);\n if (error) {\n const e = document.createElement('div');\n e.className = 'error';\n e.textContent = error;\n root.appendChild(e);\n }\n this.dispatchEvent(new CustomEvent('vimine-change', { detail: { signedIn: mp.isSignedIn() }, bubbles: true }));\n }\n}\n\n/** `<vimine-card>` — the signed-in member's card as SVG (with the live QR); refreshes when the session changes. */\nexport class VimineCard extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n connectedCallback(): void {\n void this.render();\n this.unsubscribe = client().onChange(() => void this.render());\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async render(): Promise<void> {\n const mp = client();\n const t = STRINGS[langOf(this)];\n const root = shadow(this, ':host { display: block; max-width: var(--vimine-card-width, 600px); } svg { width: 100%; height: auto; display: block; border-radius: 24px; box-shadow: var(--vimine-card-shadow, 0 8px 30px rgba(0,0,0,.12)); }');\n const note = (cls: string, text: string) => {\n const d = document.createElement('div');\n d.className = cls;\n d.textContent = text;\n root.appendChild(d);\n };\n if (!mp.isSignedIn()) return note('muted', t.notSignedIn);\n note('muted', t.loading);\n try {\n const svg = await mp.membership.cardSvg();\n root.innerHTML = `<style>${BASE_CSS}:host { display: block; max-width: var(--vimine-card-width, 600px); } svg { width: 100%; height: auto; display: block; border-radius: 24px; box-shadow: var(--vimine-card-shadow, 0 8px 30px rgba(0,0,0,.12)); }</style>${svg}`;\n this.dispatchEvent(new CustomEvent('vimine-card', { detail: { loaded: true }, bubbles: true }));\n } catch (err) {\n root.innerHTML = `<style>${BASE_CSS}</style>`;\n const code = (err as { code?: string })?.code;\n // `not_active`: the membership exists but has no card (pending, suspended, revoked) — a state, not a failure.\n const quiet = code === 'not_found' || code === 'not_active';\n note(quiet ? 'muted' : 'error', code === 'not_found' ? t.noMembership : code === 'not_active' ? t.notActive : t.error);\n }\n }\n}\n\n/** `<vimine-enroll slug=\"…\" app-url=\"https://app.vimine.network\" height=\"900\">` — the hosted enrolment form. */\nexport class VimineEnroll extends HTMLElement {\n connectedCallback(): void {\n const slug = this.getAttribute('slug');\n const root = shadow(this, ':host { display: block; } iframe { width: 100%; border: 0; border-radius: var(--vimine-radius, 16px); background: transparent; }');\n if (!slug) {\n const e = document.createElement('div');\n e.className = 'error';\n e.textContent = 'vimine-enroll: missing slug';\n root.appendChild(e);\n return;\n }\n const appUrl = (this.getAttribute('app-url') || client().options.appUrl || 'https://app.vimine.network').replace(/\\/+$/, '');\n const frame = document.createElement('iframe');\n frame.src = `${appUrl}/enroll/${encodeURIComponent(slug)}`;\n frame.title = 'Vimine';\n frame.loading = 'lazy';\n frame.style.height = `${Number(this.getAttribute('height')) || 900}px`;\n frame.setAttribute('sandbox', 'allow-forms allow-scripts allow-same-origin allow-popups');\n root.appendChild(frame);\n }\n}\n\nconst money = (amount: number, currency: string, lang: Lang): string => {\n try {\n return new Intl.NumberFormat(lang === 'en' ? 'en-GB' : 'it-IT', { style: 'currency', currency: currency || 'EUR' }).format(amount);\n } catch {\n return `${amount.toFixed(2)} ${currency}`;\n }\n};\nconst when = (iso: string, tz: string, lang: Lang): string => {\n try {\n return new Date(iso).toLocaleString(lang === 'en' ? 'en-GB' : 'it-IT', { timeZone: tz, dateStyle: 'full', timeStyle: 'short' });\n } catch {\n return new Date(iso).toLocaleString();\n }\n};\n\n/**\n * `<vimine-events slug=\"…\" filter=\"upcoming\" limit=\"10\" detail-url=\"/eventi/{slug}\">` — the association's events:\n * the public ones for a visitor (no sign-in), every published one for a signed-in member, each with its registration\n * types (contribution, places left) and a register button (`registrations:write`) — or a sign-in button. Fires\n * `vimine-registration` `{ registration }` after a registration. `detail-url` (with `{slug}`) adds a details link.\n */\nexport class VimineEvents extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n private state: Record<string, Registration> = {};\n connectedCallback(): void {\n void this.render();\n this.unsubscribe = client().onChange(() => void this.render());\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async render(): Promise<void> {\n const mp = client();\n const lang = langOf(this);\n const t = STRINGS[lang];\n const root = shadow(this, `:host { display: block; }\n.event { border: 1px solid var(--vimine-border, #e5e5e5); border-radius: var(--vimine-radius, 16px); padding: var(--vimine-padding, 1rem); margin: 0 0 1rem; }\n.event h3 { margin: 0 0 .25rem; font-size: 1.15em; } .event img { width: 100%; border-radius: var(--vimine-radius, 16px); margin-bottom: .75rem; display: block; }\n.type { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--vimine-border, #eee); }\n.type .n { font-weight: 600; } .type button { padding: .45rem .9rem; } a { color: var(--vimine-accent, #0a0e1a); }`);\n const note = (cls: string, text: string): void => {\n const d = document.createElement('div');\n d.className = cls;\n d.textContent = text;\n root.appendChild(d);\n };\n note('muted', t.loading);\n const slug = this.getAttribute('slug') || '';\n const filter = (this.getAttribute('filter') || 'upcoming') as 'upcoming' | 'past' | 'cancelled' | 'all';\n const limit = Number(this.getAttribute('limit')) || undefined;\n let items: Event[];\n try {\n const params = { filter, ...(limit ? { limit } : {}) };\n items = mp.isSignedIn() ? (await mp.events.list(params)).items : (await mp.public.events.list(slug, params)).items;\n } catch {\n root.innerHTML = `<style>${BASE_CSS}</style>`;\n return note('error', t.error);\n }\n root.innerHTML = root.querySelector('style')!.outerHTML;\n if (!items.length) return note('muted', t.noEvents);\n const detailUrl = this.getAttribute('detail-url');\n for (const ev of items) root.appendChild(this.card(ev, mp, lang, detailUrl));\n }\n private card(ev: Event, mp: Vimine, lang: Lang, detailUrl: string | null): HTMLElement {\n const t = STRINGS[lang];\n const el = document.createElement('article');\n el.className = 'event';\n if (ev.cover_url) {\n const img = document.createElement('img');\n img.src = ev.cover_url;\n img.alt = '';\n el.appendChild(img);\n }\n const h = document.createElement('h3');\n h.textContent = ev.title;\n el.appendChild(h);\n const meta = document.createElement('div');\n meta.className = 'muted';\n meta.textContent = `${when(ev.starts_at, ev.timezone, lang)}${ev.location ? ` · ${ev.location.name || ev.location.address || ''}` : ''}`;\n el.appendChild(meta);\n if (ev.summary) {\n const p = document.createElement('p');\n p.textContent = ev.summary;\n el.appendChild(p);\n }\n if (detailUrl) {\n const a = document.createElement('a');\n a.href = detailUrl.replace('{slug}', encodeURIComponent(ev.slug));\n a.textContent = t.details;\n el.appendChild(a);\n }\n const mine = this.state[ev.id];\n if (mine) {\n const d = document.createElement('div');\n d.className = 'muted';\n d.textContent = mine.status === 'confirmed' ? t.registered : t.reserved;\n el.appendChild(d);\n return el;\n }\n if (ev.status === 'published') for (const tp of ev.registration_types) el.appendChild(this.typeRow(ev, tp, mp, lang));\n return el;\n }\n private typeRow(ev: Event, tp: RegistrationType, mp: Vimine, lang: Lang): HTMLElement {\n const t = STRINGS[lang];\n const row = document.createElement('div');\n row.className = 'type';\n const left = document.createElement('div');\n const n = document.createElement('div');\n n.className = 'n';\n n.textContent = `${tp.name} · ${tp.amount > 0 ? money(tp.amount, tp.currency, lang) : t.free}`;\n left.appendChild(n);\n const s = document.createElement('div');\n s.className = 'muted';\n s.textContent = [tp.remaining != null ? `${tp.remaining} ${t.places}` : '', tp.reason ? t.reason[tp.reason] || tp.reason : ''].filter(Boolean).join(' · ');\n left.appendChild(s);\n row.appendChild(left);\n const btn = document.createElement('button');\n btn.type = 'button';\n if (!mp.isSignedIn()) {\n btn.textContent = t.signInToRegister;\n btn.addEventListener('click', () => void mp.signIn({ scopes: ['events:read', 'registrations:read', 'registrations:write'] }));\n } else {\n btn.textContent = t.register;\n btn.disabled = !tp.open;\n btn.addEventListener('click', async () => {\n btn.disabled = true;\n try {\n const reg = await mp.registrations.create(ev.slug, { registration_type: tp.uid });\n this.state[ev.id] = reg;\n this.dispatchEvent(new CustomEvent('vimine-registration', { detail: { registration: reg }, bubbles: true }));\n void this.render();\n } catch (err) {\n btn.disabled = false;\n const reasons = ((err as { errors?: { code?: string }[] })?.errors || []).map((e) => t.reason[e.code || ''] || e.code).filter(Boolean);\n s.textContent = reasons.length ? reasons.join(', ') : t.error;\n s.className = 'error';\n }\n });\n }\n row.appendChild(btn);\n return row;\n }\n}\n\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,gHAAgH;AAChH,mGAAmG;AACnG,EAAE;AACF,iEAAiE;AACjE,kGAAkG;AAClG,EAAE;AACF,+FAA+F;AAC/F,uGAAuG;AACvG,qHAAqH;AACrH,oHAAoH;AACpH,yHAAyH;AACzH,wGAAwG;AACxG,0GAA0G;AAC1G,uHAAuH;AACvH,iGAAiG;AACjG,EAAE;AACF,sGAAsG;AACtG,6EAA6E;AAC7E,OAAO,EAAE,MAAM,EAAsB,MAAM,YAAY,CAAC;AAGxD,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC,MAAM,OAAO,GAAG;IACd,EAAE,EAAE;QACF,MAAM,EAAE,mBAAmB;QAC3B,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,cAAc;QACvB,WAAW,EAAE,mCAAmC;QAChD,YAAY,EAAE,yCAAyC;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tier: three custom elements over the browser client, Shadow DOM,\n// styled through `--vimine-*` CSS custom properties, Italian by default (`lang=\"en\"` on the element or the page\n// switches the strings). Register them once, then use the tags anywhere (CMS pages, static sites):\n//\n// import { defineVimineElements } from '@vimine/sdk/elements';\n// defineVimineElements({ clientId: 'vmc_…', redirectUri: 'https://www.example.org/callback' });\n//\n// <vimine-sign-in scope=\"membership:read\"></vimine-sign-in> a \"Sign in with Vimine\" button\n// <vimine-card></vimine-card> the signed-in member's card (SVG + QR)\n// <vimine-enroll slug=\"your-slug\"></vimine-enroll> the hosted enrolment form (iframe, Embed v0), in the\n// element's language; someone who already has a\n// Vimine account is offered a hand-off to the hosted\n// page, where they join in one step\n// <vimine-events slug=\"your-slug\"></vimine-events> the association's events (public ones for\n// visitors, every one for a signed-in member) with\n// a register button per type\n//\n// The callback page still calls `client.handleRedirect()` (or `<vimine-sign-in>` does it for you when\n// `handle-redirect` is set on the element and the page is the redirect URI).\nimport { Vimine, type VimineOptions } from \"./index.js\";\nimport type { Event, Registration, RegistrationType, Scope } from \"./types.js\";\n\nlet shared: Vimine | null = null;\n\nconst STRINGS = {\n it: {\n signIn: \"Accedi con Vimine\",\n signOut: \"Esci\",\n loading: \"Caricamento…\",\n notSignedIn: \"Accedi per vedere la tua tessera.\",\n noMembership: \"Nessuna tessera in questa associazione.\",\n notActive:\n \"La tessera non è ancora attiva: il codice compare quando lo diventa.\",\n error: \"Si è verificato un errore.\",\n noEvents: \"Nessun evento in programma.\",\n free: \"gratuita\",\n places: \"posti\",\n register: \"Iscriviti\",\n signInToRegister: \"Accedi per iscriverti\",\n joinAndBook: \"Iscriviti all’associazione e prenota\",\n alreadyMember: \"Sono già socio: accedi\",\n registered: \"Iscrizione confermata\",\n reserved: \"Posto riservato: in attesa del contributo\",\n details: \"Dettagli\",\n reason: {\n sold_out: \"esaurito\",\n event_full: \"al completo\",\n registration_not_open: \"iscrizioni non ancora aperte\",\n registration_closed: \"iscrizioni chiuse\",\n membership_required: \"riservato ai soci\",\n membership_not_active: \"tessera non valida\",\n membership_not_yet_valid:\n \"la tessera non è ancora utilizzabile a quella data\",\n membership_type_not_allowed: \"tipo di tessera non ammesso\",\n max_per_user: \"già iscritto\",\n event_past: \"evento concluso\",\n event_cancelled: \"evento annullato\",\n event_not_published: \"non pubblicato\",\n plan_limit: \"non disponibile\",\n invalid_type: \"tipo non valido\",\n } as Record<string, string>,\n },\n en: {\n signIn: \"Sign in with Vimine\",\n signOut: \"Sign out\",\n loading: \"Loading…\",\n notSignedIn: \"Sign in to see your card.\",\n noMembership: \"No membership in this association.\",\n notActive: \"The card is not active yet: its code appears once it is.\",\n error: \"Something went wrong.\",\n noEvents: \"No upcoming events.\",\n free: \"free\",\n places: \"places\",\n register: \"Register\",\n signInToRegister: \"Sign in to register\",\n joinAndBook: \"Join the association and book\",\n alreadyMember: \"Already a member? Sign in\",\n registered: \"Registration confirmed\",\n reserved: \"Place reserved: awaiting the contribution\",\n details: \"Details\",\n reason: {\n sold_out: \"sold out\",\n event_full: \"full\",\n registration_not_open: \"registrations not open yet\",\n registration_closed: \"registrations closed\",\n membership_required: \"members only\",\n membership_not_active: \"membership not valid\",\n membership_not_yet_valid: \"your card is not usable yet on that date\",\n membership_type_not_allowed: \"membership type not admitted\",\n max_per_user: \"already registered\",\n event_past: \"event over\",\n event_cancelled: \"event cancelled\",\n event_not_published: \"not published\",\n plan_limit: \"not available\",\n invalid_type: \"invalid type\",\n } as Record<string, string>,\n },\n};\ntype Lang = keyof typeof STRINGS;\nconst langOf = (el: HTMLElement): Lang => {\n const l = (\n el.getAttribute(\"lang\") ||\n el.closest(\"[lang]\")?.getAttribute(\"lang\") ||\n document.documentElement.lang ||\n \"it\"\n )\n .slice(0, 2)\n .toLowerCase();\n return l === \"en\" ? \"en\" : \"it\";\n};\n\nconst BASE_CSS = /* CSS */ `\n:host { display: inline-block; font-family: var(--vimine-font, system-ui, sans-serif); color: var(--vimine-color, #111); }\nbutton { cursor: pointer; border: 0; border-radius: var(--vimine-radius, 999px); padding: var(--vimine-padding, 0.65rem 1.1rem);\n background: var(--vimine-accent, #0a0e1a); color: var(--vimine-accent-contrast, #fff); font: inherit; font-weight: 600; }\nbutton:disabled { opacity: .6; cursor: default; }\n.muted { color: var(--vimine-muted, #666); font-size: .9em; }\n.error { color: var(--vimine-error, #a33); font-size: .9em; }\n`;\n\nconst shadow = (el: HTMLElement, css: string): ShadowRoot => {\n const root = el.shadowRoot || el.attachShadow({ mode: \"open\" });\n root.innerHTML = `<style>${BASE_CSS}${css}</style>`;\n return root;\n};\n\n/** The client the elements use. Call once; pass your own instance to share it with the rest of the page. */\nexport function defineVimineElements(options: VimineOptions | Vimine): Vimine {\n shared = options instanceof Vimine ? options : new Vimine(options);\n if (typeof customElements !== \"undefined\") {\n if (!customElements.get(\"vimine-sign-in\"))\n customElements.define(\"vimine-sign-in\", VimineSignIn);\n if (!customElements.get(\"vimine-card\"))\n customElements.define(\"vimine-card\", VimineCard);\n if (!customElements.get(\"vimine-enroll\"))\n customElements.define(\"vimine-enroll\", VimineEnroll);\n if (!customElements.get(\"vimine-events\"))\n customElements.define(\"vimine-events\", VimineEvents);\n }\n return shared;\n}\n\nconst client = (): Vimine => {\n if (!shared)\n throw new Error(\n \"Vimine elements: call defineVimineElements({ clientId, redirectUri }) first\",\n );\n return shared;\n};\n\n/** `<vimine-sign-in scope=\"…\" return-to=\"/area\" label=\"…\" handle-redirect>` — a sign-in / sign-out button. */\nexport class VimineSignIn extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n connectedCallback(): void {\n void this.boot();\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async boot(): Promise<void> {\n const mp = client();\n if (this.hasAttribute(\"handle-redirect\")) {\n try {\n await mp.handleRedirect();\n } catch (err) {\n this.render(err instanceof Error ? err.message : String(err));\n return;\n }\n }\n this.render();\n this.unsubscribe = mp.onChange(() => this.render());\n }\n private render(error?: string): void {\n const mp = client();\n const t = STRINGS[langOf(this)];\n const root = shadow(this, \"\");\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n if (mp.isSignedIn()) {\n btn.textContent = this.getAttribute(\"label-signed-in\") || t.signOut;\n btn.addEventListener(\n \"click\",\n () => void mp.signOut({ everywhere: this.hasAttribute(\"everywhere\") }),\n );\n } else {\n btn.textContent = this.getAttribute(\"label\") || t.signIn;\n btn.addEventListener(\"click\", () => {\n const scopes = (this.getAttribute(\"scope\") || \"\")\n .split(/[\\s,]+/)\n .filter(Boolean) as Scope[];\n void mp.signIn({\n ...(scopes.length ? { scopes } : {}),\n ...(this.getAttribute(\"return-to\")\n ? { returnTo: this.getAttribute(\"return-to\")! }\n : {}),\n });\n });\n }\n root.appendChild(btn);\n if (error) {\n const e = document.createElement(\"div\");\n e.className = \"error\";\n e.textContent = error;\n root.appendChild(e);\n }\n this.dispatchEvent(\n new CustomEvent(\"vimine-change\", {\n detail: { signedIn: mp.isSignedIn() },\n bubbles: true,\n }),\n );\n }\n}\n\n/** `<vimine-card>` — the signed-in member's card as SVG (with the live QR); refreshes when the session changes. */\nexport class VimineCard extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n connectedCallback(): void {\n void this.render();\n this.unsubscribe = client().onChange(() => void this.render());\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async render(): Promise<void> {\n const mp = client();\n const t = STRINGS[langOf(this)];\n const root = shadow(\n this,\n \":host { display: block; max-width: var(--vimine-card-width, 600px); } svg { width: 100%; height: auto; display: block; border-radius: 24px; box-shadow: var(--vimine-card-shadow, 0 8px 30px rgba(0,0,0,.12)); }\",\n );\n const note = (cls: string, text: string) => {\n const d = document.createElement(\"div\");\n d.className = cls;\n d.textContent = text;\n root.appendChild(d);\n };\n if (!mp.isSignedIn()) return note(\"muted\", t.notSignedIn);\n note(\"muted\", t.loading);\n try {\n const svg = await mp.membership.cardSvg();\n root.innerHTML = `<style>${BASE_CSS}:host { display: block; max-width: var(--vimine-card-width, 600px); } svg { width: 100%; height: auto; display: block; border-radius: 24px; box-shadow: var(--vimine-card-shadow, 0 8px 30px rgba(0,0,0,.12)); }</style>${svg}`;\n this.dispatchEvent(\n new CustomEvent(\"vimine-card\", {\n detail: { loaded: true },\n bubbles: true,\n }),\n );\n } catch (err) {\n root.innerHTML = `<style>${BASE_CSS}</style>`;\n const code = (err as { code?: string })?.code;\n // `not_active`: the membership exists but has no card (pending, suspended, revoked) — a state, not a failure.\n const quiet = code === \"not_found\" || code === \"not_active\";\n note(\n quiet ? \"muted\" : \"error\",\n code === \"not_found\"\n ? t.noMembership\n : code === \"not_active\"\n ? t.notActive\n : t.error,\n );\n }\n }\n}\n\n/** The hosted enrolment page of an association, in a language: the frame's address, and where a hand-off lands. */\n/**\n * How the hosted enrolment page looks inside the host site: its scheme, the accent of its buttons, links and the\n * association's name, and the ground behind its cards (`transparent`: the host page shows through). The page reads them\n * from its address — a framed page cannot see the host's CSS — and ignores anything that is not a colour or a keyword.\n */\nexport type EnrollAppearance = { scheme?: \"light\" | \"dark\"; accent?: string; background?: string; font?: Typeface };\n\n/** The faces the hosted page offers — served by Vimine itself — or `system`, the device's own. They set everything. */\nexport const TYPEFACES = [\n \"system\",\n \"inter\",\n \"roboto\",\n \"open-sans\",\n \"montserrat\",\n \"nunito\",\n \"lora\",\n \"merriweather\",\n \"roboto-slab\",\n] as const;\nexport type Typeface = (typeof TYPEFACES)[number];\n\nconst HEX = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;\nconst appearanceQuery = (a?: EnrollAppearance): string => {\n if (!a) return \"\";\n const out: string[] = [];\n if (a.scheme === \"light\" || a.scheme === \"dark\") out.push(`scheme=${a.scheme}`);\n if (a.accent && HEX.test(a.accent)) out.push(`accent=${encodeURIComponent(a.accent.replace(/^#/, \"\"))}`);\n if (a.background === \"transparent\") out.push(\"background=transparent\");\n else if (a.background && HEX.test(a.background))\n out.push(`background=${encodeURIComponent(a.background.replace(/^#/, \"\"))}`);\n if (a.font && (TYPEFACES as readonly string[]).includes(a.font)) out.push(`font=${a.font}`);\n return out.length ? `&${out.join(\"&\")}` : \"\";\n};\n\nexport const enrollUrl = (appUrl: string, slug: string, lang: string, appearance?: EnrollAppearance): string =>\n `${appUrl.replace(/\\/+$/, \"\")}/enroll/${encodeURIComponent(slug)}?locale=${encodeURIComponent(lang)}${appearanceQuery(appearance)}`;\n\n/**\n * The same page, opened FROM an event: the person joins the association and asks for a place at the event in one go.\n * The request carries the event; the place is confirmed, or held until the membership is active.\n */\nexport const eventEnrollUrl = (\n appUrl: string,\n slug: string,\n event: string,\n lang: string,\n): string =>\n `${enrollUrl(appUrl, slug, lang)}&event=${encodeURIComponent(event)}`;\n\n/** Any CSS colour (a name, `rgb()`, `hsl()`, a hex) as `#rrggbb`, resolved by the browser; null when it is none. */\nconst hexColour = (root: ShadowRoot, value: string): string | null => {\n const v = value.trim();\n if (!v) return null;\n const probe = document.createElement(\"span\");\n probe.style.color = v;\n if (!probe.style.color) return null;\n root.appendChild(probe);\n const m = /rgba?\\(([^)]+)\\)/.exec(getComputedStyle(probe).color);\n probe.remove();\n const parts = (m?.[1] ?? \"\").split(/[\\s,/]+/).filter(Boolean).map(Number);\n if (parts.length < 3) return null;\n const [r = 0, g = 0, b = 0, alpha] = parts;\n if (alpha === 0) return null;\n return `#${[r, g, b].map((n) => Math.round(n).toString(16).padStart(2, \"0\")).join(\"\")}`;\n};\n\n/**\n * The page's look from the host's CSS: `--vimine-scheme` (light | dark), `--vimine-accent` and `--vimine-background` (a\n * colour, or `transparent`), `--vimine-typeface` (one of TYPEFACES) — custom properties inherit, so one rule on `:root`\n * styles every Vimine element at once.\n */\nconst appearanceOf = (el: HTMLElement, root: ShadowRoot): EnrollAppearance => {\n const css = getComputedStyle(el);\n const read = (name: string) => css.getPropertyValue(name).trim();\n const out: EnrollAppearance = {};\n const scheme = read(\"--vimine-scheme\");\n if (scheme === \"light\" || scheme === \"dark\") out.scheme = scheme;\n const accent = hexColour(root, read(\"--vimine-accent\"));\n if (accent) out.accent = accent;\n const background = read(\"--vimine-background\");\n if (background === \"transparent\") out.background = \"transparent\";\n else {\n const bg = hexColour(root, background);\n if (bg) out.background = bg;\n }\n const typeface = read(\"--vimine-typeface\");\n if ((TYPEFACES as readonly string[]).includes(typeface)) out.font = typeface as Typeface;\n return out;\n};\n\n/**\n * `<vimine-enroll slug=\"…\" app-url=\"https://app.vimine.network\" height=\"900\" lang=\"en\">` — the hosted enrolment form.\n *\n * Styled like the other elements, through CSS custom properties on the element or any ancestor:\n *\n * vimine-enroll { --vimine-scheme: light; --vimine-accent: #1e3a5f; --vimine-background: transparent; }\n *\n * `--vimine-scheme` the page's scheme; `--vimine-accent` its buttons, links and the association's name (moved towards\n * the page's ink when it would not read on its cards); `--vimine-background` the ground behind the cards;\n * `--vimine-typeface` the face of the whole page, fields included — one of TYPEFACES, served by Vimine (a framed page\n * cannot use the host's fonts). The frame is styled once, when the element connects.\n *\n * The form opens in the element's language (`lang` on the element or the page; Italian by default). Someone who already\n * has a Vimine account need not fill it: the form offers *Continua su Vimine*, which opens the hosted page in a new\n * tab — there their session is recognised and they join in one step (the association's statuto and privacy notice, and\n * nothing they have already told Vimine). It is a hand-off and not a sign-in inside the frame because a browser keeps a\n * framed page's session apart from the same site opened directly; the frame's sandbox lets that tab open as an ordinary\n * page (`allow-popups-to-escape-sandbox`).\n */\nexport class VimineEnroll extends HTMLElement {\n connectedCallback(): void {\n const slug = this.getAttribute(\"slug\");\n const root = shadow(\n this,\n \":host { display: block; } iframe { width: 100%; border: 0; border-radius: var(--vimine-radius, 16px); background: transparent; }\",\n );\n if (!slug) {\n const e = document.createElement(\"div\");\n e.className = \"error\";\n e.textContent = \"vimine-enroll: missing slug\";\n root.appendChild(e);\n return;\n }\n const appUrl = (\n this.getAttribute(\"app-url\") ||\n client().options.appUrl ||\n \"https://app.vimine.network\"\n ).replace(/\\/+$/, \"\");\n const frame = document.createElement(\"iframe\");\n frame.src = enrollUrl(appUrl, slug, langOf(this), appearanceOf(this, root));\n frame.title = \"Vimine\";\n frame.loading = \"lazy\";\n frame.style.height = `${Number(this.getAttribute(\"height\")) || 900}px`;\n frame.setAttribute(\n \"sandbox\",\n \"allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox\",\n );\n root.appendChild(frame);\n }\n}\n\nconst money = (amount: number, currency: string, lang: Lang): string => {\n try {\n return new Intl.NumberFormat(lang === \"en\" ? \"en-GB\" : \"it-IT\", {\n style: \"currency\",\n currency: currency || \"EUR\",\n }).format(amount);\n } catch {\n return `${amount.toFixed(2)} ${currency}`;\n }\n};\nconst when = (iso: string, tz: string, lang: Lang): string => {\n try {\n return new Date(iso).toLocaleString(lang === \"en\" ? \"en-GB\" : \"it-IT\", {\n timeZone: tz,\n dateStyle: \"full\",\n timeStyle: \"short\",\n });\n } catch {\n return new Date(iso).toLocaleString();\n }\n};\n\n/**\n * `<vimine-events slug=\"…\" filter=\"upcoming\" limit=\"10\" detail-url=\"/eventi/{slug}\">` — the association's events:\n * the public ones for a visitor (no sign-in), every published one for a signed-in member, each with its registration\n * types (contribution, places left) and a register button (`registrations:write`). Fires `vimine-registration`\n * `{ registration }` after a registration. `detail-url` (with `{slug}`) adds a details link.\n *\n * A VISITOR is offered a way in, not a bare sign-in: *Iscriviti all’associazione e prenota* opens the association's\n * hosted enrolment page with the event (a new tab; `app-url` as on `<vimine-enroll>`) — they join and ask for the place\n * in one go — and *Sono già socio: accedi* signs a member in here. The first is shown while the event has a registration\n * that can be had and the association takes enrolment requests; otherwise the sign-in alone.\n */\nexport class VimineEvents extends HTMLElement {\n private unsubscribe: (() => void) | null = null;\n private state: Record<string, Registration> = {};\n connectedCallback(): void {\n void this.render();\n this.unsubscribe = client().onChange(() => void this.render());\n }\n disconnectedCallback(): void {\n this.unsubscribe?.();\n this.unsubscribe = null;\n }\n private async render(): Promise<void> {\n const mp = client();\n const lang = langOf(this);\n const t = STRINGS[lang];\n const root = shadow(\n this,\n /* CSS */ `:host { display: block; }\n.event { border: 1px solid var(--vimine-border, #e5e5e5); border-radius: var(--vimine-radius, 16px); padding: var(--vimine-padding, 1rem); margin: 0 0 1rem; }\n.event h3 { margin: 0 0 .25rem; font-size: 1.15em; } .event img { width: 100%; border-radius: var(--vimine-radius, 16px); margin-bottom: .75rem; display: block; }\n.type { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--vimine-border, #eee); }\n.type .n { font-weight: 600; } .type button { padding: .45rem .9rem; } a { color: var(--vimine-accent, #0a0e1a); }\n.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding-top: .75rem; border-top: 1px solid var(--vimine-border, #eee); }\na.button { display: inline-block; text-decoration: none; border-radius: var(--vimine-radius, 999px); padding: var(--vimine-padding, 0.65rem 1.1rem);\n background: var(--vimine-accent, #0a0e1a); color: var(--vimine-accent-contrast, #fff); font-weight: 600; }\nbutton.link { background: none; color: var(--vimine-accent, #0a0e1a); padding: 0; border-radius: 0; text-decoration: underline; font-weight: 400; }`,\n );\n const note = (cls: string, text: string): void => {\n const d = document.createElement(\"div\");\n d.className = cls;\n d.textContent = text;\n root.appendChild(d);\n };\n note(\"muted\", t.loading);\n const slug = this.getAttribute(\"slug\") || \"\";\n const filter = (this.getAttribute(\"filter\") || \"upcoming\") as\n | \"upcoming\"\n | \"past\"\n | \"cancelled\"\n | \"all\";\n const limit = Number(this.getAttribute(\"limit\")) || undefined;\n let items: Event[];\n // For a visitor: does the association take enrolment requests? Only then is joining a way to a place. A side\n // read — a failure leaves the sign-in alone.\n let joinable = false;\n try {\n const params = { filter, ...(limit ? { limit } : {}) };\n items = mp.isSignedIn()\n ? (await mp.events.list(params)).items\n : (await mp.public.events.list(slug, params)).items;\n if (!mp.isSignedIn() && slug)\n joinable = await mp.public\n .association(slug)\n .then((config) => config.aps.accepting_requests === true)\n .catch(() => false);\n } catch {\n root.innerHTML = `<style>${BASE_CSS}</style>`;\n return note(\"error\", t.error);\n }\n root.innerHTML = root.querySelector(\"style\")!.outerHTML;\n if (!items.length) return note(\"muted\", t.noEvents);\n const detailUrl = this.getAttribute(\"detail-url\");\n const join = joinable\n ? {\n slug,\n appUrl: (\n this.getAttribute(\"app-url\") ||\n mp.options.appUrl ||\n \"https://app.vimine.network\"\n ).replace(/\\/+$/, \"\"),\n }\n : null;\n for (const ev of items)\n root.appendChild(this.card(ev, mp, lang, detailUrl, join));\n }\n private card(\n ev: Event,\n mp: Vimine,\n lang: Lang,\n detailUrl: string | null,\n join: { slug: string; appUrl: string } | null,\n ): HTMLElement {\n const t = STRINGS[lang];\n const el = document.createElement(\"article\");\n el.className = \"event\";\n if (ev.cover_url) {\n const img = document.createElement(\"img\");\n img.src = ev.cover_url;\n img.alt = \"\";\n el.appendChild(img);\n }\n const h = document.createElement(\"h3\");\n h.textContent = ev.title;\n el.appendChild(h);\n const meta = document.createElement(\"div\");\n meta.className = \"muted\";\n meta.textContent = `${when(ev.starts_at, ev.timezone, lang)}${ev.location ? ` · ${ev.location.name || ev.location.address || \"\"}` : \"\"}`;\n el.appendChild(meta);\n if (ev.summary) {\n const p = document.createElement(\"p\");\n p.textContent = ev.summary;\n el.appendChild(p);\n }\n if (detailUrl) {\n const a = document.createElement(\"a\");\n a.href = detailUrl.replace(\"{slug}\", encodeURIComponent(ev.slug));\n a.textContent = t.details;\n el.appendChild(a);\n }\n const mine = this.state[ev.id];\n if (mine) {\n const d = document.createElement(\"div\");\n d.className = \"muted\";\n d.textContent = mine.status === \"confirmed\" ? t.registered : t.reserved;\n el.appendChild(d);\n return el;\n }\n if (ev.status === \"published\")\n for (const tp of ev.registration_types)\n el.appendChild(this.typeRow(ev, tp, mp, lang));\n // A visitor: one call for the event, under its registrations — join and book on the hosted page, or sign in here.\n if (\n ev.status === \"published\" &&\n !mp.isSignedIn() &&\n ev.registration_types.some((tp) => tp.open)\n ) {\n const actions = document.createElement(\"div\");\n actions.className = \"actions\";\n const signIn = document.createElement(\"button\");\n signIn.type = \"button\";\n signIn.addEventListener(\n \"click\",\n () =>\n void mp.signIn({\n scopes: [\n \"events:read\",\n \"registrations:read\",\n \"registrations:write\",\n ],\n }),\n );\n if (join) {\n const a = document.createElement(\"a\");\n a.className = \"button\";\n a.href = eventEnrollUrl(join.appUrl, join.slug, ev.slug, lang);\n a.target = \"_blank\";\n a.rel = \"noopener\";\n a.textContent = t.joinAndBook;\n actions.appendChild(a);\n signIn.className = \"link\";\n signIn.textContent = t.alreadyMember;\n } else signIn.textContent = t.signInToRegister;\n actions.appendChild(signIn);\n el.appendChild(actions);\n }\n return el;\n }\n private typeRow(\n ev: Event,\n tp: RegistrationType,\n mp: Vimine,\n lang: Lang,\n ): HTMLElement {\n const t = STRINGS[lang];\n const row = document.createElement(\"div\");\n row.className = \"type\";\n const left = document.createElement(\"div\");\n const n = document.createElement(\"div\");\n n.className = \"n\";\n n.textContent = `${tp.name} · ${tp.amount > 0 ? money(tp.amount, tp.currency, lang) : t.free}`;\n left.appendChild(n);\n const s = document.createElement(\"div\");\n s.className = \"muted\";\n s.textContent = [\n tp.remaining != null ? `${tp.remaining} ${t.places}` : \"\",\n tp.reason ? t.reason[tp.reason] || tp.reason : \"\",\n ]\n .filter(Boolean)\n .join(\" · \");\n left.appendChild(s);\n row.appendChild(left);\n // A visitor has the event's own call below the registrations (`card`): no button per registration.\n if (!mp.isSignedIn()) return row;\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.textContent = t.register;\n btn.disabled = !tp.open;\n btn.addEventListener(\"click\", async () => {\n btn.disabled = true;\n try {\n const reg = await mp.registrations.create(ev.slug, {\n registration_type: tp.uid,\n });\n this.state[ev.id] = reg;\n this.dispatchEvent(\n new CustomEvent(\"vimine-registration\", {\n detail: { registration: reg },\n bubbles: true,\n }),\n );\n void this.render();\n } catch (err) {\n btn.disabled = false;\n const reasons = (\n (err as { errors?: { code?: string }[] })?.errors || []\n )\n .map((e) => t.reason[e.code || \"\"] || e.code)\n .filter(Boolean);\n s.textContent = reasons.length ? reasons.join(\", \") : t.error;\n s.className = \"error\";\n }\n });\n row.appendChild(btn);\n return row;\n }\n}\n"]}
@@ -35,11 +35,19 @@ export interface MembershipType {
35
35
  network_eligible?: boolean;
36
36
  }
37
37
  export interface Statuto {
38
- uid?: string;
39
- version?: number;
40
- approvaldate?: string | null;
38
+ aps?: {
39
+ slug?: string;
40
+ name?: string;
41
+ };
42
+ title: string;
43
+ version: number;
44
+ approved_on?: string | null;
45
+ /** Of the uploaded document, when there is one */
41
46
  sha256?: string | null;
42
- content?: string | null;
47
+ /** The text as registered; empty when only a document was uploaded */
48
+ content_md?: string;
49
+ content_html: string;
50
+ /** The uploaded document, a link valid for 15 minutes */
43
51
  document_url?: string | null;
44
52
  }
45
53
  export interface ApsPublicConfig {
@@ -50,11 +58,16 @@ export interface ApsPublicConfig {
50
58
  aps: {
51
59
  slug?: string;
52
60
  name?: string;
53
- brandcolor?: string | null;
54
61
  picture_url?: string | null;
55
62
  citta?: string | null;
56
63
  provincia?: string | null;
57
64
  enroll_enabled?: boolean;
65
+ /** Whether a membership request would be taken now: enrolment on, a member more fits the plan, the association ready to collect requests, and its public door open. */
66
+ accepting_requests?: boolean;
67
+ /** True while Vimine registers people by invitation only (the private beta) and this association takes only the people it invited: `accepting_requests` is then false, and `POST /v1/enroll` answers 403 `not_available`. */
68
+ invitation_only?: boolean;
69
+ /** True for a sandbox: the test copy of an association that test clients work on, with synthetic members only. It never sends e-mail, takes no payments and is never in the Network. */
70
+ sandbox?: boolean;
58
71
  /** How the association admits its members, so that an applicant can be told up front what to expect. `model`: `board` — the request waits for a decision of the association’s board, and any fee is paid after it; `provisional` — admitted at once, ratified by the board later; `automatic` — active as soon as the conditions are met. `delay_hours`: the hours between admission and a USABLE card (0 = at once): the membership is active from admission, the card counts at the door only afterwards (see `valid_from`). */
59
72
  admission?: {
60
73
  model?: "board" | "provisional" | "automatic";
@@ -154,6 +167,8 @@ export interface EnrollRequest {
154
167
  codicefiscale?: string | null;
155
168
  /** The person confirms a code that disagrees with their particulars (422 `codicefiscale_mismatch` with `confirmable: true`) */
156
169
  codicefiscale_confirmed?: boolean;
170
+ /** Who holds parental responsibility for a minor (under 18 by `dob`). REQUIRED for a minor where the association declared it collects the block (`aps.collects_guardian_data`): 422 `required` on `guardian` otherwise; stored only where it declared so */
171
+ guardian?: Guardian;
157
172
  /** Residence or, where different, domicile. Asked of every member or of nobody: the public profile says what the association declared (`member_address`: none — ignored, not stored · optional · required — 422 `required` on `address` without it) */
158
173
  address?: MemberAddress;
159
174
  phone?: string | null;
@@ -205,6 +220,16 @@ export interface Me {
205
220
  locale?: "it" | "en" | null;
206
221
  updated_at?: string | null;
207
222
  }
223
+ export interface Guardian {
224
+ first_name: string;
225
+ last_name: string;
226
+ /** Parent, guardian… as the association records it */
227
+ relation: string;
228
+ /** Optional; refused when malformed */
229
+ codicefiscale?: string | null;
230
+ email?: string | null;
231
+ phone?: string | null;
232
+ }
208
233
  export interface MemberAddress {
209
234
  kind?: "residence" | "domicile";
210
235
  /** Street and number */
@@ -226,6 +251,8 @@ export interface EnrollConfirmRequest {
226
251
  codicefiscale?: string;
227
252
  codicefiscale_confirmed?: boolean;
228
253
  };
254
+ /** Only after a 409 `address_required`: the association asks every member for an address (`member_address: required` on its public profile). Optional where it declared `optional`; ignored where it collects none */
255
+ address?: MemberAddress;
229
256
  }
230
257
  export interface Event {
231
258
  id?: string;
@@ -499,6 +526,32 @@ export interface EnrollConfirmResult {
499
526
  name?: string;
500
527
  slug?: string;
501
528
  };
529
+ /** Only for a link sent by the association’s hosted enrolment page when that page was opened from one of its public events: what became of the place the person asked for together with the request. `null` for every other link */
530
+ event?: {
531
+ slug?: string;
532
+ title?: string;
533
+ starts_at?: string;
534
+ timezone?: string;
535
+ place?: string | null;
536
+ registration_type?: {
537
+ uid?: string;
538
+ name?: string;
539
+ /** 0 = free */
540
+ amount?: number;
541
+ currency?: string;
542
+ };
543
+ /** `confirmed`: the place is theirs. `reserved`: held, see `waiting`. `held`: the membership request itself still waits for the address to be confirmed, and no place was asked for. `unavailable`: no place, see `reasons` */
544
+ state?: "confirmed" | "reserved" | "held" | "unavailable";
545
+ /** What a `reserved` place waits for: the membership to become active (it is then confirmed by itself when free), the contribution, or both */
546
+ waiting?: Array<"membership" | "contribution">;
547
+ /** Why the place is `unavailable`: the reasons of `GET /v1/events/{slug}/eligibility` */
548
+ reasons?: Array<string>;
549
+ reserved_until?: string | null;
550
+ /** How to pay a contribution that is owed, in the association’s words */
551
+ payment_instructions?: string | null;
552
+ /** The person held this place before the link was used */
553
+ already?: boolean;
554
+ } | null;
502
555
  }
503
556
  /** Every operation of the document: id → [method, path]. */
504
557
  export declare const operations: {
@@ -549,9 +602,11 @@ export declare const operations: {
549
602
  readonly cancelMyRegistration: readonly ["DELETE", "/v1/me/registrations/{id}"];
550
603
  readonly createGuestRegistration: readonly ["POST", "/v1/events/{slug}/registrations/guest"];
551
604
  readonly confirmGuestRegistration: readonly ["POST", "/v1/registrations/confirm"];
605
+ readonly viewGuestRegistration: readonly ["POST", "/v1/registrations/view"];
552
606
  readonly listLegalDocuments: readonly ["GET", "/v1/legal"];
553
607
  readonly getSubProcessors: readonly ["GET", "/v1/legal/sub-processors"];
554
608
  readonly getLegalDocument: readonly ["GET", "/v1/legal/{kind}"];
555
609
  readonly getApsPrivacyNotice: readonly ["GET", "/v1/aps/{slug}/privacy-notice"];
610
+ readonly getApsStatuto: readonly ["GET", "/v1/aps/{slug}/statuto"];
556
611
  };
557
612
  export type OperationId = keyof typeof operations;
package/dist/generated.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // GENERATED by scripts/gen-types.mjs from openapi/v1.json — do not edit. Regenerate: npm run spec:types
2
- // Spec version 2026-09-19 · 45 paths · 35 schemas
2
+ // Spec version 2026-10-18 · 47 paths · 36 schemas
3
3
  /** Every operation of the document: id → [method, path]. */
4
4
  export const operations = {
5
5
  getOpenApi: ['GET', '/v1/openapi.json'],
@@ -49,9 +49,11 @@ export const operations = {
49
49
  cancelMyRegistration: ['DELETE', '/v1/me/registrations/{id}'],
50
50
  createGuestRegistration: ['POST', '/v1/events/{slug}/registrations/guest'],
51
51
  confirmGuestRegistration: ['POST', '/v1/registrations/confirm'],
52
+ viewGuestRegistration: ['POST', '/v1/registrations/view'],
52
53
  listLegalDocuments: ['GET', '/v1/legal'],
53
54
  getSubProcessors: ['GET', '/v1/legal/sub-processors'],
54
55
  getLegalDocument: ['GET', '/v1/legal/{kind}'],
55
56
  getApsPrivacyNotice: ['GET', '/v1/aps/{slug}/privacy-notice'],
57
+ getApsStatuto: ['GET', '/v1/aps/{slug}/statuto'],
56
58
  };
57
59
  //# sourceMappingURL=generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,kDAAkD;AA2hBlD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC;IACrC,kBAAkB,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAC7C,UAAU,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC9C,kBAAkB,EAAE,CAAC,MAAM,EAAE,0BAA0B,CAAC;IACxD,UAAU,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACjD,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;IACxB,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC7B,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC;IAClC,eAAe,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC;IAC7C,mBAAmB,EA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D,UAAU,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,+BAA+B,CAAC;IAC7D,kBAAkB,EAAE,CAAC,MAAM,EAAE,iCAAiC,CAAC;IAC/D,sBAAsB,EAAE,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClE,mBAAmB,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACpD,iBAAiB,EAAE,CAAC,KAAK,EAAE,2BAA2B,CAAC;IACvD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,2BAA2B,CAAC;IAC7D,uBAAuB,EAAE,CAAC,MAAM,EAAE,uCAAuC,CAAC;IAC1E,wBAAwB,EAAE,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC/D,kBAAkB,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;IACxC,gBAAgB,EAAE,CAAC,KAAK,EAAE,0BAA0B,CAAC;IACrD,gBAAgB,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC;IAC7C,mBAAmB,EAAE,CAAC,KAAK,EAAE,+BAA+B,CAAC;CACvD,CAAC","sourcesContent":["// GENERATED by scripts/gen-types.mjs from openapi/v1.json — do not edit. Regenerate: npm run spec:types\n// Spec version 2026-09-19 · 45 paths · 35 schemas\n\nexport interface Problem {\n type: string;\n title: string;\n status: number;\n detail?: string;\n code: string;\n request_id?: string;\n errors?: Array<{\n field?: string;\n code?: string;\n message?: string;\n }>;\n}\n\nexport interface Verification {\n status: \"active\" | \"inactive\";\n valid_until?: string;\n /** With `reason: not_yet_valid`: the card is genuine and active, and becomes usable at this moment */\n valid_from?: string;\n reason?: \"expired\" | \"invalid\" | \"not_yet_valid\";\n /** Present for registration tokens */\n kind?: \"card\" | \"registration\";\n event?: {\n slug?: string;\n starts_at?: string;\n } | null;\n}\n\nexport interface MembershipType {\n uid?: string;\n cod?: string;\n name?: string;\n description?: string | null;\n quota_amount?: number | null;\n currency?: string;\n expiry_model?: \"solar_year\" | \"rolling_12\" | \"rolling_24\" | \"prorated_solar\" | \"custom\";\n network_eligible?: boolean;\n}\n\nexport interface Statuto {\n uid?: string;\n version?: number;\n approvaldate?: string | null;\n sha256?: string | null;\n content?: string | null;\n document_url?: string | null;\n}\n\nexport interface ApsPublicConfig {\n /** The language this answer is written in */\n locale?: string;\n /** The languages the association offers: its own, plus those it enabled */\n locales?: Array<string>;\n aps: {\n slug?: string;\n name?: string;\n brandcolor?: string | null;\n picture_url?: string | null;\n citta?: string | null;\n provincia?: string | null;\n enroll_enabled?: boolean;\n /** How the association admits its members, so that an applicant can be told up front what to expect. `model`: `board` — the request waits for a decision of the association’s board, and any fee is paid after it; `provisional` — admitted at once, ratified by the board later; `automatic` — active as soon as the conditions are met. `delay_hours`: the hours between admission and a USABLE card (0 = at once): the membership is active from admission, the card counts at the door only afterwards (see `valid_from`). */\n admission?: {\n model?: \"board\" | \"provisional\" | \"automatic\";\n delay_hours?: number;\n };\n /** Kept for compatibility: true when `admission.model` is `board`. Read `admission` instead. */\n approval_required?: boolean;\n /** Whether the association collects its members’ address — of every member or of nobody. `none`: do not ask (an `address` sent anyway is not stored); `optional`; `required`: enrolment answers 422 without one. */\n member_address?: \"none\" | \"optional\" | \"required\";\n /** How to pay the fee, as the association words it */\n payment_instructions?: string | null;\n /** The activities of general interest the association carries out (Italian Third Sector Code, art. 5): `cod` is the letter of the article, `description` its Italian wording; one is marked as prevalent. */\n activity_sectors?: Array<{\n cod?: string;\n description?: string;\n prevalent?: boolean;\n }>;\n /** Present when the association is registered in the RUNTS (the Italian national register of Third Sector entities), as checked by the platform against the official public lists; null otherwise. Never typed by the association. */\n registry?: {\n /** Section of the register */\n section?: \"APS\" | \"ODV\" | \"EF\" | \"IS\" | \"RA\" | \"SOMS\" | \"ALTRI\" | null | null;\n /** Repertory number */\n number?: string | null;\n registered_on?: string | null;\n /** Date of the official list the check ran against */\n checked_on?: string | null;\n } | null;\n };\n membership_types: Array<MembershipType>;\n statuto: Statuto | unknown;\n /** The association's in-force privacy notice to members (full text: GET /v1/aps/{slug}/privacy-notice) */\n privacy_notice?: PrivacyNoticeRef | unknown;\n}\n\nexport interface FiscalCodeCheck {\n /** Codice fiscale (16 characters) */\n code: string;\n first_name?: string;\n last_name?: string;\n gender?: \"M\" | \"F\";\n /** Date of birth */\n date?: string;\n /** Birthplace: the comune, for a person born in Italy */\n place?: string;\n /** Birth country, ISO 3166-1 alpha-2. A code encodes the comune for people born in Italy and only the STATE for everybody else: anything but IT is compared with that state and `place` is ignored */\n country?: string;\n}\n\nexport interface FiscalCodeResult {\n valid?: boolean;\n error?: \"invalid\" | \"mismatch\" | null;\n /** What disagrees with the code, when `error` is `mismatch` */\n mismatches?: Array<\"lastName\" | \"firstName\" | \"gender\" | \"date\" | \"place\">;\n /** `names_swapped`: the code matches once surname and given name are exchanged */\n hints?: Array<\"names_swapped\">;\n /** The date of birth the code itself encodes */\n birth_date?: string | null;\n /** The birth country the code itself encodes, ISO 3166-1 alpha-2 (IT for a comune) */\n birth_country?: string | null;\n}\n\nexport interface CardKeys {\n keys?: Array<{\n kty?: string;\n crv?: string;\n x?: string;\n kid?: string;\n use?: string;\n alg?: string;\n }>;\n}\n\nexport interface SignupRequest {\n email: string;\n first_name: string;\n last_name: string;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only: it is not cross-checked */\n gender?: \"M\" | \"F\" | null;\n /** Comune (born in Italy) or city, free text (born abroad) */\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** Validated and cross-checked against the other fields when present */\n codicefiscale?: string | null;\n /** The person confirms a code that disagrees with their particulars (422 `codicefiscale_mismatch` with `confirmable: true`) */\n codicefiscale_confirmed?: boolean;\n /** The language of the page the person filled in (`it`, `en`; a regional tag such as `en-GB` is reduced to its language). It decides the language of the mails that follow and becomes the preference of a NEW account; an existing account keeps its own. Unsupported values are ignored */\n locale?: string | null;\n /** The account terms (platform_terms) the person accepted on your site — optional, but when given it must name the in-force version */\n accept_terms?: LegalRef;\n /** The platform privacy notice (platform_privacy) the person read on your site — optional, same rule */\n acknowledge_privacy?: LegalRef;\n}\n\nexport interface EnrollRequest {\n email: string;\n first_name: string;\n last_name: string;\n /** Optional. A person is identified by a fiscal code OR by `dob` + `birthplace` + `birth_country` — never neither (422 `required` on each missing particular). When present it is validated and cross-checked against the names, the date and the place (the state, for people born abroad) */\n codicefiscale?: string | null;\n /** The person confirms a code that disagrees with their particulars (422 `codicefiscale_mismatch` with `confirmable: true`) */\n codicefiscale_confirmed?: boolean;\n /** Residence or, where different, domicile. Asked of every member or of nobody: the public profile says what the association declared (`member_address`: none — ignored, not stored · optional · required — 422 `required` on `address` without it) */\n address?: MemberAddress;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only: it is not cross-checked */\n gender?: \"M\" | \"F\" | null;\n /** Comune (born in Italy) or city, free text (born abroad) */\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** One of the association’s membership types (omit when it has exactly one) */\n membership_type?: string;\n /** The language of the page the person filled in (`it`, `en`; a regional tag such as `en-GB` is reduced to its language). It decides the language of the mails that follow and becomes the preference of a NEW account; an existing account keeps its own. Unsupported values are ignored */\n locale?: string | null;\n /** The in-force statuto the person accepted on your site (from GET /v1/aps/{slug}) */\n accept_statuto: {\n version: number;\n sha256?: string;\n };\n /** The association's privacy notice the person read on your site (GET /v1/aps/{slug} → privacy_notice). REQUIRED when the association publishes one; 422 `privacy_notice_outdated` when it is not the in-force version */\n privacy_notice?: PrivacyNoticeAck;\n /** The account terms (platform_terms) the person accepted on your site — optional, must name the in-force version */\n accept_terms?: LegalRef;\n /** The platform privacy notice (platform_privacy) the person read — optional, same rule */\n acknowledge_privacy?: LegalRef;\n}\n\nexport interface Accepted {\n status: \"accepted\";\n}\n\nexport interface Me {\n /** The subject identifier of this person, as in the ID token */\n sub: string;\n email: string;\n email_verified: boolean;\n first_name?: string | null;\n last_name?: string | null;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only */\n gender?: \"M\" | \"F\" | null;\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** Optional: a person may have none */\n codicefiscale?: string | null;\n /** How the person is identified. `matched`: a fiscal code that agrees with their particulars; `mismatch_confirmed`: a code that disagrees, confirmed by the person; `absent`: no code — date, place and country of birth identify them; null: not identified yet (they cannot request a membership) */\n codicefiscale_check?: \"matched\" | \"mismatch_confirmed\" | \"absent\" | null;\n /** The language the person chose for the platform and its mails; null: never chosen — the language of the request, then of the association, applies */\n locale?: \"it\" | \"en\" | null;\n updated_at?: string | null;\n}\n\nexport interface MemberAddress {\n kind?: \"residence\" | \"domicile\";\n /** Street and number */\n line: string;\n postal_code?: string | null;\n city: string;\n /** Italian addresses only (two letters); dropped abroad */\n province?: string | null;\n /** ISO 3166-1 alpha-2 */\n country?: string;\n}\n\nexport interface EnrollConfirmRequest {\n token: string;\n /** Only after a 409 `identification_required`: what the account still lacks — a fiscal code, or date, place and country of birth. Completes the EMPTY fields of the profile, never over what is there */\n identification?: {\n dob?: string;\n birthplace?: string;\n birth_country?: string;\n codicefiscale?: string;\n codicefiscale_confirmed?: boolean;\n };\n}\n\nexport interface Event {\n id?: string;\n slug?: string;\n /** The language the `title` was served in. When it is not the one you asked for, the association has no translation: you got its Italian text, not a machine translation */\n locale?: string;\n /** The languages in which this event has a title — the association’s own always, plus those it enabled and wrote */\n locales?: Array<string>;\n title?: string;\n summary?: string | null;\n /** Markdown; render it yourself */\n description_md?: string | null;\n starts_at?: string;\n ends_at?: string | null;\n timezone?: string;\n status?: \"published\" | \"completed\" | \"cancelled\";\n visibility?: \"members_only\" | \"public\";\n location?: {\n name?: string | null;\n address?: string | null;\n lat?: number | null;\n lng?: number | null;\n } | null;\n cover_url?: string | null;\n gallery?: Array<{\n url?: string;\n alt?: string | null;\n order?: number;\n }>;\n links?: Array<{\n label?: string;\n url?: string;\n }>;\n registration?: {\n opens_at?: string | null;\n closes_at?: string | null;\n capacity?: number | null;\n remaining?: number | null;\n cancellation_hours?: number;\n };\n registration_types?: Array<{\n uid?: string;\n cod?: string;\n name?: string;\n description?: string | null;\n /** 0 = free */\n amount?: number;\n currency?: string;\n quantity?: number | null;\n /** Places left (never who holds them) */\n remaining?: number | null;\n max_per_user?: number;\n requires_active_membership?: boolean;\n open?: boolean;\n reason?: \"sold_out\" | \"registration_not_open\" | \"registration_closed\" | null | null;\n opens_at?: string | null;\n closes_at?: string | null;\n }>;\n published_at?: string | null;\n cancelled_at?: string | null;\n cancel_reason?: string | null;\n}\n\nexport interface Registration {\n id?: string;\n status?: \"reserved\" | \"confirmed\" | \"cancelled\" | \"refunded\";\n event?: {\n id?: string;\n slug?: string;\n title?: string;\n starts_at?: string;\n ends_at?: string | null;\n timezone?: string;\n status?: string;\n location?: string | null;\n };\n registration_type?: {\n uid?: string;\n cod?: string;\n name?: string;\n amount?: number;\n currency?: string;\n };\n quantity?: number;\n reserved_until?: string | null;\n checked_in_at?: string | null;\n cancelled_at?: string | null;\n cancel_reason?: string | null;\n can_cancel?: boolean;\n payment?: {\n status?: string;\n amount?: number;\n currency?: string;\n method?: string;\n paid_at?: string;\n } | null;\n /** How to pay the contribution while reserved */\n payment_instructions?: string | null;\n /** Free text the person wrote. Withheld (null) from third-party clients when the association declared it processes special categories of data */\n note?: string | null;\n created_at?: string;\n /** The registration QR payload (vmt_…), confirmed registrations only */\n token?: string | null;\n}\n\nexport interface Eligibility {\n can_register?: boolean;\n membership_verdict?: string | null;\n types?: Array<{\n uid?: string;\n cod?: string;\n can_register?: boolean;\n reasons?: Array<string>;\n pending_membership?: boolean;\n }>;\n}\n\nexport interface RegistrationRequest {\n registration_type: string;\n note?: string | null;\n quantity?: number;\n /** The language the registration was made in (`it`, `en`): the language of the mails to a guest, and the fallback for a member who never chose one. Defaults to Accept-Language */\n locale?: string | null;\n}\n\nexport interface GuestRegistrationRequest {\n email: string;\n first_name: string;\n last_name: string;\n registration_type: string;\n note?: string | null;\n /** The language the registration was made in (`it`, `en`): the language of the mails to a guest, and the fallback for a member who never chose one. Defaults to Accept-Language */\n locale?: string | null;\n}\n\nexport interface RegistrationListItem {\n id?: string;\n status?: string;\n registration_type?: string | null;\n membership_id?: string | null;\n quantity?: number;\n checked_in_at?: string | null;\n created_at?: string;\n}\n\nexport interface LegalDocumentSummary {\n uid?: string;\n /** Document kind (platform_terms, platform_privacy, platform_cookie, aps_terms, aps_dpa, aps_dpa_annex1_processing … developer_terms) */\n kind: string;\n locale: \"it\" | \"en\";\n /** Version label (1.0, 1.1, …) */\n version: string;\n title: string;\n /** What changed in this version */\n summary?: string | null;\n effective_from?: string | null;\n retired_at?: string | null;\n /** SHA-256 of the canonical template body */\n sha256?: string | null;\n /** This is the in-force version of the kind in its locale */\n current: boolean;\n requires_reacceptance?: boolean;\n}\n\nexport interface LegalDocumentList {\n documents: Array<LegalDocumentSummary>;\n /** Previous versions (with ?all=1) */\n archive?: Array<LegalDocumentSummary>;\n}\n\nexport type LegalDocument = unknown;\n\nexport interface SubProcessor {\n cod: string;\n name: string;\n entity?: string | null;\n service: string;\n data_categories?: string | null;\n location?: string | null;\n transfer_basis?: string | null;\n role: \"processor\" | \"controller\" | \"none\";\n status: \"active\" | \"planned\" | \"retired\";\n since?: string | null;\n until?: string | null;\n website?: string | null;\n}\n\nexport interface SubProcessorRegistry {\n /** The in-force Annex 3 version the registry is bound to */\n version?: string | null;\n effective_from?: string | null;\n notice_days?: number;\n at?: string;\n active: Array<SubProcessor>;\n planned: Array<SubProcessor>;\n /** Vendors that process no tenant data (transparency) */\n other: Array<SubProcessor>;\n}\n\nexport interface PrivacyNoticeRef {\n uid: string;\n version: number;\n locale: string;\n title?: string;\n sha256?: string | null;\n effective_from?: string | null;\n}\n\nexport type PrivacyNotice = unknown;\n\nexport interface LegalRef {\n /** The in-force version label shown (GET /v1/legal/{kind}) */\n version: string;\n /** Its template hash, when published */\n sha256?: string;\n}\n\nexport interface PrivacyNoticeAck {\n /** The in-force notice version shown (GET /v1/aps/{slug} → privacy_notice) */\n version: number;\n sha256?: string;\n /** The language of the notice you showed (`privacy_notice.locale` of the answer you read it from). Each language is its own document, with its own version: name it when you read the profile with `?locale=`. Default: the request’s `locale`, then the association’s language */\n locale?: string;\n}\n\nexport interface AcceptanceRecord {\n at: string;\n action: \"accepted\" | \"acknowledged\" | \"consented\" | \"withdrawn\" | \"declared\";\n channel?: \"ui\" | \"public\" | \"api\" | \"job\" | \"paper\";\n kind: string;\n title?: string;\n version: string;\n sha256?: string | null;\n /** Hash of the text actually shown */\n rendered_sha256?: string | null;\n locale?: string | null;\n /** The association the act concerns, when any */\n association?: string | null;\n}\n\nexport interface PendingDocument {\n kind: string;\n title?: string;\n locale?: string;\n version: string | number;\n sha256?: string | null;\n effective_from?: string | null;\n /** What the person is asked to do */\n action: \"accepted\" | \"acknowledged\" | \"consented\";\n /** Never acted on any version of this kind (false: a new version requires it again) */\n first?: boolean;\n}\n\nexport interface MyAcceptances {\n items: Array<AcceptanceRecord>;\n pending: {\n /** Account-layer documents still to accept / acknowledge */\n platform?: Array<PendingDocument>;\n /** This association's notice to members, when not yet acknowledged */\n privacy_notice?: PendingDocument | unknown;\n };\n}\n\nexport interface AcceptanceRequest {\n /** platform_terms | platform_privacy | network_consent | privacy_notice */\n kind: string;\n /** The in-force version shown */\n version: string | number;\n sha256?: string;\n}\n\nexport interface AcceptanceResult {\n recorded: boolean;\n kind: string;\n action: string;\n version: string;\n at: string;\n}\n\nexport interface EnrollConfirmResult {\n status: \"pending\" | \"active\" | \"suspended\" | \"revoked\" | \"rejected\";\n /** The person already had a membership request or membership here */\n already: boolean;\n /** Why the membership is still pending, in order: the association’s approval first (when it admits by decision of its board), then the fee. Empty when active */\n pending_reasons?: Array<\"approval\" | \"payment\">;\n /** May the fee be paid yet? False while the approval is pending: approval opens payment */\n payment_open?: boolean;\n /** When the card becomes usable, for an active membership inside the association’s usability delay; null otherwise */\n valid_from?: string | null;\n association: {\n name?: string;\n slug?: string;\n };\n}\n\n/** Every operation of the document: id → [method, path]. */\nexport const operations = {\n getOpenApi: ['GET', '/v1/openapi.json'],\n getCardKeys: ['GET', '/v1/card-keys'],\n getApsPublicConfig: ['GET', '/v1/aps/{slug}'],\n verifyCard: ['GET', '/v1/verify/{card_token}'],\n validateFiscalCode: ['POST', '/v1/validate/fiscal-code'],\n oauthToken: ['POST', '/v1/oauth/token'],\n oauthRevoke: ['POST', '/v1/oauth/revoke'],\n oauthClientInfo: ['GET', '/v1/oauth/client-info'],\n getMe: ['GET', '/v1/me'],\n closeMe: ['DELETE', '/v1/me'],\n updateMe: ['PATCH', '/v1/me'],\n exportMe: ['GET', '/v1/me/export'],\n getMyMembership: ['GET', '/v1/me/membership'],\n requestMyMembership: ['POST', '/v1/me/membership'],\n renewMyMembership: ['POST', '/v1/me/membership/renew'],\n setNetworkOptIn: ['PATCH', '/v1/me/membership/network-opt-in'],\n getMyCardImage: ['GET', '/v1/me/membership/card.svg'],\n emailMyCard: ['POST', '/v1/me/membership/card/email'],\n getGoogleWalletLink: ['GET', '/v1/me/membership/wallet/google'],\n getMyMembershipEvents: ['GET', '/v1/me/membership/events'],\n getMyStatuto: ['GET', '/v1/me/membership/statuto'],\n acceptMyStatuto: ['POST', '/v1/me/membership/statuto/accept'],\n getMyAcceptances: ['GET', '/v1/me/acceptances'],\n recordMyAcceptance: ['POST', '/v1/me/acceptances'],\n getMyCard: ['GET', '/v1/me/membership/card'],\n getMyConnections: ['GET', '/v1/me/connections'],\n revokeMyConnection: ['DELETE', '/v1/me/connections/{client_id}'],\n listMemberships: ['GET', '/v1/memberships'],\n getMembershipStatus: ['GET', '/v1/memberships/{id}/status'],\n getSandbox: ['GET', '/v1/sandbox'],\n resetSandbox: ['POST', '/v1/sandbox/reset'],\n signup: ['POST', '/v1/signup'],\n enroll: ['POST', '/v1/enroll'],\n confirmEnrollment: ['POST', '/v1/enroll/confirm'],\n createCheckin: ['POST', '/v1/checkins'],\n listPublicEvents: ['GET', '/v1/aps/{slug}/events'],\n getPublicEvent: ['GET', '/v1/aps/{slug}/events/{event}'],\n listEvents: ['GET', '/v1/events'],\n getEvent: ['GET', '/v1/events/{slug}'],\n getEventEligibility: ['GET', '/v1/events/{slug}/eligibility'],\n createRegistration: ['POST', '/v1/events/{slug}/registrations'],\n listEventRegistrations: ['GET', '/v1/events/{slug}/registrations'],\n listMyRegistrations: ['GET', '/v1/me/registrations'],\n getMyRegistration: ['GET', '/v1/me/registrations/{id}'],\n cancelMyRegistration: ['DELETE', '/v1/me/registrations/{id}'],\n createGuestRegistration: ['POST', '/v1/events/{slug}/registrations/guest'],\n confirmGuestRegistration: ['POST', '/v1/registrations/confirm'],\n listLegalDocuments: ['GET', '/v1/legal'],\n getSubProcessors: ['GET', '/v1/legal/sub-processors'],\n getLegalDocument: ['GET', '/v1/legal/{kind}'],\n getApsPrivacyNotice: ['GET', '/v1/aps/{slug}/privacy-notice'],\n} as const;\nexport type OperationId = keyof typeof operations;\n"]}
1
+ {"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,kDAAkD;AAilBlD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACvC,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC;IACrC,kBAAkB,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAC7C,UAAU,EAAE,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC9C,kBAAkB,EAAE,CAAC,MAAM,EAAE,0BAA0B,CAAC;IACxD,UAAU,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACvC,WAAW,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACzC,eAAe,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC;IACjD,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,C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AAE,YAAY,CAAC;IAC9B,iBAAiB,EAAE,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACjD,aAAa,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IACvC,gBAAgB,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC;IAClD,cAAc,EAAE,CAAC,KAAK,EAAE,+BAA+B,CAAC;IACxD,UAAU,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC;IACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,+BAA+B,CAAC;IAC7D,kBAAkB,EAAE,CAAC,MAAM,EAAE,iCAAiC,CAAC;IAC/D,sBAAsB,EAAE,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClE,mBAAmB,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACpD,iBAAiB,EAAE,CAAC,KAAK,EAAE,2BAA2B,CAAC;IACvD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,2BAA2B,CAAC;IAC7D,uBAAuB,EAAE,CAAC,MAAM,EAAE,uCAAuC,CAAC;IAC1E,wBAAwB,EAAE,CAAC,MAAM,EAAE,2BAA2B,CAAC;IAC/D,qBAAqB,EAAE,CAAC,MAAM,EAAE,wBAAwB,CAAC;IACzD,kBAAkB,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;IACxC,gBAAgB,EAAE,CAAC,KAAK,EAAE,0BAA0B,CAAC;IACrD,gBAAgB,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC;IAC7C,mBAAmB,EAAE,CAAC,KAAK,EAAE,+BAA+B,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,wBAAwB,CAAC;CAC1C,CAAC","sourcesContent":["// GENERATED by scripts/gen-types.mjs from openapi/v1.json — do not edit. Regenerate: npm run spec:types\n// Spec version 2026-10-18 · 47 paths · 36 schemas\n\nexport interface Problem {\n type: string;\n title: string;\n status: number;\n detail?: string;\n code: string;\n request_id?: string;\n errors?: Array<{\n field?: string;\n code?: string;\n message?: string;\n }>;\n}\n\nexport interface Verification {\n status: \"active\" | \"inactive\";\n valid_until?: string;\n /** With `reason: not_yet_valid`: the card is genuine and active, and becomes usable at this moment */\n valid_from?: string;\n reason?: \"expired\" | \"invalid\" | \"not_yet_valid\";\n /** Present for registration tokens */\n kind?: \"card\" | \"registration\";\n event?: {\n slug?: string;\n starts_at?: string;\n } | null;\n}\n\nexport interface MembershipType {\n uid?: string;\n cod?: string;\n name?: string;\n description?: string | null;\n quota_amount?: number | null;\n currency?: string;\n expiry_model?: \"solar_year\" | \"rolling_12\" | \"rolling_24\" | \"prorated_solar\" | \"custom\";\n network_eligible?: boolean;\n}\n\nexport interface Statuto {\n aps?: {\n slug?: string;\n name?: string;\n };\n title: string;\n version: number;\n approved_on?: string | null;\n /** Of the uploaded document, when there is one */\n sha256?: string | null;\n /** The text as registered; empty when only a document was uploaded */\n content_md?: string;\n content_html: string;\n /** The uploaded document, a link valid for 15 minutes */\n document_url?: string | null;\n}\n\nexport interface ApsPublicConfig {\n /** The language this answer is written in */\n locale?: string;\n /** The languages the association offers: its own, plus those it enabled */\n locales?: Array<string>;\n aps: {\n slug?: string;\n name?: string;\n picture_url?: string | null;\n citta?: string | null;\n provincia?: string | null;\n enroll_enabled?: boolean;\n /** Whether a membership request would be taken now: enrolment on, a member more fits the plan, the association ready to collect requests, and its public door open. */\n accepting_requests?: boolean;\n /** True while Vimine registers people by invitation only (the private beta) and this association takes only the people it invited: `accepting_requests` is then false, and `POST /v1/enroll` answers 403 `not_available`. */\n invitation_only?: boolean;\n /** True for a sandbox: the test copy of an association that test clients work on, with synthetic members only. It never sends e-mail, takes no payments and is never in the Network. */\n sandbox?: boolean;\n /** How the association admits its members, so that an applicant can be told up front what to expect. `model`: `board` — the request waits for a decision of the association’s board, and any fee is paid after it; `provisional` — admitted at once, ratified by the board later; `automatic` — active as soon as the conditions are met. `delay_hours`: the hours between admission and a USABLE card (0 = at once): the membership is active from admission, the card counts at the door only afterwards (see `valid_from`). */\n admission?: {\n model?: \"board\" | \"provisional\" | \"automatic\";\n delay_hours?: number;\n };\n /** Kept for compatibility: true when `admission.model` is `board`. Read `admission` instead. */\n approval_required?: boolean;\n /** Whether the association collects its members’ address — of every member or of nobody. `none`: do not ask (an `address` sent anyway is not stored); `optional`; `required`: enrolment answers 422 without one. */\n member_address?: \"none\" | \"optional\" | \"required\";\n /** How to pay the fee, as the association words it */\n payment_instructions?: string | null;\n /** The activities of general interest the association carries out (Italian Third Sector Code, art. 5): `cod` is the letter of the article, `description` its Italian wording; one is marked as prevalent. */\n activity_sectors?: Array<{\n cod?: string;\n description?: string;\n prevalent?: boolean;\n }>;\n /** Present when the association is registered in the RUNTS (the Italian national register of Third Sector entities), as checked by the platform against the official public lists; null otherwise. Never typed by the association. */\n registry?: {\n /** Section of the register */\n section?: \"APS\" | \"ODV\" | \"EF\" | \"IS\" | \"RA\" | \"SOMS\" | \"ALTRI\" | null | null;\n /** Repertory number */\n number?: string | null;\n registered_on?: string | null;\n /** Date of the official list the check ran against */\n checked_on?: string | null;\n } | null;\n };\n membership_types: Array<MembershipType>;\n statuto: Statuto | unknown;\n /** The association's in-force privacy notice to members (full text: GET /v1/aps/{slug}/privacy-notice) */\n privacy_notice?: PrivacyNoticeRef | unknown;\n}\n\nexport interface FiscalCodeCheck {\n /** Codice fiscale (16 characters) */\n code: string;\n first_name?: string;\n last_name?: string;\n gender?: \"M\" | \"F\";\n /** Date of birth */\n date?: string;\n /** Birthplace: the comune, for a person born in Italy */\n place?: string;\n /** Birth country, ISO 3166-1 alpha-2. A code encodes the comune for people born in Italy and only the STATE for everybody else: anything but IT is compared with that state and `place` is ignored */\n country?: string;\n}\n\nexport interface FiscalCodeResult {\n valid?: boolean;\n error?: \"invalid\" | \"mismatch\" | null;\n /** What disagrees with the code, when `error` is `mismatch` */\n mismatches?: Array<\"lastName\" | \"firstName\" | \"gender\" | \"date\" | \"place\">;\n /** `names_swapped`: the code matches once surname and given name are exchanged */\n hints?: Array<\"names_swapped\">;\n /** The date of birth the code itself encodes */\n birth_date?: string | null;\n /** The birth country the code itself encodes, ISO 3166-1 alpha-2 (IT for a comune) */\n birth_country?: string | null;\n}\n\nexport interface CardKeys {\n keys?: Array<{\n kty?: string;\n crv?: string;\n x?: string;\n kid?: string;\n use?: string;\n alg?: string;\n }>;\n}\n\nexport interface SignupRequest {\n email: string;\n first_name: string;\n last_name: string;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only: it is not cross-checked */\n gender?: \"M\" | \"F\" | null;\n /** Comune (born in Italy) or city, free text (born abroad) */\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** Validated and cross-checked against the other fields when present */\n codicefiscale?: string | null;\n /** The person confirms a code that disagrees with their particulars (422 `codicefiscale_mismatch` with `confirmable: true`) */\n codicefiscale_confirmed?: boolean;\n /** The language of the page the person filled in (`it`, `en`; a regional tag such as `en-GB` is reduced to its language). It decides the language of the mails that follow and becomes the preference of a NEW account; an existing account keeps its own. Unsupported values are ignored */\n locale?: string | null;\n /** The account terms (platform_terms) the person accepted on your site — optional, but when given it must name the in-force version */\n accept_terms?: LegalRef;\n /** The platform privacy notice (platform_privacy) the person read on your site — optional, same rule */\n acknowledge_privacy?: LegalRef;\n}\n\nexport interface EnrollRequest {\n email: string;\n first_name: string;\n last_name: string;\n /** Optional. A person is identified by a fiscal code OR by `dob` + `birthplace` + `birth_country` — never neither (422 `required` on each missing particular). When present it is validated and cross-checked against the names, the date and the place (the state, for people born abroad) */\n codicefiscale?: string | null;\n /** The person confirms a code that disagrees with their particulars (422 `codicefiscale_mismatch` with `confirmable: true`) */\n codicefiscale_confirmed?: boolean;\n /** Who holds parental responsibility for a minor (under 18 by `dob`). REQUIRED for a minor where the association declared it collects the block (`aps.collects_guardian_data`): 422 `required` on `guardian` otherwise; stored only where it declared so */\n guardian?: Guardian;\n /** Residence or, where different, domicile. Asked of every member or of nobody: the public profile says what the association declared (`member_address`: none — ignored, not stored · optional · required — 422 `required` on `address` without it) */\n address?: MemberAddress;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only: it is not cross-checked */\n gender?: \"M\" | \"F\" | null;\n /** Comune (born in Italy) or city, free text (born abroad) */\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** One of the association’s membership types (omit when it has exactly one) */\n membership_type?: string;\n /** The language of the page the person filled in (`it`, `en`; a regional tag such as `en-GB` is reduced to its language). It decides the language of the mails that follow and becomes the preference of a NEW account; an existing account keeps its own. Unsupported values are ignored */\n locale?: string | null;\n /** The in-force statuto the person accepted on your site (from GET /v1/aps/{slug}) */\n accept_statuto: {\n version: number;\n sha256?: string;\n };\n /** The association's privacy notice the person read on your site (GET /v1/aps/{slug} → privacy_notice). REQUIRED when the association publishes one; 422 `privacy_notice_outdated` when it is not the in-force version */\n privacy_notice?: PrivacyNoticeAck;\n /** The account terms (platform_terms) the person accepted on your site — optional, must name the in-force version */\n accept_terms?: LegalRef;\n /** The platform privacy notice (platform_privacy) the person read — optional, same rule */\n acknowledge_privacy?: LegalRef;\n}\n\nexport interface Accepted {\n status: \"accepted\";\n}\n\nexport interface Me {\n /** The subject identifier of this person, as in the ID token */\n sub: string;\n email: string;\n email_verified: boolean;\n first_name?: string | null;\n last_name?: string | null;\n phone?: string | null;\n dob?: string | null;\n /** Demographic only */\n gender?: \"M\" | \"F\" | null;\n birthplace?: string | null;\n /** ISO 3166-1 alpha-2 */\n birth_country?: string | null;\n /** Optional: a person may have none */\n codicefiscale?: string | null;\n /** How the person is identified. `matched`: a fiscal code that agrees with their particulars; `mismatch_confirmed`: a code that disagrees, confirmed by the person; `absent`: no code — date, place and country of birth identify them; null: not identified yet (they cannot request a membership) */\n codicefiscale_check?: \"matched\" | \"mismatch_confirmed\" | \"absent\" | null;\n /** The language the person chose for the platform and its mails; null: never chosen — the language of the request, then of the association, applies */\n locale?: \"it\" | \"en\" | null;\n updated_at?: string | null;\n}\n\nexport interface Guardian {\n first_name: string;\n last_name: string;\n /** Parent, guardian… as the association records it */\n relation: string;\n /** Optional; refused when malformed */\n codicefiscale?: string | null;\n email?: string | null;\n phone?: string | null;\n}\n\nexport interface MemberAddress {\n kind?: \"residence\" | \"domicile\";\n /** Street and number */\n line: string;\n postal_code?: string | null;\n city: string;\n /** Italian addresses only (two letters); dropped abroad */\n province?: string | null;\n /** ISO 3166-1 alpha-2 */\n country?: string;\n}\n\nexport interface EnrollConfirmRequest {\n token: string;\n /** Only after a 409 `identification_required`: what the account still lacks — a fiscal code, or date, place and country of birth. Completes the EMPTY fields of the profile, never over what is there */\n identification?: {\n dob?: string;\n birthplace?: string;\n birth_country?: string;\n codicefiscale?: string;\n codicefiscale_confirmed?: boolean;\n };\n /** Only after a 409 `address_required`: the association asks every member for an address (`member_address: required` on its public profile). Optional where it declared `optional`; ignored where it collects none */\n address?: MemberAddress;\n}\n\nexport interface Event {\n id?: string;\n slug?: string;\n /** The language the `title` was served in. When it is not the one you asked for, the association has no translation: you got its Italian text, not a machine translation */\n locale?: string;\n /** The languages in which this event has a title — the association’s own always, plus those it enabled and wrote */\n locales?: Array<string>;\n title?: string;\n summary?: string | null;\n /** Markdown; render it yourself */\n description_md?: string | null;\n starts_at?: string;\n ends_at?: string | null;\n timezone?: string;\n status?: \"published\" | \"completed\" | \"cancelled\";\n visibility?: \"members_only\" | \"public\";\n location?: {\n name?: string | null;\n address?: string | null;\n lat?: number | null;\n lng?: number | null;\n } | null;\n cover_url?: string | null;\n gallery?: Array<{\n url?: string;\n alt?: string | null;\n order?: number;\n }>;\n links?: Array<{\n label?: string;\n url?: string;\n }>;\n registration?: {\n opens_at?: string | null;\n closes_at?: string | null;\n capacity?: number | null;\n remaining?: number | null;\n cancellation_hours?: number;\n };\n registration_types?: Array<{\n uid?: string;\n cod?: string;\n name?: string;\n description?: string | null;\n /** 0 = free */\n amount?: number;\n currency?: string;\n quantity?: number | null;\n /** Places left (never who holds them) */\n remaining?: number | null;\n max_per_user?: number;\n requires_active_membership?: boolean;\n open?: boolean;\n reason?: \"sold_out\" | \"registration_not_open\" | \"registration_closed\" | null | null;\n opens_at?: string | null;\n closes_at?: string | null;\n }>;\n published_at?: string | null;\n cancelled_at?: string | null;\n cancel_reason?: string | null;\n}\n\nexport interface Registration {\n id?: string;\n status?: \"reserved\" | \"confirmed\" | \"cancelled\" | \"refunded\";\n event?: {\n id?: string;\n slug?: string;\n title?: string;\n starts_at?: string;\n ends_at?: string | null;\n timezone?: string;\n status?: string;\n location?: string | null;\n };\n registration_type?: {\n uid?: string;\n cod?: string;\n name?: string;\n amount?: number;\n currency?: string;\n };\n quantity?: number;\n reserved_until?: string | null;\n checked_in_at?: string | null;\n cancelled_at?: string | null;\n cancel_reason?: string | null;\n can_cancel?: boolean;\n payment?: {\n status?: string;\n amount?: number;\n currency?: string;\n method?: string;\n paid_at?: string;\n } | null;\n /** How to pay the contribution while reserved */\n payment_instructions?: string | null;\n /** Free text the person wrote. Withheld (null) from third-party clients when the association declared it processes special categories of data */\n note?: string | null;\n created_at?: string;\n /** The registration QR payload (vmt_…), confirmed registrations only */\n token?: string | null;\n}\n\nexport interface Eligibility {\n can_register?: boolean;\n membership_verdict?: string | null;\n types?: Array<{\n uid?: string;\n cod?: string;\n can_register?: boolean;\n reasons?: Array<string>;\n pending_membership?: boolean;\n }>;\n}\n\nexport interface RegistrationRequest {\n registration_type: string;\n note?: string | null;\n quantity?: number;\n /** The language the registration was made in (`it`, `en`): the language of the mails to a guest, and the fallback for a member who never chose one. Defaults to Accept-Language */\n locale?: string | null;\n}\n\nexport interface GuestRegistrationRequest {\n email: string;\n first_name: string;\n last_name: string;\n registration_type: string;\n note?: string | null;\n /** The language the registration was made in (`it`, `en`): the language of the mails to a guest, and the fallback for a member who never chose one. Defaults to Accept-Language */\n locale?: string | null;\n}\n\nexport interface RegistrationListItem {\n id?: string;\n status?: string;\n registration_type?: string | null;\n membership_id?: string | null;\n quantity?: number;\n checked_in_at?: string | null;\n created_at?: string;\n}\n\nexport interface LegalDocumentSummary {\n uid?: string;\n /** Document kind (platform_terms, platform_privacy, platform_cookie, aps_terms, aps_dpa, aps_dpa_annex1_processing … developer_terms) */\n kind: string;\n locale: \"it\" | \"en\";\n /** Version label (1.0, 1.1, …) */\n version: string;\n title: string;\n /** What changed in this version */\n summary?: string | null;\n effective_from?: string | null;\n retired_at?: string | null;\n /** SHA-256 of the canonical template body */\n sha256?: string | null;\n /** This is the in-force version of the kind in its locale */\n current: boolean;\n requires_reacceptance?: boolean;\n}\n\nexport interface LegalDocumentList {\n documents: Array<LegalDocumentSummary>;\n /** Previous versions (with ?all=1) */\n archive?: Array<LegalDocumentSummary>;\n}\n\nexport type LegalDocument = unknown;\n\nexport interface SubProcessor {\n cod: string;\n name: string;\n entity?: string | null;\n service: string;\n data_categories?: string | null;\n location?: string | null;\n transfer_basis?: string | null;\n role: \"processor\" | \"controller\" | \"none\";\n status: \"active\" | \"planned\" | \"retired\";\n since?: string | null;\n until?: string | null;\n website?: string | null;\n}\n\nexport interface SubProcessorRegistry {\n /** The in-force Annex 3 version the registry is bound to */\n version?: string | null;\n effective_from?: string | null;\n notice_days?: number;\n at?: string;\n active: Array<SubProcessor>;\n planned: Array<SubProcessor>;\n /** Vendors that process no tenant data (transparency) */\n other: Array<SubProcessor>;\n}\n\nexport interface PrivacyNoticeRef {\n uid: string;\n version: number;\n locale: string;\n title?: string;\n sha256?: string | null;\n effective_from?: string | null;\n}\n\nexport type PrivacyNotice = unknown;\n\nexport interface LegalRef {\n /** The in-force version label shown (GET /v1/legal/{kind}) */\n version: string;\n /** Its template hash, when published */\n sha256?: string;\n}\n\nexport interface PrivacyNoticeAck {\n /** The in-force notice version shown (GET /v1/aps/{slug} → privacy_notice) */\n version: number;\n sha256?: string;\n /** The language of the notice you showed (`privacy_notice.locale` of the answer you read it from). Each language is its own document, with its own version: name it when you read the profile with `?locale=`. Default: the request’s `locale`, then the association’s language */\n locale?: string;\n}\n\nexport interface AcceptanceRecord {\n at: string;\n action: \"accepted\" | \"acknowledged\" | \"consented\" | \"withdrawn\" | \"declared\";\n channel?: \"ui\" | \"public\" | \"api\" | \"job\" | \"paper\";\n kind: string;\n title?: string;\n version: string;\n sha256?: string | null;\n /** Hash of the text actually shown */\n rendered_sha256?: string | null;\n locale?: string | null;\n /** The association the act concerns, when any */\n association?: string | null;\n}\n\nexport interface PendingDocument {\n kind: string;\n title?: string;\n locale?: string;\n version: string | number;\n sha256?: string | null;\n effective_from?: string | null;\n /** What the person is asked to do */\n action: \"accepted\" | \"acknowledged\" | \"consented\";\n /** Never acted on any version of this kind (false: a new version requires it again) */\n first?: boolean;\n}\n\nexport interface MyAcceptances {\n items: Array<AcceptanceRecord>;\n pending: {\n /** Account-layer documents still to accept / acknowledge */\n platform?: Array<PendingDocument>;\n /** This association's notice to members, when not yet acknowledged */\n privacy_notice?: PendingDocument | unknown;\n };\n}\n\nexport interface AcceptanceRequest {\n /** platform_terms | platform_privacy | network_consent | privacy_notice */\n kind: string;\n /** The in-force version shown */\n version: string | number;\n sha256?: string;\n}\n\nexport interface AcceptanceResult {\n recorded: boolean;\n kind: string;\n action: string;\n version: string;\n at: string;\n}\n\nexport interface EnrollConfirmResult {\n status: \"pending\" | \"active\" | \"suspended\" | \"revoked\" | \"rejected\";\n /** The person already had a membership request or membership here */\n already: boolean;\n /** Why the membership is still pending, in order: the association’s approval first (when it admits by decision of its board), then the fee. Empty when active */\n pending_reasons?: Array<\"approval\" | \"payment\">;\n /** May the fee be paid yet? False while the approval is pending: approval opens payment */\n payment_open?: boolean;\n /** When the card becomes usable, for an active membership inside the association’s usability delay; null otherwise */\n valid_from?: string | null;\n association: {\n name?: string;\n slug?: string;\n };\n /** Only for a link sent by the association’s hosted enrolment page when that page was opened from one of its public events: what became of the place the person asked for together with the request. `null` for every other link */\n event?: {\n slug?: string;\n title?: string;\n starts_at?: string;\n timezone?: string;\n place?: string | null;\n registration_type?: {\n uid?: string;\n name?: string;\n /** 0 = free */\n amount?: number;\n currency?: string;\n };\n /** `confirmed`: the place is theirs. `reserved`: held, see `waiting`. `held`: the membership request itself still waits for the address to be confirmed, and no place was asked for. `unavailable`: no place, see `reasons` */\n state?: \"confirmed\" | \"reserved\" | \"held\" | \"unavailable\";\n /** What a `reserved` place waits for: the membership to become active (it is then confirmed by itself when free), the contribution, or both */\n waiting?: Array<\"membership\" | \"contribution\">;\n /** Why the place is `unavailable`: the reasons of `GET /v1/events/{slug}/eligibility` */\n reasons?: Array<string>;\n reserved_until?: string | null;\n /** How to pay a contribution that is owed, in the association’s words */\n payment_instructions?: string | null;\n /** The person held this place before the link was used */\n already?: boolean;\n } | null;\n}\n\n/** Every operation of the document: id → [method, path]. */\nexport const operations = {\n getOpenApi: ['GET', '/v1/openapi.json'],\n getCardKeys: ['GET', '/v1/card-keys'],\n getApsPublicConfig: ['GET', '/v1/aps/{slug}'],\n verifyCard: ['GET', '/v1/verify/{card_token}'],\n validateFiscalCode: ['POST', '/v1/validate/fiscal-code'],\n oauthToken: ['POST', '/v1/oauth/token'],\n oauthRevoke: ['POST', '/v1/oauth/revoke'],\n oauthClientInfo: ['GET', '/v1/oauth/client-info'],\n getMe: ['GET', '/v1/me'],\n closeMe: ['DELETE', '/v1/me'],\n updateMe: ['PATCH', '/v1/me'],\n exportMe: ['GET', '/v1/me/export'],\n getMyMembership: ['GET', '/v1/me/membership'],\n requestMyMembership: ['POST', '/v1/me/membership'],\n renewMyMembership: ['POST', '/v1/me/membership/renew'],\n setNetworkOptIn: ['PATCH', '/v1/me/membership/network-opt-in'],\n getMyCardImage: ['GET', '/v1/me/membership/card.svg'],\n emailMyCard: ['POST', '/v1/me/membership/card/email'],\n getGoogleWalletLink: ['GET', '/v1/me/membership/wallet/google'],\n getMyMembershipEvents: ['GET', '/v1/me/membership/events'],\n getMyStatuto: ['GET', '/v1/me/membership/statuto'],\n acceptMyStatuto: ['POST', '/v1/me/membership/statuto/accept'],\n getMyAcceptances: ['GET', '/v1/me/acceptances'],\n recordMyAcceptance: ['POST', '/v1/me/acceptances'],\n getMyCard: ['GET', '/v1/me/membership/card'],\n getMyConnections: ['GET', '/v1/me/connections'],\n revokeMyConnection: ['DELETE', '/v1/me/connections/{client_id}'],\n listMemberships: ['GET', '/v1/memberships'],\n getMembershipStatus: ['GET', '/v1/memberships/{id}/status'],\n getSandbox: ['GET', '/v1/sandbox'],\n resetSandbox: ['POST', '/v1/sandbox/reset'],\n signup: ['POST', '/v1/signup'],\n enroll: ['POST', '/v1/enroll'],\n confirmEnrollment: ['POST', '/v1/enroll/confirm'],\n createCheckin: ['POST', '/v1/checkins'],\n listPublicEvents: ['GET', '/v1/aps/{slug}/events'],\n getPublicEvent: ['GET', '/v1/aps/{slug}/events/{event}'],\n listEvents: ['GET', '/v1/events'],\n getEvent: ['GET', '/v1/events/{slug}'],\n getEventEligibility: ['GET', '/v1/events/{slug}/eligibility'],\n createRegistration: ['POST', '/v1/events/{slug}/registrations'],\n listEventRegistrations: ['GET', '/v1/events/{slug}/registrations'],\n listMyRegistrations: ['GET', '/v1/me/registrations'],\n getMyRegistration: ['GET', '/v1/me/registrations/{id}'],\n cancelMyRegistration: ['DELETE', '/v1/me/registrations/{id}'],\n createGuestRegistration: ['POST', '/v1/events/{slug}/registrations/guest'],\n confirmGuestRegistration: ['POST', '/v1/registrations/confirm'],\n viewGuestRegistration: ['POST', '/v1/registrations/view'],\n listLegalDocuments: ['GET', '/v1/legal'],\n getSubProcessors: ['GET', '/v1/legal/sub-processors'],\n getLegalDocument: ['GET', '/v1/legal/{kind}'],\n getApsPrivacyNotice: ['GET', '/v1/aps/{slug}/privacy-notice'],\n getApsStatuto: ['GET', '/v1/aps/{slug}/statuto'],\n} as const;\nexport type OperationId = keyof typeof operations;\n"]}
package/dist/public.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AssociationPublicConfig, CardKeys, EnrollConfirmResult, EnrollIdentification, Event, EventList, EventListParams, FiscalCodeCheck, FiscalCodeResult, LocaleParam, Registration, Verification } from './types.js';
1
+ import type { AssociationPublicConfig, CardKeys, EnrollConfirmResult, EnrollIdentification, Event, EventList, EventListParams, FiscalCodeCheck, FiscalCodeResult, LocaleParam, MemberAddress, Registration, Verification } from './types.js';
2
2
  export declare const DEFAULT_API_URL = "https://api.vimine.network";
3
3
  export interface PublicOptions {
4
4
  apiUrl?: string;
@@ -21,11 +21,14 @@ export interface PublicApi {
21
21
  /** Public keys (JWKS) that verify card tokens offline. Cache and re-fetch daily. */
22
22
  cardKeys(): Promise<CardKeys>;
23
23
  /**
24
- * Consume the token of a "confirm your membership request" link (sent when a system enrols an existing account).
24
+ * Consume the token of a "confirm your membership request" link (sent when a system enrols an existing account, or
25
+ * when the hosted form was sent with an address that already had one).
25
26
  * An account that is not identified yet answers 409 `identification_required` (`errors[]` = what is missing): ask
26
- * the person and call again with `identification` — it travels in the body, never in the link.
27
+ * the person and call again with `identification` — it travels in the body, never in the link. An association that
28
+ * asks every member for an address answers 409 `address_required`: call again with `address` (and with the
29
+ * `identification` already given, if any).
27
30
  */
28
- confirmEnrollment(token: string, identification?: EnrollIdentification): Promise<EnrollConfirmResult>;
31
+ confirmEnrollment(token: string, identification?: EnrollIdentification, address?: MemberAddress): Promise<EnrollConfirmResult>;
29
32
  /** An association's PUBLIC events (members-only ones need a member token: `Vimine.events`). */
30
33
  events: {
31
34
  list(slug: string, params?: EventListParams): Promise<EventList>;
@@ -33,6 +36,11 @@ export interface PublicApi {
33
36
  };
34
37
  /** Consume the token of a guest's "confirm your registration" link: the registration, with the QR `token` when confirmed. */
35
38
  confirmRegistration(token: string): Promise<Registration>;
39
+ /**
40
+ * Read the place named by a guest's own link (the mail that confirms the place): its status and, while it is
41
+ * confirmed, the QR `token`. Changes nothing; the link works until the event is over (`invalid_token` after).
42
+ */
43
+ viewRegistration(token: string): Promise<Registration>;
36
44
  }
37
45
  /** Query string of an events listing (shared by the public, browser and server clients). */
38
46
  export declare const eventQuery: (params?: EventListParams) => string;
package/dist/public.js CHANGED
@@ -48,12 +48,13 @@ export const publicApi = (options = {}) => {
48
48
  association: (slug, params = {}) => get(`/v1/aps/${encodeURIComponent(slug)}${localeQuery(params)}`),
49
49
  validateFiscalCode: (input) => post('/v1/validate/fiscal-code', input),
50
50
  cardKeys: () => get('/v1/card-keys'),
51
- confirmEnrollment: (token, identification) => post('/v1/enroll/confirm', identification ? { token, identification } : { token }),
51
+ confirmEnrollment: (token, identification, address) => post('/v1/enroll/confirm', { token, ...(identification ? { identification } : {}), ...(address ? { address } : {}) }),
52
52
  events: {
53
53
  list: (slug, params = {}) => get(`/v1/aps/${encodeURIComponent(slug)}/events${eventQuery(params)}`),
54
54
  get: (slug, event, params = {}) => get(`/v1/aps/${encodeURIComponent(slug)}/events/${encodeURIComponent(event)}${localeQuery(params)}`)
55
55
  },
56
- confirmRegistration: (token) => post('/v1/registrations/confirm', { token })
56
+ confirmRegistration: (token) => post('/v1/registrations/confirm', { token }),
57
+ viewRegistration: (token) => post('/v1/registrations/view', { token })
57
58
  };
58
59
  };
59
60
  //# sourceMappingURL=public.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.js","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,0GAA0G;AAC1G,oEAAoE;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,CAAC,MAAM,eAAe,GAAG,4BAA4B,CAAC;AAsC5D,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAA0B,EAAE,EAAU,EAAE;IAC/D,MAAM,CAAC,GAAG,IAAI,eAAe,EAAE,CAAC;IAChC,IAAI,MAAM,CAAC,MAAM;QAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,MAAM,CAAC,IAAI;QAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,MAAM,C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GAAG,CAA0B,WAAW,kBAAkB,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7H,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAmB,0BAA0B,EAAE,KAAK,CAAC;QACxF,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAW,eAAe,CAAC;QAC9C,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,IAAI,CAAsB,oBAAoB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACrJ,MAAM,EAAE;YACJ,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAY,WAAW,kBAAkB,CAAC,IAAI,CAAC,UAAU,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9G,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAQ,WAAW,kBAAkB,CAAC,IAAI,CAAC,WAAW,kBAAkB,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;SACjJ;QACD,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAe,2BAA2B,EAAE,EAAE,KAAK,EAAE,CAAC;KAC7F,CAAC;AACN,CAAC,CAAC","sourcesContent":["// The public surface of the API — no credentials, no sign-in: verify a card, read an association's public\n// profile (branding, membership types, in-force statuto), validate a codice fiscale, fetch the card-token\n// public keys. Usable from any page, from a scanner, from a server.\nimport { VimineError } from './errors.js';\nimport type { AssociationPublicConfig, CardKeys, EnrollConfirmResult, EnrollIdentification, Event, EventList, EventListParams, FiscalCodeCheck, FiscalCodeResult, LocaleParam, Registration, Verification } from './types.js';\n\nexport const DEFAULT_API_URL = 'https://api.vimine.network';\n\nexport interface PublicOptions {\n apiUrl?: string;\n fetch?: typeof fetch;\n}\n\nexport interface PublicApi {\n /** Is this card active right now? Privacy-preserving: status and validity end only. */\n verifyCard(cardToken: string): Promise<Verification>;\n /**\n * An association's public profile by its enrolment slug. `locale`: read its copy — the membership types, the payment\n * instructions, the privacy notice — in that language where the association wrote it; `locale` / `locales` of the\n * answer say what was served and what it offers.\n */\n association(slug: string, params?: LocaleParam): Promise<AssociationPublicConfig>;\n /**\n * Structure + check digit; with the personal data also their consistency with the code — and what the code itself\n * encodes (date and country of birth). For a person born abroad send `country`: their code encodes only the state.\n */\n validateFiscalCode(input: FiscalCodeCheck): Promise<FiscalCodeResult>;\n /** Public keys (JWKS) that verify card tokens offline. Cache and re-fetch daily. */\n cardKeys(): Promise<CardKeys>;\n /**\n * Consume the token of a \"confirm your membership request\" link (sent when a system enrols an existing account).\n * An account that is not identified yet answers 409 `identification_required` (`errors[]` = what is missing): ask\n * the person and call again with `identification` — it travels in the body, never in the link.\n */\n confirmEnrollment(token: string, identification?: EnrollIdentification): Promise<EnrollConfirmResult>;\n /** An association's PUBLIC events (members-only ones need a member token: `Vimine.events`). */\n events: {\n list(slug: string, params?: EventListParams): Promise<EventList>;\n get(slug: string, event: string, params?: LocaleParam): Promise<Event>;\n };\n /** Consume the token of a guest's \"confirm your registration\" link: the registration, with the QR `token` when confirmed. */\n confirmRegistration(token: string): Promise<Registration>;\n}\n\n/** Query string of an events listing (shared by the public, browser and server clients). */\nexport const eventQuery = (params: EventListParams = {}): string => {\n const q = new URLSearchParams();\n if (params.filter) q.set('filter', params.filter);\n if (params.from) q.set('from', params.from);\n if (params.to) q.set('to', params.to);\n if (params.limit) q.set('limit', String(params.limit));\n if (params.locale) q.set('locale', params.locale);\n const qs = q.toString();\n return qs ? `?${qs}` : '';\n};\n\n/** `?locale=` of a single read. */\nexport const localeQuery = (params: LocaleParam = {}): string => (params.locale ? `?locale=${encodeURIComponent(params.locale)}` : '');\n\nexport const jsonOrThrow = async <T>(res: Response): Promise<T> => {\n if (!res.ok) throw await VimineError.fromResponse(res);\n if (res.status === 204) return undefined as T;\n return (await res.json()) as T;\n};\n\nexport const withNetworkError = async <T>(p: Promise<T>): Promise<T> => {\n try {\n return await p;\n } catch (err) {\n if (err instanceof VimineError) throw err;\n throw new VimineError('network', 'The request could not reach the Vimine API', { cause: err });\n }\n};\n\nexport const publicApi = (options: PublicOptions = {}): PublicApi => {\n const apiUrl = (options.apiUrl || DEFAULT_API_URL).replace(/\\/+$/, '');\n const f = options.fetch || globalThis.fetch.bind(globalThis);\n const get = <T>(path: string) => withNetworkError(f(`${apiUrl}${path}`, { headers: { Accept: 'application/json' } }).then((r) => jsonOrThrow<T>(r)));\n const post = <T>(path: string, body: unknown) =>\n withNetworkError(f(`${apiUrl}${path}`, { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }).then((r) => jsonOrThrow<T>(r)));\n return {\n verifyCard: (cardToken) => get<Verification>(`/v1/verify/${encodeURIComponent(cardToken)}`),\n association: (slug, params = {}) => get<AssociationPublicConfig>(`/v1/aps/${encodeURIComponent(slug)}${localeQuery(params)}`),\n validateFiscalCode: (input) => post<FiscalCodeResult>('/v1/validate/fiscal-code', input),\n cardKeys: () => get<CardKeys>('/v1/card-keys'),\n confirmEnrollment: (token, identification) => post<EnrollConfirmResult>('/v1/enroll/confirm', identification ? { token, identification } : { token }),\n events: {\n list: (slug, params = {}) => get<EventList>(`/v1/aps/${encodeURIComponent(slug)}/events${eventQuery(params)}`),\n get: (slug, event, params = {}) => get<Event>(`/v1/aps/${encodeURIComponent(slug)}/events/${encodeURIComponent(event)}${localeQuery(params)}`)\n },\n confirmRegistration: (token) => post<Registration>('/v1/registrations/confirm', { token })\n };\n};\n"]}
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,0GAA0G;AAC1G,oEAAoE;AACpE,OAAO,E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AG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAQ,WAAW,kBAAkB,CAAC,IAAI,CAAC,WAAW,kBAAkB,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;SACjJ;QACD,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAe,2BAA2B,EAAE,EAAE,KAAK,EAAE,CAAC;QAC1F,gBAAgB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAe,wBAAwB,EAAE,EAAE,KAAK,EAAE,CAAC;KACvF,CAAC;AACN,CAAC,CAAC","sourcesContent":["// The public surface of the API — no credentials, no sign-in: verify a card, read an association's public\n// profile (branding, membership types, in-force statuto), validate a codice fiscale, fetch the card-token\n// public keys. Usable from any page, from a scanner, from a server.\nimport { VimineError } from './errors.js';\nimport type { AssociationPublicConfig, CardKeys, EnrollConfirmResult, EnrollIdentification, Event, EventList, EventListParams, FiscalCodeCheck, FiscalCodeResult, LocaleParam, MemberAddress, Registration, Verification } from './types.js';\n\nexport const DEFAULT_API_URL = 'https://api.vimine.network';\n\nexport interface PublicOptions {\n apiUrl?: string;\n fetch?: typeof fetch;\n}\n\nexport interface PublicApi {\n /** Is this card active right now? Privacy-preserving: status and validity end only. */\n verifyCard(cardToken: string): Promise<Verification>;\n /**\n * An association's public profile by its enrolment slug. `locale`: read its copy — the membership types, the payment\n * instructions, the privacy notice — in that language where the association wrote it; `locale` / `locales` of the\n * answer say what was served and what it offers.\n */\n association(slug: string, params?: LocaleParam): Promise<AssociationPublicConfig>;\n /**\n * Structure + check digit; with the personal data also their consistency with the code — and what the code itself\n * encodes (date and country of birth). For a person born abroad send `country`: their code encodes only the state.\n */\n validateFiscalCode(input: FiscalCodeCheck): Promise<FiscalCodeResult>;\n /** Public keys (JWKS) that verify card tokens offline. Cache and re-fetch daily. */\n cardKeys(): Promise<CardKeys>;\n /**\n * Consume the token of a \"confirm your membership request\" link (sent when a system enrols an existing account, or\n * when the hosted form was sent with an address that already had one).\n * An account that is not identified yet answers 409 `identification_required` (`errors[]` = what is missing): ask\n * the person and call again with `identification` — it travels in the body, never in the link. An association that\n * asks every member for an address answers 409 `address_required`: call again with `address` (and with the\n * `identification` already given, if any).\n */\n confirmEnrollment(token: string, identification?: EnrollIdentification, address?: MemberAddress): Promise<EnrollConfirmResult>;\n /** An association's PUBLIC events (members-only ones need a member token: `Vimine.events`). */\n events: {\n list(slug: string, params?: EventListParams): Promise<EventList>;\n get(slug: string, event: string, params?: LocaleParam): Promise<Event>;\n };\n /** Consume the token of a guest's \"confirm your registration\" link: the registration, with the QR `token` when confirmed. */\n confirmRegistration(token: string): Promise<Registration>;\n /**\n * Read the place named by a guest's own link (the mail that confirms the place): its status and, while it is\n * confirmed, the QR `token`. Changes nothing; the link works until the event is over (`invalid_token` after).\n */\n viewRegistration(token: string): Promise<Registration>;\n}\n\n/** Query string of an events listing (shared by the public, browser and server clients). */\nexport const eventQuery = (params: EventListParams = {}): string => {\n const q = new URLSearchParams();\n if (params.filter) q.set('filter', params.filter);\n if (params.from) q.set('from', params.from);\n if (params.to) q.set('to', params.to);\n if (params.limit) q.set('limit', String(params.limit));\n if (params.locale) q.set('locale', params.locale);\n const qs = q.toString();\n return qs ? `?${qs}` : '';\n};\n\n/** `?locale=` of a single read. */\nexport const localeQuery = (params: LocaleParam = {}): string => (params.locale ? `?locale=${encodeURIComponent(params.locale)}` : '');\n\nexport const jsonOrThrow = async <T>(res: Response): Promise<T> => {\n if (!res.ok) throw await VimineError.fromResponse(res);\n if (res.status === 204) return undefined as T;\n return (await res.json()) as T;\n};\n\nexport const withNetworkError = async <T>(p: Promise<T>): Promise<T> => {\n try {\n return await p;\n } catch (err) {\n if (err instanceof VimineError) throw err;\n throw new VimineError('network', 'The request could not reach the Vimine API', { cause: err });\n }\n};\n\nexport const publicApi = (options: PublicOptions = {}): PublicApi => {\n const apiUrl = (options.apiUrl || DEFAULT_API_URL).replace(/\\/+$/, '');\n const f = options.fetch || globalThis.fetch.bind(globalThis);\n const get = <T>(path: string) => withNetworkError(f(`${apiUrl}${path}`, { headers: { Accept: 'application/json' } }).then((r) => jsonOrThrow<T>(r)));\n const post = <T>(path: string, body: unknown) =>\n withNetworkError(f(`${apiUrl}${path}`, { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(body) }).then((r) => jsonOrThrow<T>(r)));\n return {\n verifyCard: (cardToken) => get<Verification>(`/v1/verify/${encodeURIComponent(cardToken)}`),\n association: (slug, params = {}) => get<AssociationPublicConfig>(`/v1/aps/${encodeURIComponent(slug)}${localeQuery(params)}`),\n validateFiscalCode: (input) => post<FiscalCodeResult>('/v1/validate/fiscal-code', input),\n cardKeys: () => get<CardKeys>('/v1/card-keys'),\n confirmEnrollment: (token, identification, address) =>\n post<EnrollConfirmResult>('/v1/enroll/confirm', { token, ...(identification ? { identification } : {}), ...(address ? { address } : {}) }),\n events: {\n list: (slug, params = {}) => get<EventList>(`/v1/aps/${encodeURIComponent(slug)}/events${eventQuery(params)}`),\n get: (slug, event, params = {}) => get<Event>(`/v1/aps/${encodeURIComponent(slug)}/events/${encodeURIComponent(event)}${localeQuery(params)}`)\n },\n confirmRegistration: (token) => post<Registration>('/v1/registrations/confirm', { token }),\n viewRegistration: (token) => post<Registration>('/v1/registrations/view', { token })\n };\n};\n"]}