@pipeline-builder/pipeline-data 4.1.15 → 4.1.17

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.
Files changed (60) hide show
  1. package/lib/api/access-control-builder.d.ts +18 -1
  2. package/lib/api/access-control-builder.js +19 -6
  3. package/lib/api/crud-service.d.ts +94 -36
  4. package/lib/api/crud-service.js +188 -166
  5. package/lib/api/plugin-resolution.d.ts +253 -0
  6. package/lib/api/plugin-resolution.js +649 -0
  7. package/lib/api/public-directory.d.ts +281 -0
  8. package/lib/api/public-directory.js +457 -0
  9. package/lib/api/query-builders.d.ts +13 -0
  10. package/lib/api/query-builders.js +74 -9
  11. package/lib/api/reporting/caches.js +4 -4
  12. package/lib/api/reporting/dora-scoring.d.ts +3 -3
  13. package/lib/api/reporting/dora-scoring.js +4 -4
  14. package/lib/api/reporting/dora.d.ts +6 -6
  15. package/lib/api/reporting/dora.js +97 -73
  16. package/lib/api/reporting/plugin-runtime.d.ts +25 -0
  17. package/lib/api/reporting/plugin-runtime.js +106 -0
  18. package/lib/api/reporting/query-scope.d.ts +8 -2
  19. package/lib/api/reporting/query-scope.js +16 -7
  20. package/lib/api/reporting/retention.d.ts +4 -10
  21. package/lib/api/reporting/retention.js +8 -11
  22. package/lib/api/reporting/sql-helpers.d.ts +4 -7
  23. package/lib/api/reporting/sql-helpers.js +8 -9
  24. package/lib/api/reporting/types.d.ts +55 -17
  25. package/lib/api/reporting/types.js +1 -1
  26. package/lib/api/reporting-service.d.ts +35 -26
  27. package/lib/api/reporting-service.js +245 -161
  28. package/lib/api/semver-range.d.ts +73 -0
  29. package/lib/api/semver-range.js +227 -0
  30. package/lib/api/soft-delete-sweep.js +8 -20
  31. package/lib/core/query-filters.d.ts +18 -3
  32. package/lib/core/query-filters.js +1 -1
  33. package/lib/database/drizzle-schema.d.ts +7790 -2461
  34. package/lib/database/drizzle-schema.js +29 -1
  35. package/lib/database/index.d.ts +4 -2
  36. package/lib/database/index.js +5 -3
  37. package/lib/database/pg-result.d.ts +19 -0
  38. package/lib/database/pg-result.js +32 -0
  39. package/lib/database/postgres-connection.js +14 -24
  40. package/lib/database/public-reader.d.ts +14 -0
  41. package/lib/database/public-reader.js +68 -0
  42. package/lib/database/retry-strategy.d.ts +3 -5
  43. package/lib/database/retry-strategy.js +4 -6
  44. package/lib/database/schema/compliance.d.ts +16 -34
  45. package/lib/database/schema/compliance.js +4 -4
  46. package/lib/database/schema/dashboard.js +4 -2
  47. package/lib/database/schema/ecosystem.d.ts +6586 -0
  48. package/lib/database/schema/ecosystem.js +709 -0
  49. package/lib/database/schema/message.d.ts +6 -12
  50. package/lib/database/schema/message.js +3 -1
  51. package/lib/database/schema/pipeline.d.ts +79 -5
  52. package/lib/database/schema/pipeline.js +46 -25
  53. package/lib/database/schema/plugin.d.ts +587 -3
  54. package/lib/database/schema/plugin.js +86 -14
  55. package/lib/database/tenancy.d.ts +6 -7
  56. package/lib/database/tenancy.js +13 -14
  57. package/lib/index.d.ts +7 -4
  58. package/lib/index.js +7 -4
  59. package/lib/testing/exports.json +146 -0
  60. package/package.json +44 -7
@@ -0,0 +1,281 @@
1
+ export type DirectoryTrustTier = 'official' | 'verified' | 'community' | 'unverified';
2
+ export type DirectoryIconKind = 'vendor' | 'uploaded' | 'monogram' | 'category';
3
+ export type DirectorySort = 'relevance' | 'rating' | 'installs' | 'updated' | 'name' | 'health';
4
+ export declare const DIRECTORY_SORTS: readonly DirectorySort[];
5
+ /** Per-component health scores: `{ score: 0..1 | null (missing), weight }`. */
6
+ export type DirectoryHealthBreakdown = Record<string, {
7
+ score: number | null;
8
+ weight: number;
9
+ }>;
10
+ export declare const DIRECTORY_TIERS: readonly DirectoryTrustTier[];
11
+ /** Minimum `word_similarity(query, name)` for a fuzzy name match (typo tolerance). */
12
+ export declare const FUZZY_NAME_THRESHOLD = 0.3;
13
+ /** Max query length accepted (longer is truncated, never an error). */
14
+ export declare const DIRECTORY_MAX_QUERY_LENGTH = 100;
15
+ export declare const DIRECTORY_DEFAULT_LIMIT = 24;
16
+ export declare const DIRECTORY_MAX_LIMIT = 60;
17
+ export interface DirectorySearchParams {
18
+ q?: string;
19
+ category?: string;
20
+ tier?: DirectoryTrustTier;
21
+ license?: string;
22
+ computeType?: string;
23
+ needsSecrets?: boolean;
24
+ minRating?: number;
25
+ sort?: DirectorySort;
26
+ cursor?: string;
27
+ limit?: number;
28
+ }
29
+ export interface DirectoryListingCard {
30
+ publisher: {
31
+ handle: string;
32
+ displayName: string;
33
+ tier: DirectoryTrustTier;
34
+ };
35
+ name: string;
36
+ summary: string;
37
+ category: string;
38
+ keywords: string[];
39
+ latestVersion: string;
40
+ license: string;
41
+ iconUrl: string | null;
42
+ iconKind: DirectoryIconKind;
43
+ iconKey: string | null;
44
+ iconHex: string | null;
45
+ iconBadge: string | null;
46
+ rating: {
47
+ score: number;
48
+ count: number;
49
+ } | null;
50
+ installCount: number;
51
+ /** 0–100 health score; null when fewer than three components are known. */
52
+ healthScore: number | null;
53
+ updatedAt: string;
54
+ state: 'listed' | 'unmaintained';
55
+ highlight?: {
56
+ name?: string;
57
+ summary?: string;
58
+ };
59
+ }
60
+ export interface DirectorySearchResult {
61
+ items: DirectoryListingCard[];
62
+ facets: {
63
+ category: Record<string, number>;
64
+ tier: Record<string, number>;
65
+ license: Record<string, number>;
66
+ computeType: Record<string, number>;
67
+ needsSecrets: {
68
+ true: number;
69
+ false: number;
70
+ };
71
+ };
72
+ total: number;
73
+ nextCursor: string | null;
74
+ }
75
+ export interface DirectoryCategorySummary {
76
+ id: string;
77
+ count: number;
78
+ top: DirectoryListingCard[];
79
+ }
80
+ export interface DirectoryListingVersion {
81
+ version: string;
82
+ publishedAt: string;
83
+ breaking: boolean;
84
+ deprecated: boolean;
85
+ deprecationMessage: string | null;
86
+ yanked: boolean;
87
+ changelog: string | null;
88
+ vulnCritical: number | null;
89
+ vulnHigh: number | null;
90
+ scannedAt: string | null;
91
+ /** Ids of the published advisories whose range covers this version. */
92
+ advisoryIds: string[];
93
+ }
94
+ export interface DirectoryListingDetail extends DirectoryListingCard {
95
+ readmeHtml: string | null;
96
+ description: string;
97
+ homepageUrl: string | null;
98
+ sourceUrl: string | null;
99
+ versions: DirectoryListingVersion[];
100
+ configuration: {
101
+ secrets: {
102
+ name: string;
103
+ required: boolean;
104
+ description: string;
105
+ }[];
106
+ requiredMetadata: string[];
107
+ requiredVars: string[];
108
+ computeType: string;
109
+ primaryOutputDirectory: string | null;
110
+ networkEgress: string[];
111
+ pluginType: string;
112
+ };
113
+ supplyChain: {
114
+ signed: boolean;
115
+ digest: string | null;
116
+ imageSource: string | null;
117
+ scannedAt: string | null;
118
+ vulnCritical: number | null;
119
+ vulnHigh: number | null;
120
+ sbomUrl: string | null;
121
+ };
122
+ advisories: {
123
+ id: string;
124
+ severity: string;
125
+ summary: string;
126
+ affectedRange: string;
127
+ fixedVersion: string | null;
128
+ publishedAt: string;
129
+ /** Server-sanitized HTML (the stored render of the details markdown). */
130
+ detailsHtml: string | null;
131
+ cveIds: string[];
132
+ }[];
133
+ ratingDistribution: Record<'1' | '2' | '3' | '4' | '5', number> | null;
134
+ /** The Bayesian rating over reviews of the last two minor versions. */
135
+ recentRating: number | null;
136
+ activeOrgCount: number | null;
137
+ /** Per-component health scores behind {@link DirectoryListingCard.healthScore}. */
138
+ healthBreakdown: DirectoryHealthBreakdown | null;
139
+ /** 30-day runtime success rate (0..1), or null with no runs. */
140
+ successRate30d: number | null;
141
+ }
142
+ export type ReviewSort = 'helpful' | 'recent' | 'highest' | 'lowest';
143
+ export declare const REVIEW_SORTS: readonly ReviewSort[];
144
+ export declare const REVIEWS_DEFAULT_LIMIT = 10;
145
+ export declare const REVIEWS_MAX_LIMIT = 50;
146
+ export interface PublicReviewReply {
147
+ bodyHtml: string;
148
+ publisherDisplayName: string;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ }
152
+ /** One published review as the directory shows it: display name only, never an org. */
153
+ export interface PublicReviewItem {
154
+ id: string;
155
+ rating: number;
156
+ title: string | null;
157
+ bodyHtml: string | null;
158
+ version: string | null;
159
+ /** Null once the author's account was deleted (the review is anonymized). */
160
+ author: {
161
+ displayName: string;
162
+ } | null;
163
+ verifiedUse: boolean;
164
+ helpfulCount: number;
165
+ edited: boolean;
166
+ createdAt: string;
167
+ updatedAt: string;
168
+ reply: PublicReviewReply | null;
169
+ }
170
+ export interface PublicReviewPage {
171
+ reviews: PublicReviewItem[];
172
+ total: number;
173
+ nextCursor: string | null;
174
+ }
175
+ export interface PublicReviewQuery {
176
+ sort?: ReviewSort;
177
+ /** Only reviews with exactly this many stars. */
178
+ rating?: number;
179
+ cursor?: string;
180
+ limit?: number;
181
+ }
182
+ /** A `public_listings` row as the raw queries return it (snake_case). */
183
+ export interface PublicListingRow {
184
+ id: string;
185
+ publisher_handle: string;
186
+ publisher_display_name: string;
187
+ publisher_tier: DirectoryTrustTier;
188
+ name: string;
189
+ category: string;
190
+ summary: string | null;
191
+ description: string | null;
192
+ readme_html: string | null;
193
+ license: string | null;
194
+ homepage_url: string | null;
195
+ source_url: string | null;
196
+ icon: {
197
+ key: string;
198
+ badge?: string;
199
+ } | null;
200
+ uploaded_icon: {
201
+ key256: string;
202
+ key64: string;
203
+ } | null;
204
+ keywords: string[] | null;
205
+ latest_version: string | null;
206
+ updated_at: Date | string;
207
+ rating_bayes: number | string | null;
208
+ rating_count: number | string;
209
+ rating_dist: Record<string, number> | null;
210
+ recent_rating?: number | string | null;
211
+ install_count: number | string;
212
+ active_org_count: number | string | null;
213
+ health_score?: number | string | null;
214
+ health_breakdown?: DirectoryHealthBreakdown | null;
215
+ success_rate_30d?: number | string | null;
216
+ state: 'listed' | 'unmaintained';
217
+ }
218
+ /**
219
+ * The icon fallback chain: uploaded (if the tier may upload) → curated
220
+ * vendor key (Official, and Verified publishers for marks they own — ownership
221
+ * is checked when the icon is approved) → monogram. Community and anonymous
222
+ * listings can never show a curated vendor mark.
223
+ */
224
+ export declare function resolveListingIcon(row: Pick<PublicListingRow, 'publisher_tier' | 'icon' | 'uploaded_icon'>): Pick<DirectoryListingCard, 'iconKind' | 'iconUrl' | 'iconKey' | 'iconBadge' | 'iconHex'>;
225
+ export declare function toListingCard(row: PublicListingRow): DirectoryListingCard;
226
+ /** Normalize the user's query: collapse whitespace, cap the length. */
227
+ export declare function normalizeQuery(q: string | undefined): string;
228
+ /**
229
+ * Wrap matched terms in `<mark>`. The frontend renders everything except the
230
+ * `<mark>` markers as TEXT (never HTML), so the source text is not escaped here.
231
+ * Returns undefined when nothing matched (the card then renders plain text).
232
+ */
233
+ export declare function highlightText(text: string, q: string): string | undefined;
234
+ /** Opaque cursor: an offset, base64url-encoded so clients don't depend on it. */
235
+ export declare function encodeOffsetCursor(offset: number): string;
236
+ export declare function decodeOffsetCursor(cursor: string | undefined): number;
237
+ /** Search the directory: one page of cards, facet counts, total and next cursor. */
238
+ export declare function searchPublicListings(params: DirectorySearchParams): Promise<DirectorySearchResult>;
239
+ /** Every category with its live count and its top listings (by rating, then installs). */
240
+ export declare function listPublicCategories(topPerCategory?: number): Promise<DirectoryCategorySummary[]>;
241
+ /**
242
+ * One listing's page data, or null when it isn't public (unknown, suspended,
243
+ * transferred, paused by its publisher — or its publisher is suspended).
244
+ */
245
+ export declare function getPublicListing(publisherHandle: string, name: string): Promise<DirectoryListingDetail | null>;
246
+ /** One listed version's public image identity (for the SBOM download), or null. */
247
+ export declare function getPublicListedVersion(publisherHandle: string, name: string, version: string): Promise<{
248
+ imageRepository: string;
249
+ imageDigest: string;
250
+ } | null>;
251
+ type ReviewRow = {
252
+ id: string;
253
+ version: string | null;
254
+ rating: number | string;
255
+ title: string | null;
256
+ body_html: string | null;
257
+ author_display_name: string | null;
258
+ verified_use: boolean;
259
+ helpful_count: number | string;
260
+ edited: boolean;
261
+ created_at: Date | string;
262
+ updated_at: Date | string;
263
+ publisher_display_name: string;
264
+ reply_body_html: string | null;
265
+ reply_created_at: Date | string | null;
266
+ reply_updated_at: Date | string | null;
267
+ total: number | string;
268
+ };
269
+ export declare function toPublicReview(row: Omit<ReviewRow, 'total'>): PublicReviewItem;
270
+ /**
271
+ * One page of a listing's published reviews (the directory's Reviews tab), or null
272
+ * when the listing isn't public. Held and removed reviews never reach the view.
273
+ */
274
+ export declare function listPublicReviews(publisherHandle: string, name: string, query?: PublicReviewQuery): Promise<PublicReviewPage | null>;
275
+ /** Every public listing's URL parts + last update, for the sitemap. */
276
+ export declare function listPublicListingsForSitemap(max?: number): Promise<{
277
+ publisher: string;
278
+ name: string;
279
+ updatedAt: string;
280
+ }[]>;
281
+ export {};