Contracts 1.5.0: OIDC client paths, client secret from the link, church.changed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,3 +97,20 @@ export const churchSchema = z
|
||||
export type Church = z.infer<typeof churchSchema>;
|
||||
export type Campus = z.infer<typeof campusSchema>;
|
||||
export type ServiceTime = z.infer<typeof serviceTimeSchema>;
|
||||
|
||||
/**
|
||||
* Where the church profile lives (contracts 1.5.0): **Accounts owns it** (docs/ACCOUNTS-1.0-PLAN.md
|
||||
* §7, decision 1) and serves it publicly at `profile`; products read it from there. When it
|
||||
* changes, Accounts sends `church.changed` (signed with the link's secret, `LINK_HEADERS`) to
|
||||
* each linked product at `changed`, which then fetches the profile again.
|
||||
*/
|
||||
export const CHURCH_PATHS = { profile: "/api/church/v1", changed: "/api/church/v1/changed" } as const;
|
||||
|
||||
/** The `church.changed` webhook: a hint to fetch `GET /api/church/v1` again. */
|
||||
export const churchChangedSchema = z.object({
|
||||
schema: z.literal(CHURCH_SCHEMA),
|
||||
type: z.literal("church.changed"),
|
||||
occurredAt: dateTimeSchema,
|
||||
updatedAt: dateTimeSchema,
|
||||
});
|
||||
export type ChurchChanged = z.infer<typeof churchChangedSchema>;
|
||||
|
||||
Reference in New Issue
Block a user