@buildinternet/releases-api-types 0.39.0 → 0.40.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/releases-api-types",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Wire protocol — request/response types for the Releases registry API. Shared by web, workers, and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/api-types.ts CHANGED
@@ -342,12 +342,28 @@ export {
342
342
  ListingOrgPointerSchema,
343
343
  ListingValidationResultSchema,
344
344
  ListingActivateResultSchema,
345
+ ListingClaimBodySchema,
346
+ ListingClaimVerifyBodySchema,
347
+ OrgClaimStatusSchema,
348
+ ClaimMethodSchema,
349
+ OrgClaimSchema,
350
+ ClaimCheckOutcomeSchema,
351
+ ClaimVerifyResultSchema,
352
+ ListingClaimsResultSchema,
345
353
  type ListingValidateBody,
346
354
  type ListingActivateBody,
347
355
  type ListingIssue,
348
356
  type ListingLocation,
349
357
  type ListingValidationResult,
350
358
  type ListingActivateResult,
359
+ type ListingClaimBody,
360
+ type ListingClaimVerifyBody,
361
+ type OrgClaimStatus,
362
+ type ClaimMethod,
363
+ type OrgClaim,
364
+ type ClaimCheckOutcome,
365
+ type ClaimVerifyResult,
366
+ type ListingClaimsResult,
351
367
  } from "./schemas/listing.js";
352
368
  export {
353
369
  SourceListItemSchema,
@@ -74,3 +74,65 @@ export const ListingActivateResultSchema = z.strictObject({
74
74
  trackingRequested: z.boolean(),
75
75
  });
76
76
  export type ListingActivateResult = z.infer<typeof ListingActivateResultSchema>;
77
+
78
+ /**
79
+ * Ownership claim flow (#1947 epic item 2): a signed-in user proves control
80
+ * of a listed domain via a well-known token file OR a DNS TXT record.
81
+ */
82
+
83
+ export const ListingClaimBodySchema = z.strictObject({
84
+ domain: z.string().min(1).max(255),
85
+ });
86
+ export type ListingClaimBody = z.infer<typeof ListingClaimBodySchema>;
87
+
88
+ export const ListingClaimVerifyBodySchema = z.strictObject({
89
+ claimId: z.string().min(1),
90
+ });
91
+ export type ListingClaimVerifyBody = z.infer<typeof ListingClaimVerifyBodySchema>;
92
+
93
+ export const OrgClaimStatusSchema = z.enum(["pending", "verified", "expired"]);
94
+ export type OrgClaimStatus = z.infer<typeof OrgClaimStatusSchema>;
95
+
96
+ export const ClaimMethodSchema = z.enum(["well-known", "dns-txt"]);
97
+ export type ClaimMethod = z.infer<typeof ClaimMethodSchema>;
98
+
99
+ /**
100
+ * `token` + `instructions` are only present while the claim is `pending` (or
101
+ * on mint) — once verified there's nothing left to prove, and an expired
102
+ * claim's token is stale.
103
+ */
104
+ export const OrgClaimSchema = z.strictObject({
105
+ id: z.string(),
106
+ org: ListingOrgPointerSchema,
107
+ status: OrgClaimStatusSchema,
108
+ method: ClaimMethodSchema.optional(),
109
+ token: z.string().optional(),
110
+ createdAt: z.string(),
111
+ verifiedAt: z.string().optional(),
112
+ expiresAt: z.string(),
113
+ instructions: z
114
+ .strictObject({
115
+ wellKnownUrl: z.string(),
116
+ dnsRecordName: z.string(),
117
+ })
118
+ .optional(),
119
+ });
120
+ export type OrgClaim = z.infer<typeof OrgClaimSchema>;
121
+
122
+ export const ClaimCheckOutcomeSchema = z.enum(["ok", "mismatch", "unreachable"]);
123
+ export type ClaimCheckOutcome = z.infer<typeof ClaimCheckOutcomeSchema>;
124
+
125
+ export const ClaimVerifyResultSchema = z.strictObject({
126
+ verified: z.boolean(),
127
+ checked: z.strictObject({
128
+ wellKnown: ClaimCheckOutcomeSchema,
129
+ dnsTxt: ClaimCheckOutcomeSchema,
130
+ }),
131
+ claim: OrgClaimSchema,
132
+ });
133
+ export type ClaimVerifyResult = z.infer<typeof ClaimVerifyResultSchema>;
134
+
135
+ export const ListingClaimsResultSchema = z.strictObject({
136
+ claims: z.array(OrgClaimSchema),
137
+ });
138
+ export type ListingClaimsResult = z.infer<typeof ListingClaimsResultSchema>;
@@ -171,6 +171,8 @@ export const SourceDetailSchema = z.object({
171
171
  latestDate: z.string().nullable(),
172
172
  lastFetchedAt: z.string().nullable(),
173
173
  lastPolledAt: z.string().nullable(),
174
+ // #1969: additive so pinned old workers/clients degrade gracefully.
175
+ changeDetectedAt: z.string().nullable().optional(),
174
176
  trackingSince: z.string(),
175
177
  releases: z.array(ReleaseItemSchema),
176
178
  pagination: SourceFeedPaginationSchema,