@buildinternet/releases-api-types 0.55.0 → 0.57.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.55.0",
3
+ "version": "0.57.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",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@buildinternet/releases-core": "^0.31.1",
20
+ "@buildinternet/releases-core": "^0.33.0",
21
21
  "zod": "^4.4.3"
22
22
  },
23
23
  "publishConfig": {
package/src/api-types.ts CHANGED
@@ -408,6 +408,9 @@ export {
408
408
  ClaimCheckOutcomeSchema,
409
409
  ClaimVerifyResultSchema,
410
410
  ListingClaimsResultSchema,
411
+ AdminOrgClaimSchema,
412
+ ListOrgClaimsResponseSchema,
413
+ RevokeOrgClaimBodySchema,
411
414
  ListingPromoteBodySchema,
412
415
  ListingPromoteLocatorOutcomeSchema,
413
416
  ListingPromoteLocatorSchema,
@@ -427,12 +430,27 @@ export {
427
430
  type ClaimCheckOutcome,
428
431
  type ClaimVerifyResult,
429
432
  type ListingClaimsResult,
433
+ type AdminOrgClaim,
434
+ type ListOrgClaimsResponse,
435
+ type RevokeOrgClaimBody,
430
436
  type ListingPromoteBody,
431
437
  type ListingPromoteLocatorOutcome,
432
438
  type ListingPromoteLocator,
433
439
  type ListingPromoteResult,
434
440
  type ListingCapabilities,
435
441
  } from "./schemas/listing.js";
442
+ export {
443
+ CreatePublishTokenBodySchema,
444
+ CreatedPublishTokenSchema,
445
+ PublishTokenSchema,
446
+ ListPublishTokensResponseSchema,
447
+ RevokePublishTokenResponseSchema,
448
+ type CreatePublishTokenBody,
449
+ type CreatedPublishToken,
450
+ type PublishToken,
451
+ type ListPublishTokensResponse,
452
+ type RevokePublishTokenResponse,
453
+ } from "./schemas/publish-tokens.js";
436
454
  export {
437
455
  SourceListItemSchema,
438
456
  SourceWithOrgSchema,
@@ -90,7 +90,7 @@ export const ListingClaimVerifyBodySchema = z.strictObject({
90
90
  });
91
91
  export type ListingClaimVerifyBody = z.infer<typeof ListingClaimVerifyBodySchema>;
92
92
 
93
- export const OrgClaimStatusSchema = z.enum(["pending", "verified", "expired"]);
93
+ export const OrgClaimStatusSchema = z.enum(["pending", "verified", "expired", "revoked"]);
94
94
  export type OrgClaimStatus = z.infer<typeof OrgClaimStatusSchema>;
95
95
 
96
96
  export const ClaimMethodSchema = z.enum(["well-known", "dns-txt"]);
@@ -109,6 +109,8 @@ export const OrgClaimSchema = z.strictObject({
109
109
  token: z.string().optional(),
110
110
  createdAt: z.string(),
111
111
  verifiedAt: z.string().optional(),
112
+ /** Set once the claim was ended by its owner or an admin (#2389). */
113
+ revokedAt: z.string().optional(),
112
114
  expiresAt: z.string(),
113
115
  instructions: z
114
116
  .strictObject({
@@ -137,6 +139,35 @@ export const ListingClaimsResultSchema = z.strictObject({
137
139
  });
138
140
  export type ListingClaimsResult = z.infer<typeof ListingClaimsResultSchema>;
139
141
 
142
+ /**
143
+ * Admin view of every claim on an org (`GET /v1/orgs/:slug/claims`, #2389).
144
+ * Never includes the proof token.
145
+ */
146
+ export const AdminOrgClaimSchema = z.strictObject({
147
+ id: z.string(),
148
+ userId: z.string(),
149
+ status: OrgClaimStatusSchema,
150
+ method: ClaimMethodSchema.nullable(),
151
+ createdAt: z.string(),
152
+ verifiedAt: z.string().nullable(),
153
+ expiresAt: z.string(),
154
+ revokedAt: z.string().nullable(),
155
+ revokedBy: z.string().nullable(),
156
+ revokeReason: z.string().nullable(),
157
+ });
158
+ export type AdminOrgClaim = z.infer<typeof AdminOrgClaimSchema>;
159
+
160
+ export const ListOrgClaimsResponseSchema = z.strictObject({
161
+ claims: z.array(AdminOrgClaimSchema),
162
+ });
163
+ export type ListOrgClaimsResponse = z.infer<typeof ListOrgClaimsResponseSchema>;
164
+
165
+ /** `DELETE /v1/orgs/:slug/claims/:id` body — admins must say why. */
166
+ export const RevokeOrgClaimBodySchema = z.strictObject({
167
+ reason: z.string().trim().min(1).max(500),
168
+ });
169
+ export type RevokeOrgClaimBody = z.infer<typeof RevokeOrgClaimBodySchema>;
170
+
140
171
  /**
141
172
  * Self-serve Tier-1 promotion (#1947 epic item 3, PR B): a verified owner
142
173
  * promotes their claimed stub to `tracked`. Independent of the internal
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * Owner-minted publish tokens (#2373): a verified domain owner mints a `relk_`
5
+ * token bound to ONE source, usable only on that source's
6
+ * `POST …/releases/batch` route (e.g. from the publish-changelog GitHub Action).
7
+ * Served by the session-only `/v1/me/publish-tokens` routes.
8
+ */
9
+
10
+ /** POST /v1/me/publish-tokens request body. */
11
+ export const CreatePublishTokenBodySchema = z.strictObject({
12
+ sourceId: z.string().min(1).max(64),
13
+ name: z.string().trim().min(1).max(200),
14
+ });
15
+ export type CreatePublishTokenBody = z.infer<typeof CreatePublishTokenBodySchema>;
16
+
17
+ /** POST /v1/me/publish-tokens 201 response. `token` is shown exactly once. */
18
+ export const CreatedPublishTokenSchema = z.strictObject({
19
+ token: z.string(),
20
+ id: z.string(),
21
+ sourceId: z.string(),
22
+ name: z.string(),
23
+ createdAt: z.string(),
24
+ });
25
+ export type CreatedPublishToken = z.infer<typeof CreatedPublishTokenSchema>;
26
+
27
+ /** One publish token as listed back to its owner — never the secret. */
28
+ export const PublishTokenSchema = z.strictObject({
29
+ id: z.string(),
30
+ name: z.string(),
31
+ sourceId: z.string(),
32
+ sourceSlug: z.string().nullable(),
33
+ orgSlug: z.string().nullable(),
34
+ createdAt: z.string(),
35
+ lastUsedAt: z.string().nullable(),
36
+ revokedAt: z.string().nullable(),
37
+ });
38
+ export type PublishToken = z.infer<typeof PublishTokenSchema>;
39
+
40
+ /** GET /v1/me/publish-tokens response. */
41
+ export const ListPublishTokensResponseSchema = z.strictObject({
42
+ publishTokens: z.array(PublishTokenSchema),
43
+ });
44
+ export type ListPublishTokensResponse = z.infer<typeof ListPublishTokensResponseSchema>;
45
+
46
+ /** DELETE /v1/me/publish-tokens/:id response. */
47
+ export const RevokePublishTokenResponseSchema = z.strictObject({
48
+ id: z.string(),
49
+ revokedAt: z.string(),
50
+ });
51
+ export type RevokePublishTokenResponse = z.infer<typeof RevokePublishTokenResponseSchema>;