@pg-atlas/data-sdk 0.6.0 → 0.8.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.
@@ -1,5 +1,5 @@
1
- import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { GetContributorData, GetContributorErrors, GetContributorResponses, GetGitlogArtifactData, GetGitlogArtifactErrors, GetGitlogArtifactResponses, GetMetadataData, GetMetadataResponses, GetProjectContributorsData, GetProjectContributorsErrors, GetProjectContributorsResponses, GetProjectData, GetProjectDependsOnData, GetProjectDependsOnErrors, GetProjectDependsOnResponses, GetProjectErrors, GetProjectHasDependentsData, GetProjectHasDependentsErrors, GetProjectHasDependentsResponses, GetProjectReposData, GetProjectReposErrors, GetProjectReposResponses, GetProjectResponses, GetRepoContributorsData, GetRepoContributorsErrors, GetRepoContributorsResponses, GetRepoData, GetRepoDependsOnData, GetRepoDependsOnErrors, GetRepoDependsOnResponses, GetRepoErrors, GetRepoHasDependentsData, GetRepoHasDependentsErrors, GetRepoHasDependentsResponses, GetRepoResponses, GetSbomSubmissionData, GetSbomSubmissionErrors, GetSbomSubmissionResponses, HealthData, HealthResponses, IngestSbomData, IngestSbomErrors, IngestSbomResponses, ListContributorsData, ListContributorsErrors, ListContributorsResponses, ListGitlogArtifactsData, ListGitlogArtifactsErrors, ListGitlogArtifactsResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListReposData, ListReposErrors, ListReposResponses, ListSbomSubmissionsData, ListSbomSubmissionsErrors, ListSbomSubmissionsResponses } from './types.gen';
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
2
+ import type { GetContributorData, GetContributorErrors, GetContributorResponses, GetGitlogArtifactData, GetGitlogArtifactErrors, GetGitlogArtifactResponses, GetMetadataData, GetMetadataResponses, GetProjectContributorsData, GetProjectContributorsErrors, GetProjectContributorsResponses, GetProjectData, GetProjectDependsOnData, GetProjectDependsOnErrors, GetProjectDependsOnResponses, GetProjectErrors, GetProjectHasDependentsData, GetProjectHasDependentsErrors, GetProjectHasDependentsResponses, GetProjectReposData, GetProjectReposErrors, GetProjectReposResponses, GetProjectResponses, GetRepoContributorsData, GetRepoContributorsErrors, GetRepoContributorsResponses, GetRepoData, GetRepoDependsOnData, GetRepoDependsOnErrors, GetRepoDependsOnResponses, GetRepoErrors, GetRepoGithubDependentsData, GetRepoGithubDependentsErrors, GetRepoGithubDependentsResponses, GetRepoHasDependentsData, GetRepoHasDependentsErrors, GetRepoHasDependentsResponses, GetRepoMaintenanceProfileData, GetRepoMaintenanceProfileErrors, GetRepoMaintenanceProfileResponses, GetRepoResponses, GetSbomSubmissionData, GetSbomSubmissionErrors, GetSbomSubmissionResponses, HealthData, HealthResponses, IngestSbomData, IngestSbomErrors, IngestSbomResponses, ListContributorsData, ListContributorsErrors, ListContributorsResponses, ListGitlogArtifactsData, ListGitlogArtifactsErrors, ListGitlogArtifactsResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListReposData, ListReposErrors, ListReposResponses, ListSbomSubmissionsData, ListSbomSubmissionsErrors, ListSbomSubmissionsResponses } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -11,32 +11,32 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
11
11
  * You can pass arbitrary values through the `meta` object. This can be
12
12
  * used to access values that aren't defined as part of the SDK function.
13
13
  */
14
- meta?: Record<string, unknown>;
14
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
15
15
  };
16
16
  /**
17
17
  * Readiness check
18
18
  *
19
19
  * Return the current readiness status and application version.
20
20
  */
21
- export declare const health: <ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>) => import("./client").RequestResult<HealthResponses, unknown, ThrowOnError, "fields">;
21
+ export declare const health: <ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>) => RequestResult<HealthResponses, unknown, ThrowOnError>;
22
22
  /**
23
23
  * List SBOM submissions
24
24
  *
25
25
  * Returns a paginated list of SBOM submission records. Supports optional filtering by ``repository`` claim and pagination via ``limit`` / ``offset`` query parameters. Does not require authentication.
26
26
  */
27
- export declare const listSbomSubmissions: <ThrowOnError extends boolean = false>(options?: Options<ListSbomSubmissionsData, ThrowOnError>) => import("./client").RequestResult<ListSbomSubmissionsResponses, ListSbomSubmissionsErrors, ThrowOnError, "fields">;
27
+ export declare const listSbomSubmissions: <ThrowOnError extends boolean = false>(options?: Options<ListSbomSubmissionsData, ThrowOnError>) => RequestResult<ListSbomSubmissionsResponses, ListSbomSubmissionsErrors, ThrowOnError>;
28
28
  /**
29
29
  * Submit an SPDX 2.3 SBOM
30
30
  *
31
31
  * Accepts an SPDX 2.3 JSON SBOM document from the pg-atlas-sbom-action. Requires a valid GitHub OIDC Bearer token with `aud` set to the PG Atlas API URL. The submitting repository is identified from the token's `repository` claim — no additional configuration is required in the calling repo beyond `permissions: id-token: write`.
32
32
  */
33
- export declare const ingestSbom: <ThrowOnError extends boolean = false>(options?: Options<IngestSbomData, ThrowOnError>) => import("./client").RequestResult<IngestSbomResponses, IngestSbomErrors, ThrowOnError, "fields">;
33
+ export declare const ingestSbom: <ThrowOnError extends boolean = false>(options?: Options<IngestSbomData, ThrowOnError>) => RequestResult<IngestSbomResponses, IngestSbomErrors, ThrowOnError>;
34
34
  /**
35
35
  * Get SBOM submission detail
36
36
  *
37
37
  * Returns a single SBOM submission record along with the raw artifact content read from the backing store. If the artifact file is missing, the ``raw_artifact`` field is ``null``. Does not require authentication.
38
38
  */
39
- export declare const getSbomSubmission: <ThrowOnError extends boolean = false>(options: Options<GetSbomSubmissionData, ThrowOnError>) => import("./client").RequestResult<GetSbomSubmissionResponses, GetSbomSubmissionErrors, ThrowOnError, "fields">;
39
+ export declare const getSbomSubmission: <ThrowOnError extends boolean = false>(options: Options<GetSbomSubmissionData, ThrowOnError>) => RequestResult<GetSbomSubmissionResponses, GetSbomSubmissionErrors, ThrowOnError>;
40
40
  /**
41
41
  * Ecosystem summary statistics
42
42
  *
@@ -45,7 +45,7 @@ export declare const getSbomSubmission: <ThrowOnError extends boolean = false>(o
45
45
  * Counts are computed on-the-fly via simple ``COUNT(*)`` queries. No
46
46
  * caching is applied in this dev version — queries hit the DB directly.
47
47
  */
48
- export declare const getMetadata: <ThrowOnError extends boolean = false>(options?: Options<GetMetadataData, ThrowOnError>) => import("./client").RequestResult<GetMetadataResponses, unknown, ThrowOnError, "fields">;
48
+ export declare const getMetadata: <ThrowOnError extends boolean = false>(options?: Options<GetMetadataData, ThrowOnError>) => RequestResult<GetMetadataResponses, unknown, ThrowOnError>;
49
49
  /**
50
50
  * List projects
51
51
  *
@@ -58,16 +58,7 @@ export declare const getMetadata: <ThrowOnError extends boolean = false>(options
58
58
  * - **category**: filter by exact project category string.
59
59
  * - Default order is `canonical_id` for deterministic pagination.
60
60
  */
61
- export declare const listProjects: <ThrowOnError extends boolean = false>(options?: Options<ListProjectsData, ThrowOnError>) => import("./client").RequestResult<ListProjectsResponses, ListProjectsErrors, ThrowOnError, "fields">;
62
- /**
63
- * Project detail
64
- *
65
- * Full detail for a single project, including validated metadata.
66
- *
67
- * The ``metadata`` field is the normalised form of the raw JSONB column —
68
- * unknown keys from the crawler are passed through via ``extra="allow"``.
69
- */
70
- export declare const getProject: <ThrowOnError extends boolean = false>(options: Options<GetProjectData, ThrowOnError>) => import("./client").RequestResult<GetProjectResponses, GetProjectErrors, ThrowOnError, "fields">;
61
+ export declare const listProjects: <ThrowOnError extends boolean = false>(options?: Options<ListProjectsData, ThrowOnError>) => RequestResult<ListProjectsResponses, ListProjectsErrors, ThrowOnError>;
71
62
  /**
72
63
  * Repos belonging to a project
73
64
  *
@@ -75,13 +66,13 @@ export declare const getProject: <ThrowOnError extends boolean = false>(options:
75
66
  *
76
67
  * Returns 404 if the project does not exist.
77
68
  */
78
- export declare const getProjectRepos: <ThrowOnError extends boolean = false>(options: Options<GetProjectReposData, ThrowOnError>) => import("./client").RequestResult<GetProjectReposResponses, GetProjectReposErrors, ThrowOnError, "fields">;
69
+ export declare const getProjectRepos: <ThrowOnError extends boolean = false>(options: Options<GetProjectReposData, ThrowOnError>) => RequestResult<GetProjectReposResponses, GetProjectReposErrors, ThrowOnError>;
79
70
  /**
80
71
  * Contributors across a project's repos
81
72
  *
82
73
  * Paginated contributors aggregated across all repos belonging to the project.
83
74
  */
84
- export declare const getProjectContributors: <ThrowOnError extends boolean = false>(options: Options<GetProjectContributorsData, ThrowOnError>) => import("./client").RequestResult<GetProjectContributorsResponses, GetProjectContributorsErrors, ThrowOnError, "fields">;
75
+ export declare const getProjectContributors: <ThrowOnError extends boolean = false>(options: Options<GetProjectContributorsData, ThrowOnError>) => RequestResult<GetProjectContributorsResponses, GetProjectContributorsErrors, ThrowOnError>;
85
76
  /**
86
77
  * Project-level dependencies
87
78
  *
@@ -92,7 +83,7 @@ export declare const getProjectContributors: <ThrowOnError extends boolean = fal
92
83
  * the two projects. Self-references and edges to external repos (which have no
93
84
  * project) are excluded.
94
85
  */
95
- export declare const getProjectDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetProjectDependsOnData, ThrowOnError>) => import("./client").RequestResult<GetProjectDependsOnResponses, GetProjectDependsOnErrors, ThrowOnError, "fields">;
86
+ export declare const getProjectDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetProjectDependsOnData, ThrowOnError>) => RequestResult<GetProjectDependsOnResponses, GetProjectDependsOnErrors, ThrowOnError>;
96
87
  /**
97
88
  * Projects that depend on this project
98
89
  *
@@ -101,7 +92,16 @@ export declare const getProjectDependsOn: <ThrowOnError extends boolean = false>
101
92
  * Same aggregation as ``depends-on`` but in the reverse direction: which
102
93
  * other projects have repos that depend on repos of *this* project.
103
94
  */
104
- export declare const getProjectHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetProjectHasDependentsData, ThrowOnError>) => import("./client").RequestResult<GetProjectHasDependentsResponses, GetProjectHasDependentsErrors, ThrowOnError, "fields">;
95
+ export declare const getProjectHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetProjectHasDependentsData, ThrowOnError>) => RequestResult<GetProjectHasDependentsResponses, GetProjectHasDependentsErrors, ThrowOnError>;
96
+ /**
97
+ * Project detail
98
+ *
99
+ * Full detail for a single project, including validated metadata.
100
+ *
101
+ * The ``metadata`` field is the normalised form of the raw JSONB column —
102
+ * unknown keys from the crawler are passed through via ``extra="allow"``.
103
+ */
104
+ export declare const getProject: <ThrowOnError extends boolean = false>(options: Options<GetProjectData, ThrowOnError>) => RequestResult<GetProjectResponses, GetProjectErrors, ThrowOnError>;
105
105
  /**
106
106
  * List repos
107
107
  *
@@ -112,7 +112,7 @@ export declare const getProjectHasDependents: <ThrowOnError extends boolean = fa
112
112
  * - **sort**: comma-separated `field:direction` pairs for server-side ordering.
113
113
  * - Default order is `canonical_id` for deterministic pagination.
114
114
  */
115
- export declare const listRepos: <ThrowOnError extends boolean = false>(options?: Options<ListReposData, ThrowOnError>) => import("./client").RequestResult<ListReposResponses, ListReposErrors, ThrowOnError, "fields">;
115
+ export declare const listRepos: <ThrowOnError extends boolean = false>(options?: Options<ListReposData, ThrowOnError>) => RequestResult<ListReposResponses, ListReposErrors, ThrowOnError>;
116
116
  /**
117
117
  * Direct dependencies of a repo
118
118
  *
@@ -121,7 +121,7 @@ export declare const listRepos: <ThrowOnError extends boolean = false>(options?:
121
121
  * Each entry includes the target vertex's canonical ID, display name,
122
122
  * type (``repo`` or ``external-repo``), version range, and confidence level.
123
123
  */
124
- export declare const getRepoDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetRepoDependsOnData, ThrowOnError>) => import("./client").RequestResult<GetRepoDependsOnResponses, GetRepoDependsOnErrors, ThrowOnError, "fields">;
124
+ export declare const getRepoDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetRepoDependsOnData, ThrowOnError>) => RequestResult<GetRepoDependsOnResponses, GetRepoDependsOnErrors, ThrowOnError>;
125
125
  /**
126
126
  * Repos that depend on this repo
127
127
  *
@@ -130,26 +130,48 @@ export declare const getRepoDependsOn: <ThrowOnError extends boolean = false>(op
130
130
  * Each entry includes the source vertex's canonical ID, display name,
131
131
  * type, version range, and confidence level.
132
132
  */
133
- export declare const getRepoHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetRepoHasDependentsData, ThrowOnError>) => import("./client").RequestResult<GetRepoHasDependentsResponses, GetRepoHasDependentsErrors, ThrowOnError, "fields">;
133
+ export declare const getRepoHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetRepoHasDependentsData, ThrowOnError>) => RequestResult<GetRepoHasDependentsResponses, GetRepoHasDependentsErrors, ThrowOnError>;
134
+ /**
135
+ * Public GitHub dependents observed for a repo
136
+ *
137
+ * Active GitHub dependents observations plus freshness/completeness summary.
138
+ *
139
+ * Collection/audit data scraped from the public GitHub dependents page.
140
+ * Deliberately separate from the dependency-graph ``has-dependents``
141
+ * endpoint: observations are not ``DependsOn`` relationships and feed no
142
+ * metric. Retired observations are not exposed here.
143
+ */
144
+ export declare const getRepoGithubDependents: <ThrowOnError extends boolean = false>(options: Options<GetRepoGithubDependentsData, ThrowOnError>) => RequestResult<GetRepoGithubDependentsResponses, GetRepoGithubDependentsErrors, ThrowOnError>;
145
+ /**
146
+ * Maintenance profile for a repo
147
+ *
148
+ * Per-signal maintenance values with coverage states and percentile ranks.
149
+ *
150
+ * Serves the profile written by the gated materializer. Every ranked value
151
+ * carries its coverage state and, when ranked, its percentile and pool
152
+ * size; the profile carries its as-of and the parameters it was computed
153
+ * under. 404 while no profile has been materialized for the repository.
154
+ */
155
+ export declare const getRepoMaintenanceProfile: <ThrowOnError extends boolean = false>(options: Options<GetRepoMaintenanceProfileData, ThrowOnError>) => RequestResult<GetRepoMaintenanceProfileResponses, GetRepoMaintenanceProfileErrors, ThrowOnError>;
134
156
  /**
135
157
  * Contributors for a repo
136
158
  *
137
159
  * Paginated contributors for one repo with commit-count and commit-date spans.
138
160
  */
139
- export declare const getRepoContributors: <ThrowOnError extends boolean = false>(options: Options<GetRepoContributorsData, ThrowOnError>) => import("./client").RequestResult<GetRepoContributorsResponses, GetRepoContributorsErrors, ThrowOnError, "fields">;
161
+ export declare const getRepoContributors: <ThrowOnError extends boolean = false>(options: Options<GetRepoContributorsData, ThrowOnError>) => RequestResult<GetRepoContributorsResponses, GetRepoContributorsErrors, ThrowOnError>;
140
162
  /**
141
163
  * Repo detail
142
164
  *
143
165
  * Full detail for a single repo including parent project, contributors,
144
166
  * releases, and dependency counts.
145
167
  */
146
- export declare const getRepo: <ThrowOnError extends boolean = false>(options: Options<GetRepoData, ThrowOnError>) => import("./client").RequestResult<GetRepoResponses, GetRepoErrors, ThrowOnError, "fields">;
168
+ export declare const getRepo: <ThrowOnError extends boolean = false>(options: Options<GetRepoData, ThrowOnError>) => RequestResult<GetRepoResponses, GetRepoErrors, ThrowOnError>;
147
169
  /**
148
170
  * List contributors
149
171
  *
150
172
  * Paginated contributor list with optional case-insensitive name filtering.
151
173
  */
152
- export declare const listContributors: <ThrowOnError extends boolean = false>(options?: Options<ListContributorsData, ThrowOnError>) => import("./client").RequestResult<ListContributorsResponses, ListContributorsErrors, ThrowOnError, "fields">;
174
+ export declare const listContributors: <ThrowOnError extends boolean = false>(options?: Options<ListContributorsData, ThrowOnError>) => RequestResult<ListContributorsResponses, ListContributorsErrors, ThrowOnError>;
153
175
  /**
154
176
  * Contributor detail
155
177
  *
@@ -160,16 +182,16 @@ export declare const listContributors: <ThrowOnError extends boolean = false>(op
160
182
  * ``first_contribution`` / ``last_contribution`` are the earliest and latest
161
183
  * commit dates across all repos.
162
184
  */
163
- export declare const getContributor: <ThrowOnError extends boolean = false>(options: Options<GetContributorData, ThrowOnError>) => import("./client").RequestResult<GetContributorResponses, GetContributorErrors, ThrowOnError, "fields">;
185
+ export declare const getContributor: <ThrowOnError extends boolean = false>(options: Options<GetContributorData, ThrowOnError>) => RequestResult<GetContributorResponses, GetContributorErrors, ThrowOnError>;
164
186
  /**
165
187
  * List gitlog processing attempts
166
188
  *
167
189
  * Paginated list of gitlog processing attempts with optional repo filter.
168
190
  */
169
- export declare const listGitlogArtifacts: <ThrowOnError extends boolean = false>(options?: Options<ListGitlogArtifactsData, ThrowOnError>) => import("./client").RequestResult<ListGitlogArtifactsResponses, ListGitlogArtifactsErrors, ThrowOnError, "fields">;
191
+ export declare const listGitlogArtifacts: <ThrowOnError extends boolean = false>(options?: Options<ListGitlogArtifactsData, ThrowOnError>) => RequestResult<ListGitlogArtifactsResponses, ListGitlogArtifactsErrors, ThrowOnError>;
170
192
  /**
171
193
  * Get gitlog processing attempt detail
172
194
  *
173
195
  * Return one gitlog attempt record with its raw artifact content when available.
174
196
  */
175
- export declare const getGitlogArtifact: <ThrowOnError extends boolean = false>(options: Options<GetGitlogArtifactData, ThrowOnError>) => import("./client").RequestResult<GetGitlogArtifactResponses, GetGitlogArtifactErrors, ThrowOnError, "fields">;
197
+ export declare const getGitlogArtifact: <ThrowOnError extends boolean = false>(options: Options<GetGitlogArtifactData, ThrowOnError>) => RequestResult<GetGitlogArtifactResponses, GetGitlogArtifactErrors, ThrowOnError>;
@@ -46,15 +46,6 @@ export const getMetadata = (options) => (options?.client ?? client).get({ url: '
46
46
  * - Default order is `canonical_id` for deterministic pagination.
47
47
  */
48
48
  export const listProjects = (options) => (options?.client ?? client).get({ url: '/projects', ...options });
49
- /**
50
- * Project detail
51
- *
52
- * Full detail for a single project, including validated metadata.
53
- *
54
- * The ``metadata`` field is the normalised form of the raw JSONB column —
55
- * unknown keys from the crawler are passed through via ``extra="allow"``.
56
- */
57
- export const getProject = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}', ...options });
58
49
  /**
59
50
  * Repos belonging to a project
60
51
  *
@@ -89,6 +80,15 @@ export const getProjectDependsOn = (options) => (options.client ?? client).get({
89
80
  * other projects have repos that depend on repos of *this* project.
90
81
  */
91
82
  export const getProjectHasDependents = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}/has-dependents', ...options });
83
+ /**
84
+ * Project detail
85
+ *
86
+ * Full detail for a single project, including validated metadata.
87
+ *
88
+ * The ``metadata`` field is the normalised form of the raw JSONB column —
89
+ * unknown keys from the crawler are passed through via ``extra="allow"``.
90
+ */
91
+ export const getProject = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}', ...options });
92
92
  /**
93
93
  * List repos
94
94
  *
@@ -118,6 +118,28 @@ export const getRepoDependsOn = (options) => (options.client ?? client).get({ ur
118
118
  * type, version range, and confidence level.
119
119
  */
120
120
  export const getRepoHasDependents = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}/has-dependents', ...options });
121
+ /**
122
+ * Public GitHub dependents observed for a repo
123
+ *
124
+ * Active GitHub dependents observations plus freshness/completeness summary.
125
+ *
126
+ * Collection/audit data scraped from the public GitHub dependents page.
127
+ * Deliberately separate from the dependency-graph ``has-dependents``
128
+ * endpoint: observations are not ``DependsOn`` relationships and feed no
129
+ * metric. Retired observations are not exposed here.
130
+ */
131
+ export const getRepoGithubDependents = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}/github-dependents', ...options });
132
+ /**
133
+ * Maintenance profile for a repo
134
+ *
135
+ * Per-signal maintenance values with coverage states and percentile ranks.
136
+ *
137
+ * Serves the profile written by the gated materializer. Every ranked value
138
+ * carries its coverage state and, when ranked, its percentile and pool
139
+ * size; the profile carries its as-of and the parameters it was computed
140
+ * under. 404 while no profile has been materialized for the repository.
141
+ */
142
+ export const getRepoMaintenanceProfile = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}/maintenance-profile', ...options });
121
143
  /**
122
144
  * Contributors for a repo
123
145
  *