IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved
Replaced by an explicit list of forms only (ten exported names, runtime env names, project file names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are not touched. package.json keeps the five old bin names beside the five new ones. The old names stop working in this commit and come back as aliases in the next; docs follow. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
414a4702df
commit
0a4f001797
@@ -20,7 +20,7 @@ export type FormFileScanInput = {
|
||||
export type FormFileScanResult = { ok: boolean; reason?: string }
|
||||
|
||||
/**
|
||||
* `ipalKit({ forms: { attachments } })` — files on panel forms. They are
|
||||
* `iapl({ forms: { attachments } })` — files on panel forms. They are
|
||||
* NEVER stored: a file is checked, attached to the company e-mail, and dropped.
|
||||
*/
|
||||
export type FormAttachmentsOption = {
|
||||
|
||||
@@ -178,12 +178,12 @@ export function buildFileDeliveryHook({ formsSlug = 'forms' }: { formsSlug?: str
|
||||
|
||||
const detail = firstLine(outcomes.find((o) => o.detail)?.detail)
|
||||
delivery.result = { note: detail ? `The mail server did not take the message: ${detail}` : 'The mail server did not take the message.', state: 'failed' }
|
||||
payload.logger.error(`[ipal] Form file not delivered (${fileList(delivery.files)}): ${detail || 'send failed'}`)
|
||||
payload.logger.error(`[iapl] Form file not delivered (${fileList(delivery.files)}): ${detail || 'send failed'}`)
|
||||
await Promise.all(carriers.map((email) => send(payload, withFailureNotice(email, delivery.files, locale))))
|
||||
return []
|
||||
} catch (err) {
|
||||
delivery.result = { note: firstLine(err instanceof Error ? err.message : String(err)), state: 'failed' }
|
||||
payload.logger.error(`[ipal] Form file delivery failed: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] Form file delivery failed: ${(err as Error).message}`)
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ export async function handleFormSubmit(req: PayloadRequest): Promise<Response> {
|
||||
open.delete(stream)
|
||||
if (settled) {return} // aborted: already answered, nothing to add
|
||||
stream.resume()
|
||||
payload.logger.error(`[ipal] Form file could not be read: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] Form file could not be read: ${(err as Error).message}`)
|
||||
stop({ reason: 'error', success: false })
|
||||
})
|
||||
})
|
||||
@@ -335,7 +335,7 @@ export async function handleFormSubmit(req: PayloadRequest): Promise<Response> {
|
||||
stop(await storeSubmission({ ...(stored), files: (gate).accepted }))
|
||||
}
|
||||
} catch (err) {
|
||||
payload.logger.error(`[ipal] Form submit failed: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] Form submit failed: ${(err as Error).message}`)
|
||||
stop({ reason: 'error', success: false })
|
||||
}
|
||||
conclude(outcome ?? { reason: 'error', success: false })
|
||||
|
||||
@@ -11,7 +11,7 @@ import { HONEYPOT_FIELD, isHoneypotTripped } from './honeypot.js'
|
||||
import { submitForm } from './submitForm.js'
|
||||
|
||||
type CreateSubmitActionArgs = {
|
||||
/** Optional: IP options (default IPAL_IP_HEADER env / clientIp defaults). */
|
||||
/** Optional: IP options (default IAPL_IP_HEADER env / clientIp defaults). */
|
||||
clientIp?: ClientIpOptions
|
||||
getCachedPayload: () => Promise<BasePayload>
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ export async function splitFormFiles(values: Record<string, unknown>): Promise<{
|
||||
* import { getCachedPayload } from '@/lib/content'
|
||||
* export const sendForm = createSubmitAction({ getCachedPayload, headers })
|
||||
*
|
||||
* Signature matches the ipal-form FormRenderer: `sendForm(formId, locale, values,
|
||||
* Signature matches the iapl-form FormRenderer: `sendForm(formId, locale, values,
|
||||
* turnstileToken?)` — bind formId and locale in the block (`sendForm.bind(null, id, locale)`).
|
||||
* A tripped honeypot gets a fake success and stores nothing.
|
||||
*/
|
||||
|
||||
@@ -203,7 +203,7 @@ export function buildEmailLayoutHook({ formsSlug = 'forms' }: { formsSlug?: stri
|
||||
}),
|
||||
}))
|
||||
} catch (err) {
|
||||
payload.logger.error(`[ipal] E-mail layout skipped: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] E-mail layout skipped: ${(err as Error).message}`)
|
||||
return emails
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Field } from 'payload'
|
||||
* `dataLayer` push fired on successful submit — without any code change. Add
|
||||
* them to the Forms collection via the plugin's `formOverrides`:
|
||||
*
|
||||
* ipalKit({
|
||||
* iapl({
|
||||
* forms: {
|
||||
* formOverrides: {
|
||||
* fields: ({ defaultFields }) => [...defaultFields, ...buildFormAnalyticsFields()],
|
||||
|
||||
@@ -195,7 +195,7 @@ function hideEmails(fields: Field[]): Field[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures @payloadcms/plugin-form-builder from IPAL's FormsOption.
|
||||
* Configures @payloadcms/plugin-form-builder from IAPL's FormsOption.
|
||||
*
|
||||
* Provides the forms / form-submissions collections and field types. E-mails
|
||||
* after a submission are the form-builder's own (Forms → Emails), sent through
|
||||
|
||||
@@ -25,7 +25,7 @@ export type SubmitFormArgs = {
|
||||
/**
|
||||
* Name of the GDPR consent checkbox. A field with this name must be checked
|
||||
* for the submission to succeed (enforced server-side). Defaults to
|
||||
* ipalKit({ forms: { consentFieldName } }), then 'consent'.
|
||||
* iapl({ forms: { consentFieldName } }), then 'consent'.
|
||||
*/
|
||||
consentFieldName?: string
|
||||
/** Submitted field data — shape matches the form's fields. */
|
||||
@@ -212,7 +212,7 @@ export async function validateSubmitFields({
|
||||
locale,
|
||||
payload,
|
||||
}: Pick<SubmitFormArgs, 'consentFieldName' | 'data' | 'formId' | 'locale' | 'payload'>): Promise<{ failure: SubmitFailure } | { validation: ValidSubmission }> {
|
||||
// Explicit argument → ipalKit({ forms: { consentFieldName } }) → 'consent'.
|
||||
// Explicit argument → iapl({ forms: { consentFieldName } }) → 'consent'.
|
||||
const configured = (payload.config?.custom as { ipal?: { consentFieldName?: unknown } } | undefined)?.ipal?.consentFieldName
|
||||
const consentField = consentFieldName ?? (typeof configured === 'string' && configured ? configured : undefined)
|
||||
const validation = await validateSubmission(payload, formId, data, consentField)
|
||||
@@ -342,7 +342,7 @@ export async function storeSubmission({
|
||||
depth: 0,
|
||||
})
|
||||
} catch (err) {
|
||||
payload.logger.error(`[ipal] Could not record the file delivery on submission ${String(submission.id)}: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] Could not record the file delivery on submission ${String(submission.id)}: ${(err as Error).message}`)
|
||||
}
|
||||
if (result.state === 'sent') {return { submissionId: submission.id, success: true }}
|
||||
// The message belongs at the File field and names the file — never the mail server's own words.
|
||||
@@ -356,7 +356,7 @@ export async function storeSubmission({
|
||||
...(fileField && !fileField.required ? { optional: true } : {}),
|
||||
}
|
||||
} catch (err) {
|
||||
payload.logger.error(`[ipal] Form submission failed: ${(err as Error).message}`)
|
||||
payload.logger.error(`[iapl] Form submission failed: ${(err as Error).message}`)
|
||||
return { reason: 'error', success: false }
|
||||
} finally {
|
||||
// The buffers are not needed past this point — drop the references now.
|
||||
@@ -402,8 +402,8 @@ export async function submitForm(args: SubmitFormArgs): Promise<SubmitFormResult
|
||||
// Never dropped silently: the caller sent files this site (or this form) does not take.
|
||||
payload.logger.warn(
|
||||
attachments
|
||||
? `[ipal] submitForm: files were sent to form ${formId}, which has no File field — refused.`
|
||||
: '[ipal] submitForm: files were sent, but forms.attachments is off — refused. Turn it on in ipalKit({ forms: { attachments: true } }).',
|
||||
? `[iapl] submitForm: files were sent to form ${formId}, which has no File field — refused.`
|
||||
: '[iapl] submitForm: files were sent, but forms.attachments is off — refused. Turn it on in iapl({ forms: { attachments: true } }).',
|
||||
)
|
||||
return { kind: 'unknown_fields', reason: 'validation', success: false }
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export type FormsOption = {
|
||||
/**
|
||||
* What a form does while Turnstile CANNOT check — the secret is missing or
|
||||
* wrong, Cloudflare is down (the "degraded" state, shown in Site
|
||||
* integrations and by ipal-doctor). Default: a text form is accepted
|
||||
* integrations and by iapl-doctor). Default: a text form is accepted
|
||||
* (`'allow'`: an enquiry matters more than spam), a form that can carry
|
||||
* files — the file endpoint — is refused (`'reject'`: an accepted bot
|
||||
* submission would put an attachment into a mailbox).
|
||||
|
||||
Reference in New Issue
Block a user