···11+{
22+ "lexicon": 1,
33+ "id": "place.wisp.v2.wh",
44+ "defs": {
55+ "main": {
66+ "type": "record",
77+ "description": "Webhook configuration for AT Protocol record events. Fires an HTTP POST to a URL before or after a matching record event is processed.",
88+ "key": "any",
99+ "record": {
1010+ "type": "object",
1111+ "required": [
1212+ "scope",
1313+ "url",
1414+ "phase",
1515+ "events",
1616+ "createdAt"
1717+ ],
1818+ "properties": {
1919+ "scope": {
2020+ "type": "union",
2121+ "refs": [
2222+ "#atUri",
2323+ "#nsid"
2424+ ],
2525+ "description": "What to watch. An AT-URI scopes to a specific DID, collection, or record. An NSID watches that collection globally across all DIDs."
2626+ },
2727+ "url": {
2828+ "type": "string",
2929+ "format": "uri",
3030+ "maxLength": 2048,
3131+ "description": "HTTPS endpoint to POST the webhook payload to."
3232+ },
3333+ "phase": {
3434+ "type": "string",
3535+ "enum": [
3636+ "pre",
3737+ "post"
3838+ ],
3939+ "description": "Whether the webhook should fire before ('pre') or after ('post') the record event is processed."
4040+ },
4141+ "events": {
4242+ "type": "array",
4343+ "items": {
4444+ "type": "string",
4545+ "enum": [
4646+ "create",
4747+ "update",
4848+ "delete"
4949+ ]
5050+ },
5151+ "description": "Which record events to trigger on. 'create' fires when a new record is created. 'update' fires when an existing record is updated. 'delete' fires when a record is deleted.",
5252+ "maxLength": 3
5353+ },
5454+ "secret": {
5555+ "type": "string",
5656+ "description": "Optional secret used to sign the webhook payload with HMAC-SHA256. The signature is included in the 'X-Webhook-Signature' header of the webhook request."
5757+ },
5858+ "enabled": {
5959+ "type": "boolean",
6060+ "description": "Whether the webhook is active. Default to true if omitted."
6161+ },
6262+ "createdAt": {
6363+ "type": "string",
6464+ "format": "datetime",
6565+ "description": "Timestamp of when the webhook was created."
6666+ }
6767+ }
6868+ }
6969+ },
7070+ "atUri": {
7171+ "type": "object",
7272+ "description": "Watch by AT-URI. at://did watches all collections for a DID. at://did/collection watches all records of that collection for a DID. at://did/collection/record watches a specific record.",
7373+ "required": [
7474+ "aturi"
7575+ ],
7676+ "properties": {
7777+ "aturi": {
7878+ "type": "string",
7979+ "format": "at-uri"
8080+ }
8181+ }
8282+ },
8383+ "nsid": {
8484+ "type": "object",
8585+ "description": "Watch all records of this collection type globally across any DID.",
8686+ "required": [
8787+ "nsid"
8888+ ],
8989+ "properties": {
9090+ "nsid": {
9191+ "type": "string",
9292+ "format": "nsid"
9393+ }
9494+ }
9595+ }
9696+ }
9797+}
···11+export * as PlaceWispFs from "./types/place/wisp/fs.js";
22+export * as PlaceWispSettings from "./types/place/wisp/settings.js";
33+export * as PlaceWispSubfs from "./types/place/wisp/subfs.js";
14export * as PlaceWispV2DomainAddSite from "./types/place/wisp/v2/domain/addSite.js";
25export * as PlaceWispV2DomainClaim from "./types/place/wisp/v2/domain/claim.js";
36export * as PlaceWispV2DomainClaimSubdomain from "./types/place/wisp/v2/domain/claimSubdomain.js";
···710export * as PlaceWispV2Domains from "./types/place/wisp/v2/domains.js";
811export * as PlaceWispV2SiteDelete from "./types/place/wisp/v2/site/delete.js";
912export * as PlaceWispV2SiteGetList from "./types/place/wisp/v2/site/getList.js";
1313+export * as PlaceWispV2Wh from "./types/place/wisp/v2/wh.js";
···11+import type {} from "@atcute/lexicons";
22+import * as v from "@atcute/lexicons/validations";
33+import type {} from "@atcute/lexicons/ambient";
44+55+const _atUriSchema = /*#__PURE__*/ v.object({
66+ $type: /*#__PURE__*/ v.optional(
77+ /*#__PURE__*/ v.literal("place.wisp.v2.wh#atUri"),
88+ ),
99+ aturi: /*#__PURE__*/ v.resourceUriString(),
1010+});
1111+const _mainSchema = /*#__PURE__*/ v.record(
1212+ /*#__PURE__*/ v.string(),
1313+ /*#__PURE__*/ v.object({
1414+ $type: /*#__PURE__*/ v.literal("place.wisp.v2.wh"),
1515+ /**
1616+ * Timestamp of when the webhook was created.
1717+ */
1818+ createdAt: /*#__PURE__*/ v.datetimeString(),
1919+ /**
2020+ * Whether the webhook is active. Default to true if omitted.
2121+ */
2222+ enabled: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()),
2323+ /**
2424+ * Which record events to trigger on. 'create' fires when a new record is created. 'update' fires when an existing record is updated. 'delete' fires when a record is deleted.
2525+ * @maxLength 3
2626+ */
2727+ events: /*#__PURE__*/ v.constrain(
2828+ /*#__PURE__*/ v.array(
2929+ /*#__PURE__*/ v.literalEnum(["create", "delete", "update"]),
3030+ ),
3131+ [/*#__PURE__*/ v.arrayLength(0, 3)],
3232+ ),
3333+ /**
3434+ * Whether the webhook should fire before ('pre') or after ('post') the record event is processed.
3535+ */
3636+ phase: /*#__PURE__*/ v.literalEnum(["post", "pre"]),
3737+ /**
3838+ * What to watch. An AT-URI scopes to a specific DID, collection, or record. An NSID watches that collection globally across all DIDs.
3939+ */
4040+ get scope() {
4141+ return /*#__PURE__*/ v.variant([atUriSchema, nsidSchema]);
4242+ },
4343+ /**
4444+ * Optional secret used to sign the webhook payload with HMAC-SHA256. The signature is included in the 'X-Webhook-Signature' header of the webhook request.
4545+ */
4646+ secret: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
4747+ /**
4848+ * HTTPS endpoint to POST the webhook payload to.
4949+ * @maxLength 2048
5050+ */
5151+ url: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.genericUriString(), [
5252+ /*#__PURE__*/ v.stringLength(0, 2048),
5353+ ]),
5454+ }),
5555+);
5656+const _nsidSchema = /*#__PURE__*/ v.object({
5757+ $type: /*#__PURE__*/ v.optional(
5858+ /*#__PURE__*/ v.literal("place.wisp.v2.wh#nsid"),
5959+ ),
6060+ nsid: /*#__PURE__*/ v.nsidString(),
6161+});
6262+6363+type atUri$schematype = typeof _atUriSchema;
6464+type main$schematype = typeof _mainSchema;
6565+type nsid$schematype = typeof _nsidSchema;
6666+6767+export interface atUriSchema extends atUri$schematype {}
6868+export interface mainSchema extends main$schematype {}
6969+export interface nsidSchema extends nsid$schematype {}
7070+7171+export const atUriSchema = _atUriSchema as atUriSchema;
7272+export const mainSchema = _mainSchema as mainSchema;
7373+export const nsidSchema = _nsidSchema as nsidSchema;
7474+7575+export interface AtUri extends v.InferInput<typeof atUriSchema> {}
7676+export interface Main extends v.InferInput<typeof mainSchema> {}
7777+export interface Nsid extends v.InferInput<typeof nsidSchema> {}
7878+7979+declare module "@atcute/lexicons/ambient" {
8080+ interface Records {
8181+ "place.wisp.v2.wh": mainSchema;
8282+ }
8383+}
+86
packages/@wispplace/lexicons/src/lexicons.ts
···10281028 },
10291029 },
10301030 },
10311031+ PlaceWispV2Wh: {
10321032+ lexicon: 1,
10331033+ id: 'place.wisp.v2.wh',
10341034+ defs: {
10351035+ main: {
10361036+ type: 'record',
10371037+ description:
10381038+ 'Webhook configuration for AT Protocol record events. Fires an HTTP POST to a URL before or after a matching record event is processed.',
10391039+ key: 'any',
10401040+ record: {
10411041+ type: 'object',
10421042+ required: ['scope', 'url', 'phase', 'events', 'createdAt'],
10431043+ properties: {
10441044+ scope: {
10451045+ type: 'union',
10461046+ refs: ['lex:place.wisp.v2.wh#atUri', 'lex:place.wisp.v2.wh#nsid'],
10471047+ description:
10481048+ 'What to watch. An AT-URI scopes to a specific DID, collection, or record. An NSID watches that collection globally across all DIDs.',
10491049+ },
10501050+ url: {
10511051+ type: 'string',
10521052+ format: 'uri',
10531053+ maxLength: 2048,
10541054+ description: 'HTTPS endpoint to POST the webhook payload to.',
10551055+ },
10561056+ phase: {
10571057+ type: 'string',
10581058+ enum: ['pre', 'post'],
10591059+ description:
10601060+ "Whether the webhook should fire before ('pre') or after ('post') the record event is processed.",
10611061+ },
10621062+ events: {
10631063+ type: 'array',
10641064+ items: {
10651065+ type: 'string',
10661066+ enum: ['create', 'update', 'delete'],
10671067+ },
10681068+ description:
10691069+ "Which record events to trigger on. 'create' fires when a new record is created. 'update' fires when an existing record is updated. 'delete' fires when a record is deleted.",
10701070+ maxLength: 3,
10711071+ },
10721072+ secret: {
10731073+ type: 'string',
10741074+ description:
10751075+ "Optional secret used to sign the webhook payload with HMAC-SHA256. The signature is included in the 'X-Webhook-Signature' header of the webhook request.",
10761076+ },
10771077+ enabled: {
10781078+ type: 'boolean',
10791079+ description:
10801080+ 'Whether the webhook is active. Default to true if omitted.',
10811081+ },
10821082+ createdAt: {
10831083+ type: 'string',
10841084+ format: 'datetime',
10851085+ description: 'Timestamp of when the webhook was created.',
10861086+ },
10871087+ },
10881088+ },
10891089+ },
10901090+ atUri: {
10911091+ type: 'object',
10921092+ description:
10931093+ 'Watch by AT-URI. at://did watches all collections for a DID. at://did/collection watches all records of that collection for a DID. at://did/collection/record watches a specific record.',
10941094+ required: ['aturi'],
10951095+ properties: {
10961096+ aturi: {
10971097+ type: 'string',
10981098+ format: 'at-uri',
10991099+ },
11001100+ },
11011101+ },
11021102+ nsid: {
11031103+ type: 'object',
11041104+ description:
11051105+ 'Watch all records of this collection type globally across any DID.',
11061106+ required: ['nsid'],
11071107+ properties: {
11081108+ nsid: {
11091109+ type: 'string',
11101110+ format: 'nsid',
11111111+ },
11121112+ },
11131113+ },
11141114+ },
11151115+ },
10311116} as const satisfies Record<string, LexiconDoc>
10321117export const schemas = Object.values(schemaDict) satisfies LexiconDoc[]
10331118export const lexicons: Lexicons = new Lexicons(schemas)
···10731158 PlaceWispV2SiteDelete: 'place.wisp.v2.site.delete',
10741159 PlaceWispV2SiteGetList: 'place.wisp.v2.site.getList',
10751160 PlaceWispSubfs: 'place.wisp.subfs',
11611161+ PlaceWispV2Wh: 'place.wisp.v2.wh',
10761162} as const
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { type ValidationResult, BlobRef } from '@atproto/lexicon'
55+import { CID } from 'multiformats/cid'
66+import { validate as _validate } from '../../../../lexicons'
77+import {
88+ type $Typed,
99+ is$typed as _is$typed,
1010+ type OmitKey,
1111+} from '../../../../util'
1212+1313+const is$typed = _is$typed,
1414+ validate = _validate
1515+const id = 'place.wisp.v2.wh'
1616+1717+export interface Main {
1818+ $type: 'place.wisp.v2.wh'
1919+ scope: $Typed<AtUri> | $Typed<Nsid> | { $type: string }
2020+ /** HTTPS endpoint to POST the webhook payload to. */
2121+ url: string
2222+ /** Whether the webhook should fire before ('pre') or after ('post') the record event is processed. */
2323+ phase: 'pre' | 'post'
2424+ /** Which record events to trigger on. 'create' fires when a new record is created. 'update' fires when an existing record is updated. 'delete' fires when a record is deleted. */
2525+ events: ('create' | 'update' | 'delete')[]
2626+ /** Optional secret used to sign the webhook payload with HMAC-SHA256. The signature is included in the 'X-Webhook-Signature' header of the webhook request. */
2727+ secret?: string
2828+ /** Whether the webhook is active. Default to true if omitted. */
2929+ enabled?: boolean
3030+ /** Timestamp of when the webhook was created. */
3131+ createdAt: string
3232+ [k: string]: unknown
3333+}
3434+3535+const hashMain = 'main'
3636+3737+export function isMain<V>(v: V) {
3838+ return is$typed(v, id, hashMain)
3939+}
4040+4141+export function validateMain<V>(v: V) {
4242+ return validate<Main & V>(v, id, hashMain, true)
4343+}
4444+4545+export {
4646+ type Main as Record,
4747+ isMain as isRecord,
4848+ validateMain as validateRecord,
4949+}
5050+5151+/** Watch by AT-URI. at://did watches all collections for a DID. at://did/collection watches all records of that collection for a DID. at://did/collection/record watches a specific record. */
5252+export interface AtUri {
5353+ $type?: 'place.wisp.v2.wh#atUri'
5454+ aturi: string
5555+}
5656+5757+const hashAtUri = 'atUri'
5858+5959+export function isAtUri<V>(v: V) {
6060+ return is$typed(v, id, hashAtUri)
6161+}
6262+6363+export function validateAtUri<V>(v: V) {
6464+ return validate<AtUri & V>(v, id, hashAtUri)
6565+}
6666+6767+/** Watch all records of this collection type globally across any DID. */
6868+export interface Nsid {
6969+ $type?: 'place.wisp.v2.wh#nsid'
7070+ nsid: string
7171+}
7272+7373+const hashNsid = 'nsid'
7474+7575+export function isNsid<V>(v: V) {
7676+ return is$typed(v, id, hashNsid)
7777+}
7878+7979+export function validateNsid<V>(v: V) {
8080+ return validate<Nsid & V>(v, id, hashNsid)
8181+}