@pg-atlas/data-sdk 0.4.0 → 0.5.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
1
  export type ClientOptions = {
2
- baseUrl: 'https://pg-atlas-backend-h8gen.ondigitalocean.app' | (string & {});
2
+ baseUrl: 'https://api.pgatlas.xyz' | (string & {});
3
3
  };
4
4
  /**
5
5
  * Visibility
@@ -37,7 +37,7 @@ export type ValidationError = {
37
37
  /**
38
38
  * SubmissionStatus
39
39
  *
40
- * Processing state of an SbomSubmission record.
40
+ * Processing state of an artifact-linked audit record.
41
41
  */
42
42
  export type SubmissionStatus = 'pending' | 'processed' | 'failed';
43
43
  /**
@@ -257,8 +257,8 @@ export type RepoSummary = {
257
257
  /**
258
258
  * RepoDetailResponse
259
259
  *
260
- * Full repo detail with parent project, contributors, releases, and
261
- * dependency counts.
260
+ * Full repo detail with parent project, contributors, releases, dependency counts,
261
+ * and active contributor stats.
262
262
  */
263
263
  export type RepoDetailResponse = {
264
264
  /**
@@ -323,6 +323,14 @@ export type RepoDetailResponse = {
323
323
  contributors: Array<ContributorSummary>;
324
324
  outgoing_dep_counts: DepCounts;
325
325
  incoming_dep_counts: DepCounts;
326
+ /**
327
+ * Active Contributors 30D
328
+ */
329
+ active_contributors_30d: number;
330
+ /**
331
+ * Active Contributors 90D
332
+ */
333
+ active_contributors_90d: number;
326
334
  };
327
335
  /**
328
336
  * DepCounts
@@ -448,6 +456,37 @@ export type RepoDependency = {
448
456
  * How firmly an edge was established.
449
457
  */
450
458
  export type EdgeConfidence = 'verified-sbom' | 'inferred-shadow';
459
+ /**
460
+ * RepoContributorSummary
461
+ *
462
+ * Contributor summary with commit counts for one repo.
463
+ */
464
+ export type RepoContributorSummary = {
465
+ /**
466
+ * Id
467
+ */
468
+ id: number;
469
+ /**
470
+ * Name
471
+ */
472
+ name: string;
473
+ /**
474
+ * Email Hash
475
+ */
476
+ email_hash: string;
477
+ /**
478
+ * Number Of Commits
479
+ */
480
+ number_of_commits: number;
481
+ /**
482
+ * First Commit Date
483
+ */
484
+ first_commit_date: string;
485
+ /**
486
+ * Last Commit Date
487
+ */
488
+ last_commit_date: string;
489
+ };
451
490
  /**
452
491
  * ProjectMetadata
453
492
  *
@@ -518,7 +557,7 @@ export type ProjectMetadata = {
518
557
  /**
519
558
  * ProjectDetailResponse
520
559
  *
521
- * Full project detail including validated metadata.
560
+ * Full project detail including contributor stats and metadata.
522
561
  *
523
562
  * ``metadata`` is the normalised form of the ``project_metadata`` JSONB column.
524
563
  */
@@ -561,6 +600,14 @@ export type ProjectDetailResponse = {
561
600
  * Project Id
562
601
  */
563
602
  project_id: number;
603
+ /**
604
+ * Active Contributors 30D
605
+ */
606
+ active_contributors_30d: number;
607
+ /**
608
+ * Active Contributors 90D
609
+ */
610
+ active_contributors_90d: number;
564
611
  metadata: ProjectMetadata;
565
612
  };
566
613
  /**
@@ -576,6 +623,29 @@ export type ProjectDependency = {
576
623
  */
577
624
  edge_count: number;
578
625
  };
626
+ /**
627
+ * ProjectContributorSummary
628
+ *
629
+ * Contributor summary aggregated across all repos in a project.
630
+ */
631
+ export type ProjectContributorSummary = {
632
+ /**
633
+ * Id
634
+ */
635
+ id: number;
636
+ /**
637
+ * Name
638
+ */
639
+ name: string;
640
+ /**
641
+ * Email Hash
642
+ */
643
+ email_hash: string;
644
+ /**
645
+ * Total Commits In Project
646
+ */
647
+ total_commits_in_project: number;
648
+ };
579
649
  /**
580
650
  * PaginatedResponse[RepoSummary]
581
651
  */
@@ -597,6 +667,27 @@ export type PaginatedResponseRepoSummary = {
597
667
  */
598
668
  offset: number;
599
669
  };
670
+ /**
671
+ * PaginatedResponse[RepoContributorSummary]
672
+ */
673
+ export type PaginatedResponseRepoContributorSummary = {
674
+ /**
675
+ * Items
676
+ */
677
+ items: Array<RepoContributorSummary>;
678
+ /**
679
+ * Total
680
+ */
681
+ total: number;
682
+ /**
683
+ * Limit
684
+ */
685
+ limit: number;
686
+ /**
687
+ * Offset
688
+ */
689
+ offset: number;
690
+ };
600
691
  /**
601
692
  * PaginatedResponse[ProjectSummary]
602
693
  */
@@ -618,6 +709,113 @@ export type PaginatedResponseProjectSummary = {
618
709
  */
619
710
  offset: number;
620
711
  };
712
+ /**
713
+ * PaginatedResponse[ProjectContributorSummary]
714
+ */
715
+ export type PaginatedResponseProjectContributorSummary = {
716
+ /**
717
+ * Items
718
+ */
719
+ items: Array<ProjectContributorSummary>;
720
+ /**
721
+ * Total
722
+ */
723
+ total: number;
724
+ /**
725
+ * Limit
726
+ */
727
+ limit: number;
728
+ /**
729
+ * Offset
730
+ */
731
+ offset: number;
732
+ };
733
+ /**
734
+ * PaginatedResponse[GitLogArtifactSummary]
735
+ */
736
+ export type PaginatedResponseGitLogArtifactSummary = {
737
+ /**
738
+ * Items
739
+ */
740
+ items: Array<GitLogArtifactSummary>;
741
+ /**
742
+ * Total
743
+ */
744
+ total: number;
745
+ /**
746
+ * Limit
747
+ */
748
+ limit: number;
749
+ /**
750
+ * Offset
751
+ */
752
+ offset: number;
753
+ };
754
+ /**
755
+ * GitLogArtifactSummary
756
+ *
757
+ * Compact gitlog artifact audit record for list endpoints.
758
+ */
759
+ export type GitLogArtifactSummary = {
760
+ /**
761
+ * Id
762
+ */
763
+ id: number;
764
+ /**
765
+ * Repo Id
766
+ */
767
+ repo_id: number;
768
+ /**
769
+ * Repo Canonical Id
770
+ */
771
+ repo_canonical_id: string;
772
+ /**
773
+ * Repo Display Name
774
+ */
775
+ repo_display_name: string;
776
+ /**
777
+ * Artifact Path
778
+ */
779
+ artifact_path: string | null;
780
+ status: SubmissionStatus;
781
+ /**
782
+ * Error Detail
783
+ */
784
+ error_detail: string | null;
785
+ /**
786
+ * Since Months
787
+ */
788
+ since_months: number;
789
+ /**
790
+ * Submitted At
791
+ */
792
+ submitted_at: string;
793
+ /**
794
+ * Processed At
795
+ */
796
+ processed_at: string | null;
797
+ };
798
+ /**
799
+ * PaginatedResponse[ContributorSummary]
800
+ */
801
+ export type PaginatedResponseContributorSummary = {
802
+ /**
803
+ * Items
804
+ */
805
+ items: Array<ContributorSummary>;
806
+ /**
807
+ * Total
808
+ */
809
+ total: number;
810
+ /**
811
+ * Limit
812
+ */
813
+ limit: number;
814
+ /**
815
+ * Offset
816
+ */
817
+ offset: number;
818
+ };
621
819
  /**
622
820
  * MetadataResponse
623
821
  *
@@ -636,6 +834,10 @@ export type MetadataResponse = {
636
834
  * Total Repos
637
835
  */
638
836
  total_repos: number;
837
+ /**
838
+ * Active Repos 90D
839
+ */
840
+ active_repos_90d: number;
639
841
  /**
640
842
  * Total External Repos
641
843
  */
@@ -648,6 +850,14 @@ export type MetadataResponse = {
648
850
  * Total Contributor Edges
649
851
  */
650
852
  total_contributor_edges: number;
853
+ /**
854
+ * Active Contributors 30D
855
+ */
856
+ active_contributors_30d: number;
857
+ /**
858
+ * Active Contributors 90D
859
+ */
860
+ active_contributors_90d: number;
651
861
  /**
652
862
  * Last Updated
653
863
  */
@@ -677,6 +887,54 @@ export type HttpValidationError = {
677
887
  */
678
888
  detail?: Array<ValidationError>;
679
889
  };
890
+ /**
891
+ * GitLogArtifactDetailResponse
892
+ *
893
+ * Full gitlog artifact audit record including raw artifact content.
894
+ */
895
+ export type GitLogArtifactDetailResponse = {
896
+ /**
897
+ * Id
898
+ */
899
+ id: number;
900
+ /**
901
+ * Repo Id
902
+ */
903
+ repo_id: number;
904
+ /**
905
+ * Repo Canonical Id
906
+ */
907
+ repo_canonical_id: string;
908
+ /**
909
+ * Repo Display Name
910
+ */
911
+ repo_display_name: string;
912
+ /**
913
+ * Artifact Path
914
+ */
915
+ artifact_path: string | null;
916
+ status: SubmissionStatus;
917
+ /**
918
+ * Error Detail
919
+ */
920
+ error_detail: string | null;
921
+ /**
922
+ * Since Months
923
+ */
924
+ since_months: number;
925
+ /**
926
+ * Submitted At
927
+ */
928
+ submitted_at: string;
929
+ /**
930
+ * Processed At
931
+ */
932
+ processed_at: string | null;
933
+ /**
934
+ * Raw Artifact
935
+ */
936
+ raw_artifact?: string | null;
937
+ };
680
938
  /**
681
939
  * ContributorDetailResponse
682
940
  *
@@ -971,6 +1229,48 @@ export type GetProjectReposResponses = {
971
1229
  200: PaginatedResponseRepoSummary;
972
1230
  };
973
1231
  export type GetProjectReposResponse = GetProjectReposResponses[keyof GetProjectReposResponses];
1232
+ export type GetProjectContributorsData = {
1233
+ body?: never;
1234
+ path: {
1235
+ /**
1236
+ * Canonical Id
1237
+ */
1238
+ canonical_id: string;
1239
+ };
1240
+ query?: {
1241
+ /**
1242
+ * Search
1243
+ */
1244
+ search?: string | null;
1245
+ /**
1246
+ * Limit
1247
+ *
1248
+ * Maximum number of items to return
1249
+ */
1250
+ limit?: number;
1251
+ /**
1252
+ * Offset
1253
+ *
1254
+ * Number of items to skip
1255
+ */
1256
+ offset?: number;
1257
+ };
1258
+ url: '/projects/{canonical_id}/contributors';
1259
+ };
1260
+ export type GetProjectContributorsErrors = {
1261
+ /**
1262
+ * Validation Error
1263
+ */
1264
+ 422: HttpValidationError;
1265
+ };
1266
+ export type GetProjectContributorsError = GetProjectContributorsErrors[keyof GetProjectContributorsErrors];
1267
+ export type GetProjectContributorsResponses = {
1268
+ /**
1269
+ * Successful Response
1270
+ */
1271
+ 200: PaginatedResponseProjectContributorSummary;
1272
+ };
1273
+ export type GetProjectContributorsResponse = GetProjectContributorsResponses[keyof GetProjectContributorsResponses];
974
1274
  export type GetProjectDependsOnData = {
975
1275
  body?: never;
976
1276
  path: {
@@ -1120,6 +1420,48 @@ export type GetRepoHasDependentsResponses = {
1120
1420
  200: Array<RepoDependency>;
1121
1421
  };
1122
1422
  export type GetRepoHasDependentsResponse = GetRepoHasDependentsResponses[keyof GetRepoHasDependentsResponses];
1423
+ export type GetRepoContributorsData = {
1424
+ body?: never;
1425
+ path: {
1426
+ /**
1427
+ * Canonical Id
1428
+ */
1429
+ canonical_id: string;
1430
+ };
1431
+ query?: {
1432
+ /**
1433
+ * Search
1434
+ */
1435
+ search?: string | null;
1436
+ /**
1437
+ * Limit
1438
+ *
1439
+ * Maximum number of items to return
1440
+ */
1441
+ limit?: number;
1442
+ /**
1443
+ * Offset
1444
+ *
1445
+ * Number of items to skip
1446
+ */
1447
+ offset?: number;
1448
+ };
1449
+ url: '/repos/{canonical_id}/contributors';
1450
+ };
1451
+ export type GetRepoContributorsErrors = {
1452
+ /**
1453
+ * Validation Error
1454
+ */
1455
+ 422: HttpValidationError;
1456
+ };
1457
+ export type GetRepoContributorsError = GetRepoContributorsErrors[keyof GetRepoContributorsErrors];
1458
+ export type GetRepoContributorsResponses = {
1459
+ /**
1460
+ * Successful Response
1461
+ */
1462
+ 200: PaginatedResponseRepoContributorSummary;
1463
+ };
1464
+ export type GetRepoContributorsResponse = GetRepoContributorsResponses[keyof GetRepoContributorsResponses];
1123
1465
  export type GetRepoData = {
1124
1466
  body?: never;
1125
1467
  path: {
@@ -1145,6 +1487,43 @@ export type GetRepoResponses = {
1145
1487
  200: RepoDetailResponse;
1146
1488
  };
1147
1489
  export type GetRepoResponse = GetRepoResponses[keyof GetRepoResponses];
1490
+ export type ListContributorsData = {
1491
+ body?: never;
1492
+ path?: never;
1493
+ query?: {
1494
+ /**
1495
+ * Search
1496
+ */
1497
+ search?: string | null;
1498
+ /**
1499
+ * Limit
1500
+ *
1501
+ * Maximum number of items to return
1502
+ */
1503
+ limit?: number;
1504
+ /**
1505
+ * Offset
1506
+ *
1507
+ * Number of items to skip
1508
+ */
1509
+ offset?: number;
1510
+ };
1511
+ url: '/contributors';
1512
+ };
1513
+ export type ListContributorsErrors = {
1514
+ /**
1515
+ * Validation Error
1516
+ */
1517
+ 422: HttpValidationError;
1518
+ };
1519
+ export type ListContributorsError = ListContributorsErrors[keyof ListContributorsErrors];
1520
+ export type ListContributorsResponses = {
1521
+ /**
1522
+ * Successful Response
1523
+ */
1524
+ 200: PaginatedResponseContributorSummary;
1525
+ };
1526
+ export type ListContributorsResponse = ListContributorsResponses[keyof ListContributorsResponses];
1148
1527
  export type GetContributorData = {
1149
1528
  body?: never;
1150
1529
  path: {
@@ -1170,3 +1549,67 @@ export type GetContributorResponses = {
1170
1549
  200: ContributorDetailResponse;
1171
1550
  };
1172
1551
  export type GetContributorResponse = GetContributorResponses[keyof GetContributorResponses];
1552
+ export type ListGitlogArtifactsData = {
1553
+ body?: never;
1554
+ path?: never;
1555
+ query?: {
1556
+ /**
1557
+ * Repo
1558
+ *
1559
+ * Filter by repo canonical_id (exact match)
1560
+ */
1561
+ repo?: string | null;
1562
+ /**
1563
+ * Limit
1564
+ *
1565
+ * Maximum number of items to return
1566
+ */
1567
+ limit?: number;
1568
+ /**
1569
+ * Offset
1570
+ *
1571
+ * Number of items to skip
1572
+ */
1573
+ offset?: number;
1574
+ };
1575
+ url: '/gitlog';
1576
+ };
1577
+ export type ListGitlogArtifactsErrors = {
1578
+ /**
1579
+ * Validation Error
1580
+ */
1581
+ 422: HttpValidationError;
1582
+ };
1583
+ export type ListGitlogArtifactsError = ListGitlogArtifactsErrors[keyof ListGitlogArtifactsErrors];
1584
+ export type ListGitlogArtifactsResponses = {
1585
+ /**
1586
+ * Successful Response
1587
+ */
1588
+ 200: PaginatedResponseGitLogArtifactSummary;
1589
+ };
1590
+ export type ListGitlogArtifactsResponse = ListGitlogArtifactsResponses[keyof ListGitlogArtifactsResponses];
1591
+ export type GetGitlogArtifactData = {
1592
+ body?: never;
1593
+ path: {
1594
+ /**
1595
+ * Artifact Id
1596
+ */
1597
+ artifact_id: number;
1598
+ };
1599
+ query?: never;
1600
+ url: '/gitlog/{artifact_id}';
1601
+ };
1602
+ export type GetGitlogArtifactErrors = {
1603
+ /**
1604
+ * Validation Error
1605
+ */
1606
+ 422: HttpValidationError;
1607
+ };
1608
+ export type GetGitlogArtifactError = GetGitlogArtifactErrors[keyof GetGitlogArtifactErrors];
1609
+ export type GetGitlogArtifactResponses = {
1610
+ /**
1611
+ * Successful Response
1612
+ */
1613
+ 200: GitLogArtifactDetailResponse;
1614
+ };
1615
+ export type GetGitlogArtifactResponse = GetGitlogArtifactResponses[keyof GetGitlogArtifactResponses];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pg-atlas/data-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK for the PG Atlas API",
5
5
  "keywords": [
6
6
  "stellar",