@pg-atlas/data-sdk 0.4.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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/generated/client/client.gen.d.ts +2 -0
  4. package/dist/generated/client/client.gen.js +235 -0
  5. package/dist/generated/client/index.d.ts +8 -0
  6. package/dist/generated/client/index.js +6 -0
  7. package/dist/generated/client/types.gen.d.ts +117 -0
  8. package/dist/generated/client/types.gen.js +2 -0
  9. package/dist/generated/client/utils.gen.d.ts +33 -0
  10. package/dist/generated/client/utils.gen.js +228 -0
  11. package/dist/generated/client.gen.d.ts +12 -0
  12. package/dist/generated/client.gen.js +3 -0
  13. package/dist/generated/core/auth.gen.d.ts +18 -0
  14. package/dist/generated/core/auth.gen.js +14 -0
  15. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  16. package/dist/generated/core/bodySerializer.gen.js +57 -0
  17. package/dist/generated/core/params.gen.d.ts +43 -0
  18. package/dist/generated/core/params.gen.js +100 -0
  19. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  20. package/dist/generated/core/pathSerializer.gen.js +106 -0
  21. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  22. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  23. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  24. package/dist/generated/core/serverSentEvents.gen.js +133 -0
  25. package/dist/generated/core/types.gen.d.ts +78 -0
  26. package/dist/generated/core/types.gen.js +2 -0
  27. package/dist/generated/core/utils.gen.d.ts +19 -0
  28. package/dist/generated/core/utils.gen.js +87 -0
  29. package/dist/generated/index.d.ts +2 -0
  30. package/dist/generated/index.js +2 -0
  31. package/dist/generated/schemas.gen.d.ts +1015 -0
  32. package/dist/generated/schemas.gen.js +1338 -0
  33. package/dist/generated/sdk.gen.d.ts +146 -0
  34. package/dist/generated/sdk.gen.js +133 -0
  35. package/dist/generated/types.gen.d.ts +1172 -0
  36. package/dist/generated/types.gen.js +2 -0
  37. package/dist/index.d.ts +6 -0
  38. package/dist/index.js +7 -0
  39. package/package.json +44 -0
@@ -0,0 +1,146 @@
1
+ import type { Client, Options as Options2, TDataShape } from './client';
2
+ import type { GetContributorData, GetContributorErrors, GetContributorResponses, GetMetadataData, GetMetadataResponses, GetProjectData, GetProjectDependsOnData, GetProjectDependsOnErrors, GetProjectDependsOnResponses, GetProjectErrors, GetProjectHasDependentsData, GetProjectHasDependentsErrors, GetProjectHasDependentsResponses, GetProjectReposData, GetProjectReposErrors, GetProjectReposResponses, GetProjectResponses, GetRepoData, GetRepoDependsOnData, GetRepoDependsOnErrors, GetRepoDependsOnResponses, GetRepoErrors, GetRepoHasDependentsData, GetRepoHasDependentsErrors, GetRepoHasDependentsResponses, GetRepoResponses, GetSbomSubmissionData, GetSbomSubmissionErrors, GetSbomSubmissionResponses, HealthData, HealthResponses, IngestSbomData, IngestSbomErrors, IngestSbomResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListReposData, ListReposErrors, ListReposResponses, ListSbomSubmissionsData, ListSbomSubmissionsErrors, ListSbomSubmissionsResponses } from './types.gen';
3
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
+ /**
5
+ * You can provide a client instance returned by `createClient()` instead of
6
+ * individual options. This might be also useful if you want to implement a
7
+ * custom client.
8
+ */
9
+ client?: Client;
10
+ /**
11
+ * You can pass arbitrary values through the `meta` object. This can be
12
+ * used to access values that aren't defined as part of the SDK function.
13
+ */
14
+ meta?: Record<string, unknown>;
15
+ };
16
+ /**
17
+ * Liveness check
18
+ *
19
+ * Return the current health status and application version.
20
+ *
21
+ * This endpoint is intentionally dependency-free (no DB call) so that it
22
+ * remains responsive even when the database is unreachable. A richer check
23
+ * with named component statuses (db, graph) will be added in A2.
24
+ */
25
+ export declare const health: <ThrowOnError extends boolean = false>(options?: Options<HealthData, ThrowOnError>) => import("./client").RequestResult<HealthResponses, unknown, ThrowOnError, "fields">;
26
+ /**
27
+ * List SBOM submissions
28
+ *
29
+ * 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.
30
+ */
31
+ export declare const listSbomSubmissions: <ThrowOnError extends boolean = false>(options?: Options<ListSbomSubmissionsData, ThrowOnError>) => import("./client").RequestResult<ListSbomSubmissionsResponses, ListSbomSubmissionsErrors, ThrowOnError, "fields">;
32
+ /**
33
+ * Submit an SPDX 2.3 SBOM
34
+ *
35
+ * 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`.
36
+ */
37
+ export declare const ingestSbom: <ThrowOnError extends boolean = false>(options?: Options<IngestSbomData, ThrowOnError>) => import("./client").RequestResult<IngestSbomResponses, IngestSbomErrors, ThrowOnError, "fields">;
38
+ /**
39
+ * Get SBOM submission detail
40
+ *
41
+ * 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.
42
+ */
43
+ export declare const getSbomSubmission: <ThrowOnError extends boolean = false>(options: Options<GetSbomSubmissionData, ThrowOnError>) => import("./client").RequestResult<GetSbomSubmissionResponses, GetSbomSubmissionErrors, ThrowOnError, "fields">;
44
+ /**
45
+ * Ecosystem summary statistics
46
+ *
47
+ * Return aggregate counts across all graph entities.
48
+ *
49
+ * Counts are computed on-the-fly via simple ``COUNT(*)`` queries. No
50
+ * caching is applied in this dev version — queries hit the DB directly.
51
+ */
52
+ export declare const getMetadata: <ThrowOnError extends boolean = false>(options?: Options<GetMetadataData, ThrowOnError>) => import("./client").RequestResult<GetMetadataResponses, unknown, ThrowOnError, "fields">;
53
+ /**
54
+ * List projects
55
+ *
56
+ * Paginated list of SCF-funded projects with optional filters.
57
+ *
58
+ * - **project_type**: filter by `public-good` or `scf-project`.
59
+ * - **activity_status**: filter by lifecycle status (`live`, `in-dev`, etc.).
60
+ * - **search**: case-insensitive substring match on `display_name`.
61
+ * - Results are ordered by `canonical_id` for deterministic pagination.
62
+ */
63
+ export declare const listProjects: <ThrowOnError extends boolean = false>(options?: Options<ListProjectsData, ThrowOnError>) => import("./client").RequestResult<ListProjectsResponses, ListProjectsErrors, ThrowOnError, "fields">;
64
+ /**
65
+ * Project detail
66
+ *
67
+ * Full detail for a single project, including validated metadata.
68
+ *
69
+ * The ``metadata`` field is the normalised form of the raw JSONB column —
70
+ * unknown keys from the crawler are passed through via ``extra="allow"``.
71
+ */
72
+ export declare const getProject: <ThrowOnError extends boolean = false>(options: Options<GetProjectData, ThrowOnError>) => import("./client").RequestResult<GetProjectResponses, GetProjectErrors, ThrowOnError, "fields">;
73
+ /**
74
+ * Repos belonging to a project
75
+ *
76
+ * Paginated list of repos that belong to the given project.
77
+ *
78
+ * Returns 404 if the project does not exist.
79
+ */
80
+ export declare const getProjectRepos: <ThrowOnError extends boolean = false>(options: Options<GetProjectReposData, ThrowOnError>) => import("./client").RequestResult<GetProjectReposResponses, GetProjectReposErrors, ThrowOnError, "fields">;
81
+ /**
82
+ * Project-level dependencies
83
+ *
84
+ * Collapsed project-level dependencies.
85
+ *
86
+ * Aggregates repo-level ``depends_on`` edges: for each distinct target project,
87
+ * returns the target project summary and the number of repo-level edges between
88
+ * the two projects. Self-references and edges to external repos (which have no
89
+ * project) are excluded.
90
+ */
91
+ export declare const getProjectDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetProjectDependsOnData, ThrowOnError>) => import("./client").RequestResult<GetProjectDependsOnResponses, GetProjectDependsOnErrors, ThrowOnError, "fields">;
92
+ /**
93
+ * Projects that depend on this project
94
+ *
95
+ * Collapsed project-level reverse dependencies.
96
+ *
97
+ * Same aggregation as ``depends-on`` but in the reverse direction: which
98
+ * other projects have repos that depend on repos of *this* project.
99
+ */
100
+ export declare const getProjectHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetProjectHasDependentsData, ThrowOnError>) => import("./client").RequestResult<GetProjectHasDependentsResponses, GetProjectHasDependentsErrors, ThrowOnError, "fields">;
101
+ /**
102
+ * List repos
103
+ *
104
+ * Paginated list of in-ecosystem repos with optional filters.
105
+ *
106
+ * - **project_id**: filter to repos belonging to a specific project.
107
+ * - **search**: case-insensitive substring match on `display_name`.
108
+ * - Results are ordered by `canonical_id` for deterministic pagination.
109
+ */
110
+ export declare const listRepos: <ThrowOnError extends boolean = false>(options?: Options<ListReposData, ThrowOnError>) => import("./client").RequestResult<ListReposResponses, ListReposErrors, ThrowOnError, "fields">;
111
+ /**
112
+ * Direct dependencies of a repo
113
+ *
114
+ * List of direct dependencies (outgoing edges) for a given repo.
115
+ *
116
+ * Each entry includes the target vertex's canonical ID, display name,
117
+ * type (``repo`` or ``external-repo``), version range, and confidence level.
118
+ */
119
+ export declare const getRepoDependsOn: <ThrowOnError extends boolean = false>(options: Options<GetRepoDependsOnData, ThrowOnError>) => import("./client").RequestResult<GetRepoDependsOnResponses, GetRepoDependsOnErrors, ThrowOnError, "fields">;
120
+ /**
121
+ * Repos that depend on this repo
122
+ *
123
+ * List of direct dependents (incoming edges) for a given repo.
124
+ *
125
+ * Each entry includes the source vertex's canonical ID, display name,
126
+ * type, version range, and confidence level.
127
+ */
128
+ export declare const getRepoHasDependents: <ThrowOnError extends boolean = false>(options: Options<GetRepoHasDependentsData, ThrowOnError>) => import("./client").RequestResult<GetRepoHasDependentsResponses, GetRepoHasDependentsErrors, ThrowOnError, "fields">;
129
+ /**
130
+ * Repo detail
131
+ *
132
+ * Full detail for a single repo including parent project, contributors,
133
+ * releases, and dependency counts.
134
+ */
135
+ export declare const getRepo: <ThrowOnError extends boolean = false>(options: Options<GetRepoData, ThrowOnError>) => import("./client").RequestResult<GetRepoResponses, GetRepoErrors, ThrowOnError, "fields">;
136
+ /**
137
+ * Contributor detail
138
+ *
139
+ * Full detail for a single contributor with aggregated statistics and
140
+ * per-repo commit activity.
141
+ *
142
+ * The ``total_commits`` field sums commits across all repos.
143
+ * ``first_contribution`` / ``last_contribution`` are the earliest and latest
144
+ * commit dates across all repos.
145
+ */
146
+ export declare const getContributor: <ThrowOnError extends boolean = false>(options: Options<GetContributorData, ThrowOnError>) => import("./client").RequestResult<GetContributorResponses, GetContributorErrors, ThrowOnError, "fields">;
@@ -0,0 +1,133 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen';
3
+ /**
4
+ * Liveness check
5
+ *
6
+ * Return the current health status and application version.
7
+ *
8
+ * This endpoint is intentionally dependency-free (no DB call) so that it
9
+ * remains responsive even when the database is unreachable. A richer check
10
+ * with named component statuses (db, graph) will be added in A2.
11
+ */
12
+ export const health = (options) => (options?.client ?? client).get({ url: '/health', ...options });
13
+ /**
14
+ * List SBOM submissions
15
+ *
16
+ * 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.
17
+ */
18
+ export const listSbomSubmissions = (options) => (options?.client ?? client).get({ url: '/ingest/sbom', ...options });
19
+ /**
20
+ * Submit an SPDX 2.3 SBOM
21
+ *
22
+ * 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`.
23
+ */
24
+ export const ingestSbom = (options) => (options?.client ?? client).post({ url: '/ingest/sbom', ...options });
25
+ /**
26
+ * Get SBOM submission detail
27
+ *
28
+ * 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.
29
+ */
30
+ export const getSbomSubmission = (options) => (options.client ?? client).get({ url: '/ingest/sbom/{submission_id}', ...options });
31
+ /**
32
+ * Ecosystem summary statistics
33
+ *
34
+ * Return aggregate counts across all graph entities.
35
+ *
36
+ * Counts are computed on-the-fly via simple ``COUNT(*)`` queries. No
37
+ * caching is applied in this dev version — queries hit the DB directly.
38
+ */
39
+ export const getMetadata = (options) => (options?.client ?? client).get({ url: '/metadata', ...options });
40
+ /**
41
+ * List projects
42
+ *
43
+ * Paginated list of SCF-funded projects with optional filters.
44
+ *
45
+ * - **project_type**: filter by `public-good` or `scf-project`.
46
+ * - **activity_status**: filter by lifecycle status (`live`, `in-dev`, etc.).
47
+ * - **search**: case-insensitive substring match on `display_name`.
48
+ * - Results are ordered by `canonical_id` for deterministic pagination.
49
+ */
50
+ export const listProjects = (options) => (options?.client ?? client).get({ url: '/projects', ...options });
51
+ /**
52
+ * Project detail
53
+ *
54
+ * Full detail for a single project, including validated metadata.
55
+ *
56
+ * The ``metadata`` field is the normalised form of the raw JSONB column —
57
+ * unknown keys from the crawler are passed through via ``extra="allow"``.
58
+ */
59
+ export const getProject = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}', ...options });
60
+ /**
61
+ * Repos belonging to a project
62
+ *
63
+ * Paginated list of repos that belong to the given project.
64
+ *
65
+ * Returns 404 if the project does not exist.
66
+ */
67
+ export const getProjectRepos = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}/repos', ...options });
68
+ /**
69
+ * Project-level dependencies
70
+ *
71
+ * Collapsed project-level dependencies.
72
+ *
73
+ * Aggregates repo-level ``depends_on`` edges: for each distinct target project,
74
+ * returns the target project summary and the number of repo-level edges between
75
+ * the two projects. Self-references and edges to external repos (which have no
76
+ * project) are excluded.
77
+ */
78
+ export const getProjectDependsOn = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}/depends-on', ...options });
79
+ /**
80
+ * Projects that depend on this project
81
+ *
82
+ * Collapsed project-level reverse dependencies.
83
+ *
84
+ * Same aggregation as ``depends-on`` but in the reverse direction: which
85
+ * other projects have repos that depend on repos of *this* project.
86
+ */
87
+ export const getProjectHasDependents = (options) => (options.client ?? client).get({ url: '/projects/{canonical_id}/has-dependents', ...options });
88
+ /**
89
+ * List repos
90
+ *
91
+ * Paginated list of in-ecosystem repos with optional filters.
92
+ *
93
+ * - **project_id**: filter to repos belonging to a specific project.
94
+ * - **search**: case-insensitive substring match on `display_name`.
95
+ * - Results are ordered by `canonical_id` for deterministic pagination.
96
+ */
97
+ export const listRepos = (options) => (options?.client ?? client).get({ url: '/repos', ...options });
98
+ /**
99
+ * Direct dependencies of a repo
100
+ *
101
+ * List of direct dependencies (outgoing edges) for a given repo.
102
+ *
103
+ * Each entry includes the target vertex's canonical ID, display name,
104
+ * type (``repo`` or ``external-repo``), version range, and confidence level.
105
+ */
106
+ export const getRepoDependsOn = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}/depends-on', ...options });
107
+ /**
108
+ * Repos that depend on this repo
109
+ *
110
+ * List of direct dependents (incoming edges) for a given repo.
111
+ *
112
+ * Each entry includes the source vertex's canonical ID, display name,
113
+ * type, version range, and confidence level.
114
+ */
115
+ export const getRepoHasDependents = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}/has-dependents', ...options });
116
+ /**
117
+ * Repo detail
118
+ *
119
+ * Full detail for a single repo including parent project, contributors,
120
+ * releases, and dependency counts.
121
+ */
122
+ export const getRepo = (options) => (options.client ?? client).get({ url: '/repos/{canonical_id}', ...options });
123
+ /**
124
+ * Contributor detail
125
+ *
126
+ * Full detail for a single contributor with aggregated statistics and
127
+ * per-repo commit activity.
128
+ *
129
+ * The ``total_commits`` field sums commits across all repos.
130
+ * ``first_contribution`` / ``last_contribution`` are the earliest and latest
131
+ * commit dates across all repos.
132
+ */
133
+ export const getContributor = (options) => (options.client ?? client).get({ url: '/contributors/{contributor_id}', ...options });