@buildinternet/releases-api-types 0.55.0 → 0.56.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 +2 -2
- package/src/api-types.ts +12 -0
- package/src/schemas/publish-tokens.ts +51 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildinternet/releases-api-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.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.
|
|
20
|
+
"@buildinternet/releases-core": "^0.32.0",
|
|
21
21
|
"zod": "^4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
package/src/api-types.ts
CHANGED
|
@@ -433,6 +433,18 @@ export {
|
|
|
433
433
|
type ListingPromoteResult,
|
|
434
434
|
type ListingCapabilities,
|
|
435
435
|
} from "./schemas/listing.js";
|
|
436
|
+
export {
|
|
437
|
+
CreatePublishTokenBodySchema,
|
|
438
|
+
CreatedPublishTokenSchema,
|
|
439
|
+
PublishTokenSchema,
|
|
440
|
+
ListPublishTokensResponseSchema,
|
|
441
|
+
RevokePublishTokenResponseSchema,
|
|
442
|
+
type CreatePublishTokenBody,
|
|
443
|
+
type CreatedPublishToken,
|
|
444
|
+
type PublishToken,
|
|
445
|
+
type ListPublishTokensResponse,
|
|
446
|
+
type RevokePublishTokenResponse,
|
|
447
|
+
} from "./schemas/publish-tokens.js";
|
|
436
448
|
export {
|
|
437
449
|
SourceListItemSchema,
|
|
438
450
|
SourceWithOrgSchema,
|
|
@@ -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>;
|