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
@@ -15,7 +15,7 @@ import { CONSENT_CATEGORY_LABELS } from './categoryLabels.js'
|
||||
* the time. NO IP address, user agent or other personal data — the id alone
|
||||
* links a record to the browser that holds the cookie.
|
||||
*
|
||||
* Opt-in: `ipalKit({ consentLog: true })` adds the collection and the endpoint
|
||||
* Opt-in: `iapl({ consentLog: true })` adds the collection and the endpoint
|
||||
* POST /api/ipal/consent; the layout passes `<ConsentProvider logEndpoint="/api/ipal/consent">`.
|
||||
* Records older than `retentionDays` (default 3 years) are purged automatically.
|
||||
*/
|
||||
@@ -110,7 +110,7 @@ export function buildConsentLogEndpoint({ retentionDays = 1095 }: ConsentLogOpti
|
||||
purge(req.payload, { createdAt: { less_than: new Date(Date.now() - retentionDays * 86_400_000).toISOString() } })
|
||||
return Response.json({ ok: true }, { status: 201 })
|
||||
} catch (err) {
|
||||
req.payload.logger.error(`[ipal] consent log write failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
req.payload.logger.error(`[iapl] consent log write failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
return Response.json({ ok: false }, { status: 500 })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -142,7 +142,7 @@ async function readPrivacyPage(payload: BasePayload, settingsSlug: string): Prom
|
||||
return page && typeof page === 'object' ? (page as PrivacyPage) : null
|
||||
} catch (error) {
|
||||
// No pages option / no privacyPolicy field / DB unreachable at build → no link.
|
||||
console.warn('[ipal] getConsentTexts: privacy page lookup failed, banner without link:', error)
|
||||
console.warn('[iapl] getConsentTexts: privacy page lookup failed, banner without link:', error)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ export function buildCookieApprovalEndpoints(options: CookieScannerOptions): End
|
||||
const result = await approveCookies({ addToList: options.syncAccepted !== false, ids, payload: req.payload, req, unknownCategory: approval.unknownCategory })
|
||||
return Response.json({ ok: true, result })
|
||||
} catch (err) {
|
||||
req.payload.logger.error(`[ipal] cookie approval failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
req.payload.logger.error(`[iapl] cookie approval failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
return Response.json({ ok: false }, { status: 500 })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ import { addToCookieList } from './sync.js'
|
||||
* Cookie review list — drafts from "Scan cookies" that an editor accepts,
|
||||
* edits or rejects. Accepting adds the cookie to Cookie Settings → Cookies
|
||||
* (the banner's detailed window and <CookieTable>). Opt-in:
|
||||
* `ipalKit({ cookieScanner: true })`.
|
||||
* `iapl({ cookieScanner: true })`.
|
||||
*/
|
||||
export const COOKIE_REVIEW_SLUG = 'cookie-review'
|
||||
|
||||
@@ -46,7 +46,7 @@ function buildSyncHook(): CollectionAfterChangeHook {
|
||||
req,
|
||||
})) as unknown as { name: string } & CookieReviewValues
|
||||
const result = await addToCookieList({ entry: full, payload: req.payload, req })
|
||||
req.payload.logger.info(`[ipal] cookie review: "${full.name}" accepted → Cookie Settings (${result})`)
|
||||
req.payload.logger.info(`[iapl] cookie review: "${full.name}" accepted → Cookie Settings (${result})`)
|
||||
if (!doc.listed) {
|
||||
await req.payload.update({
|
||||
id: doc.id,
|
||||
|
||||
@@ -7,8 +7,8 @@ import { DEFAULT_TRACKER_HOSTS } from './violations.js'
|
||||
export const COOKIE_CRAWL_SLUG = 'cookie-crawl'
|
||||
export const COOKIE_CRAWL_PATH = '/ipal/cookie-crawl'
|
||||
export const COOKIE_CRAWL_RESULTS_PATH = '/ipal/cookie-crawl/results'
|
||||
export const COOKIE_SCAN_URL_ENV = 'IPAL_COOKIE_SCAN_URL'
|
||||
export const COOKIE_SCAN_TOKEN_ENV = 'IPAL_COOKIE_SCAN_TOKEN'
|
||||
export const COOKIE_SCAN_URL_ENV = 'IAPL_COOKIE_SCAN_URL'
|
||||
export const COOKIE_SCAN_TOKEN_ENV = 'IAPL_COOKIE_SCAN_TOKEN'
|
||||
/** A crawl still "running" after this long is treated as lost (the service never called back). */
|
||||
export const CRAWL_TIMEOUT_MS = 30 * 60_000
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ export function buildCookieCrawlEndpoints({
|
||||
if (!res.ok) {throw new Error(`scanner service answered HTTP ${res.status}`)}
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err)
|
||||
req.payload.logger.error(`[ipal] cookie crawl: could not start — ${message}`)
|
||||
req.payload.logger.error(`[iapl] cookie crawl: could not start — ${message}`)
|
||||
await write(req, { error: 'The checking service could not be reached. Please try again later.', finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
return Response.json({ error: 'service_unreachable', ok: false }, { status: 502 })
|
||||
}
|
||||
@@ -155,7 +155,7 @@ export function buildCookieCrawlEndpoints({
|
||||
return Response.json({ ok: true })
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err)
|
||||
req.payload.logger.error(`[ipal] cookie crawl: saving the result failed — ${message}`)
|
||||
req.payload.logger.error(`[iapl] cookie crawl: saving the result failed — ${message}`)
|
||||
await write(req, { error: 'The result could not be saved. Please run the check again.', finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
return Response.json({ ok: false }, { status: 500 })
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ ${pending ? `<p><strong>${esc(fill(t('emailPending'), { count: pending }))}</str
|
||||
await payload.sendEmail({ html, subject, to })
|
||||
return true
|
||||
} catch (err) {
|
||||
payload.logger.error(`[ipal] cookie crawl warning e-mail failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
payload.logger.error(`[iapl] cookie crawl warning e-mail failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function buildCookieScanEndpoints(options: CookieScannerOptions, plugin:
|
||||
const { enabled, summary } = await runCookieScan({ names: parseCookieNames(body.names), options, payload: req.payload, plugin, req })
|
||||
return Response.json({ integrations: list(enabled, req), ok: true, summary })
|
||||
} catch (err) {
|
||||
req.payload.logger.error(`[ipal] cookie scan failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
req.payload.logger.error(`[iapl] cookie scan failed: ${err instanceof Error ? err.message : String(err)}`)
|
||||
return Response.json({ ok: false }, { status: 500 })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -63,7 +63,7 @@ export async function enabledCookieIntegrations(
|
||||
try {
|
||||
if (await integration.isEnabled(ctx)) {on.push(integration)}
|
||||
} catch (err) {
|
||||
ctx.payload.logger.warn(`[ipal] cookie scan: could not check "${integration.key}": ${err instanceof Error ? err.message : String(err)}`)
|
||||
ctx.payload.logger.warn(`[iapl] cookie scan: could not check "${integration.key}": ${err instanceof Error ? err.message : String(err)}`)
|
||||
}
|
||||
}
|
||||
return on
|
||||
|
||||
@@ -38,7 +38,7 @@ export type CookieScanContext = {
|
||||
language?: string
|
||||
payload: BasePayload
|
||||
/** Plugin options that switch modules on. */
|
||||
/** Plugin options that switch modules on; `themeStorageKey` = `ipalKit({ theme: { storageKey } })`. */
|
||||
/** Plugin options that switch modules on; `themeStorageKey` = `iapl({ theme: { storageKey } })`. */
|
||||
plugin: { localeCount: number; stats: boolean; themeStorageKey?: string }
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export type CookieScanSummary = {
|
||||
}
|
||||
|
||||
/**
|
||||
* `ipalKit({ cookieScanner })` — the Cookie review list and the "Scan cookies"
|
||||
* `iapl({ cookieScanner })` — the Cookie review list and the "Scan cookies"
|
||||
* action. Every key is optional.
|
||||
*/
|
||||
export type CookieScannerOptions = {
|
||||
@@ -163,11 +163,11 @@ export type CookieCrawlOptions = {
|
||||
globalOverride?: GlobalOverride
|
||||
/** Sitemap pages crawled besides the home page. Default 20, at most 100. */
|
||||
maxPages?: number
|
||||
/** Scanner service base URL. Default env `IPAL_COOKIE_SCAN_URL`. */
|
||||
/** Scanner service base URL. Default env `IAPL_COOKIE_SCAN_URL`. */
|
||||
serviceUrl?: string
|
||||
/** Public origin of this site the service crawls and calls back. Default `serverURL`, else `NEXT_PUBLIC_SERVER_URL`. */
|
||||
siteUrl?: string
|
||||
/** Shared secret with the service. Default env `IPAL_COOKIE_SCAN_TOKEN`. */
|
||||
/** Shared secret with the service. Default env `IAPL_COOKIE_SCAN_TOKEN`. */
|
||||
token?: string
|
||||
/** Hosts whose requests before consent are violations: `(defaults) => hosts`. */
|
||||
trackerHosts?: (defaults: string[]) => string[]
|
||||
|
||||
Reference in New Issue
Block a user