@buildinternet/releases-api-types 0.38.0 → 0.39.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 +1 -1
- package/src/api-types.ts +15 -0
- package/src/schemas/listing.ts +76 -0
- package/src/schemas/orgs.ts +6 -0
package/package.json
CHANGED
package/src/api-types.ts
CHANGED
|
@@ -334,6 +334,21 @@ export type {
|
|
|
334
334
|
ReleasesJsonRepo,
|
|
335
335
|
ReleasesJsonRepoRelease,
|
|
336
336
|
} from "./schemas/well-known.js";
|
|
337
|
+
export {
|
|
338
|
+
ListingValidateBodySchema,
|
|
339
|
+
ListingActivateBodySchema,
|
|
340
|
+
ListingIssueSchema,
|
|
341
|
+
ListingLocationSchema,
|
|
342
|
+
ListingOrgPointerSchema,
|
|
343
|
+
ListingValidationResultSchema,
|
|
344
|
+
ListingActivateResultSchema,
|
|
345
|
+
type ListingValidateBody,
|
|
346
|
+
type ListingActivateBody,
|
|
347
|
+
type ListingIssue,
|
|
348
|
+
type ListingLocation,
|
|
349
|
+
type ListingValidationResult,
|
|
350
|
+
type ListingActivateResult,
|
|
351
|
+
} from "./schemas/listing.js";
|
|
337
352
|
export {
|
|
338
353
|
SourceListItemSchema,
|
|
339
354
|
SourceWithOrgSchema,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public wire contract for the self-serve listing lane (#1947 phase 2):
|
|
5
|
+
* POST /v1/listing/validate and POST /v1/listing/activate. This projection is
|
|
6
|
+
* deliberately independent of the internal materialization plan — it is the
|
|
7
|
+
* stable shape web/CLI consume while internals stay free to change.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const ListingValidateBodySchema = z.strictObject({
|
|
11
|
+
domain: z.string().min(1).max(255),
|
|
12
|
+
});
|
|
13
|
+
export type ListingValidateBody = z.infer<typeof ListingValidateBodySchema>;
|
|
14
|
+
|
|
15
|
+
export const ListingActivateBodySchema = z.strictObject({
|
|
16
|
+
domain: z.string().min(1).max(255),
|
|
17
|
+
requestTracking: z.boolean().optional(),
|
|
18
|
+
});
|
|
19
|
+
export type ListingActivateBody = z.infer<typeof ListingActivateBodySchema>;
|
|
20
|
+
|
|
21
|
+
export const ListingIssueSchema = z.strictObject({
|
|
22
|
+
path: z.string(),
|
|
23
|
+
message: z.string(),
|
|
24
|
+
});
|
|
25
|
+
export type ListingIssue = z.infer<typeof ListingIssueSchema>;
|
|
26
|
+
|
|
27
|
+
export const ListingLocationSchema = z.strictObject({
|
|
28
|
+
/** The declared locator value (feed URL, github ref, url, appstore id, file). */
|
|
29
|
+
locator: z.string(),
|
|
30
|
+
kind: z.enum(["feed", "github", "appstore", "url", "file"]),
|
|
31
|
+
classification: z.enum(["tier1-live", "tier2-paused-review"]),
|
|
32
|
+
/** Plain-English "what this becomes" for the preview UI. */
|
|
33
|
+
becomes: z.string(),
|
|
34
|
+
/** Present when the locator is nested under a manifest product. */
|
|
35
|
+
productName: z.string().optional(),
|
|
36
|
+
});
|
|
37
|
+
export type ListingLocation = z.infer<typeof ListingLocationSchema>;
|
|
38
|
+
|
|
39
|
+
export const ListingOrgPointerSchema = z.strictObject({
|
|
40
|
+
slug: z.string(),
|
|
41
|
+
name: z.string(),
|
|
42
|
+
webUrl: z.string(),
|
|
43
|
+
});
|
|
44
|
+
export type ListingOrgPointer = z.infer<typeof ListingOrgPointerSchema>;
|
|
45
|
+
|
|
46
|
+
export const ListingValidationResultSchema = z.strictObject({
|
|
47
|
+
valid: z.boolean(),
|
|
48
|
+
errors: z.array(ListingIssueSchema),
|
|
49
|
+
domainStatus: z.enum(["unlisted", "listed", "stub"]),
|
|
50
|
+
/** Present when domainStatus is "listed" or "stub". */
|
|
51
|
+
org: ListingOrgPointerSchema.optional(),
|
|
52
|
+
/** Present when valid: identity fields as they would land. */
|
|
53
|
+
identity: z
|
|
54
|
+
.strictObject({
|
|
55
|
+
name: z.string(),
|
|
56
|
+
slug: z.string(),
|
|
57
|
+
domain: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.optional(),
|
|
60
|
+
products: z.array(z.strictObject({ name: z.string(), locationCount: z.number() })).optional(),
|
|
61
|
+
locations: z.array(ListingLocationSchema),
|
|
62
|
+
});
|
|
63
|
+
export type ListingValidationResult = z.infer<typeof ListingValidationResultSchema>;
|
|
64
|
+
|
|
65
|
+
export const ListingActivateResultSchema = z.strictObject({
|
|
66
|
+
/** True when this call created the stub; false for the existing-stub carve-out. */
|
|
67
|
+
activated: z.boolean(),
|
|
68
|
+
org: z.strictObject({
|
|
69
|
+
slug: z.string(),
|
|
70
|
+
name: z.string(),
|
|
71
|
+
status: z.enum(["stub", "tracked"]),
|
|
72
|
+
webUrl: z.string(),
|
|
73
|
+
}),
|
|
74
|
+
trackingRequested: z.boolean(),
|
|
75
|
+
});
|
|
76
|
+
export type ListingActivateResult = z.infer<typeof ListingActivateResultSchema>;
|
package/src/schemas/orgs.ts
CHANGED
|
@@ -38,6 +38,12 @@ export const OrgListItemSchema = z.object({
|
|
|
38
38
|
lastActivity: z.string().nullable(),
|
|
39
39
|
topProducts: z.array(z.string()),
|
|
40
40
|
sparkline: z.array(z.number().int().min(0)).length(30),
|
|
41
|
+
/**
|
|
42
|
+
* Additive, admin-only field (#1947 phase 2). Only populated on the
|
|
43
|
+
* `GET /v1/orgs?trackingRequested=1` demand-queue projection — absent on
|
|
44
|
+
* the public catalog listing.
|
|
45
|
+
*/
|
|
46
|
+
trackingRequestedAt: z.string().nullable().optional(),
|
|
41
47
|
});
|
|
42
48
|
|
|
43
49
|
/**
|