@lizard-build/sdk 0.1.71 → 0.1.73

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/dist/index.d.mts CHANGED
@@ -460,6 +460,799 @@ declare class GitHubAPI {
460
460
  checkout(serviceId: string, branch: string): Promise<DeployHandle>;
461
461
  }
462
462
 
463
+ /**
464
+ * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, Actions-style
465
+ * CI, releases, webhooks, branch protection and the rest, with the same API key as the rest
466
+ * of the SDK. The key must be a whole account's (no scopes): Lizard Git refuses scoped keys.
467
+ *
468
+ * Repositories are named `"owner/name"`.
469
+ *
470
+ * ```ts
471
+ * const lizard = new Lizard()
472
+ * const repo = await lizard.git.repos.create({ name: 'app', private: true, readme: true })
473
+ * await lizard.git.repos.commitFiles('me/app', { branch: 'main', message: 'Add CI',
474
+ * files: [{ path: '.lizard/workflows/ci.yml', content: 'on: push\njobs: ...' }] })
475
+ * const pr = await lizard.git.pulls.create('me/app', { title: 'Feature', head: 'feature', base: 'main' })
476
+ * ```
477
+ */
478
+ declare const DEFAULT_GIT_URL = "https://git.lizard.build";
479
+ type RepoRef = string;
480
+ type Role = 'read' | 'write' | 'admin';
481
+ interface Repo {
482
+ id: number;
483
+ owner: string;
484
+ ownerAvatar: string;
485
+ name: string;
486
+ description: string;
487
+ private: boolean;
488
+ defaultBranch: string;
489
+ stars: number;
490
+ pushedAt: number | null;
491
+ createdAt: number;
492
+ updatedAt: number;
493
+ }
494
+ interface RepoMeta {
495
+ repo: Repo;
496
+ role: 'owner' | Role | '';
497
+ canPush: boolean;
498
+ canAdmin: boolean;
499
+ starred: boolean;
500
+ empty: boolean;
501
+ cloneUrl: string;
502
+ branches: number;
503
+ tags: number;
504
+ openIssues: number;
505
+ openPulls: number;
506
+ forkOf: string | null;
507
+ forks: number;
508
+ }
509
+ interface Ref {
510
+ name: string;
511
+ sha: string;
512
+ kind: 'branch' | 'tag';
513
+ date: number;
514
+ subject: string;
515
+ author: string;
516
+ ahead?: number;
517
+ behind?: number;
518
+ }
519
+ interface Commit {
520
+ sha: string;
521
+ parents: string[];
522
+ authorName: string;
523
+ authorEmail: string;
524
+ date: number;
525
+ committerName: string;
526
+ committerDate: number;
527
+ subject: string;
528
+ body?: string;
529
+ }
530
+ interface TreeEntry {
531
+ name: string;
532
+ path: string;
533
+ type: 'blob' | 'tree' | 'commit';
534
+ mode: string;
535
+ size?: number;
536
+ }
537
+ interface Blob$1 {
538
+ commit: string;
539
+ path: string;
540
+ size: number;
541
+ content?: string;
542
+ binary?: boolean;
543
+ tooLarge?: boolean;
544
+ lastCommit?: Commit;
545
+ }
546
+ interface FileChange {
547
+ path: string;
548
+ /** Text, or base64 when `base64` is true. Leave out with `delete`. */
549
+ content?: string;
550
+ base64?: boolean;
551
+ delete?: boolean;
552
+ /** Rename: the old path (its content moves unless `content` is given). */
553
+ moveFrom?: string;
554
+ }
555
+ interface CommitFilesOpts {
556
+ branch: string;
557
+ message: string;
558
+ files: FileChange[];
559
+ /** The commit the branch must still point at (compare-and-swap); a moved branch answers 409. */
560
+ expect?: string;
561
+ /** Create `branch` from this ref when it doesn't exist yet. */
562
+ createFrom?: string;
563
+ /** Same key, same result: a retried call doesn't commit twice. */
564
+ idempotencyKey?: string;
565
+ }
566
+ interface Label {
567
+ id: number;
568
+ name: string;
569
+ color: string;
570
+ description: string;
571
+ }
572
+ interface Assignee {
573
+ login: string;
574
+ avatarUrl: string;
575
+ }
576
+ interface Issue {
577
+ number: number;
578
+ title: string;
579
+ body: string;
580
+ state: 'open' | 'closed' | 'merged';
581
+ isPull: boolean;
582
+ headRef?: string;
583
+ baseRef?: string;
584
+ headRepo?: string;
585
+ mergedSha?: string;
586
+ draft: boolean;
587
+ author: string;
588
+ authorAvatar: string;
589
+ comments: number;
590
+ labels: Label[];
591
+ assignees: Assignee[];
592
+ closedAt: number | null;
593
+ createdAt: number;
594
+ updatedAt: number;
595
+ }
596
+ interface IssueDetail {
597
+ issue: Issue;
598
+ comments: Array<{
599
+ id: number;
600
+ kind: string;
601
+ author: string;
602
+ body: string;
603
+ createdAt: number;
604
+ [k: string]: unknown;
605
+ }>;
606
+ canEdit: boolean;
607
+ canMerge: boolean;
608
+ /** Pull requests: head commit, merge check, what branch protection still needs. */
609
+ pull?: {
610
+ headSha?: string;
611
+ baseExists: boolean;
612
+ headExists: boolean;
613
+ commits?: number;
614
+ merge?: unknown;
615
+ gate?: unknown;
616
+ reviewRequests: unknown[];
617
+ };
618
+ }
619
+ interface IssueList {
620
+ items: Issue[];
621
+ open: number;
622
+ closed: number;
623
+ }
624
+ interface ListIssuesOpts {
625
+ state?: 'open' | 'closed' | 'all';
626
+ q?: string;
627
+ label?: string;
628
+ assignee?: string;
629
+ }
630
+ interface CreatePullOpts {
631
+ title: string;
632
+ body?: string;
633
+ /** A branch here, or `"owner:branch"` of a fork. */
634
+ head: string;
635
+ base?: string;
636
+ /** `"owner/name"` of the fork `head` is on (instead of `owner:branch`). */
637
+ headRepo?: string;
638
+ draft?: boolean;
639
+ reviewers?: string[];
640
+ }
641
+ interface UpdateIssueOpts {
642
+ title?: string;
643
+ body?: string;
644
+ state?: 'open' | 'closed';
645
+ labels?: string[];
646
+ assignees?: string[];
647
+ /** Pull requests only. */
648
+ reviewers?: string[];
649
+ draft?: boolean;
650
+ }
651
+ interface MergeOpts {
652
+ method?: 'merge' | 'squash' | 'rebase';
653
+ message?: string;
654
+ deleteBranch?: boolean;
655
+ bypass?: boolean;
656
+ }
657
+ interface LineComment {
658
+ path: string;
659
+ line: number;
660
+ side?: 'RIGHT' | 'LEFT';
661
+ body: string;
662
+ }
663
+ interface ReviewOpts {
664
+ event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
665
+ body?: string;
666
+ comments?: LineComment[];
667
+ }
668
+ interface Run {
669
+ id: number;
670
+ number: number;
671
+ workflow: string;
672
+ name: string;
673
+ event: string;
674
+ ref: string;
675
+ sha: string;
676
+ actor: string;
677
+ status: string;
678
+ title: string;
679
+ createdAt: number;
680
+ startedAt: number | null;
681
+ finishedAt: number | null;
682
+ jobs: Job[];
683
+ }
684
+ interface Job {
685
+ id: number;
686
+ key: string;
687
+ name: string;
688
+ status: string;
689
+ image: string;
690
+ steps: Array<{
691
+ name: string;
692
+ status: string;
693
+ }> | null;
694
+ logSize: number;
695
+ startedAt: number | null;
696
+ finishedAt: number | null;
697
+ }
698
+ interface ListRunsOpts {
699
+ branch?: string;
700
+ sha?: string;
701
+ workflow?: string;
702
+ status?: string;
703
+ pr?: number;
704
+ page?: number;
705
+ }
706
+ interface LogChunk {
707
+ offset: number;
708
+ next: number;
709
+ size: number;
710
+ text: string;
711
+ done: boolean;
712
+ }
713
+ interface Workflow {
714
+ path: string;
715
+ name: string;
716
+ events: string[];
717
+ dispatch: boolean;
718
+ }
719
+ interface Artifact {
720
+ name: string;
721
+ size: number;
722
+ job: string;
723
+ createdAt: number;
724
+ }
725
+ interface Collaborator {
726
+ login: string;
727
+ name: string;
728
+ avatarUrl: string;
729
+ role: Role;
730
+ createdAt: number;
731
+ }
732
+ interface Invitation {
733
+ id: number;
734
+ repo: string;
735
+ owner: string;
736
+ login?: string;
737
+ role: Role;
738
+ inviter: string;
739
+ createdAt: number;
740
+ expiresAt: number;
741
+ }
742
+ interface Webhook {
743
+ id: number;
744
+ url: string;
745
+ contentType: 'json' | 'form';
746
+ events: string[];
747
+ active: boolean;
748
+ hasSecret: boolean;
749
+ lastStatus: number;
750
+ lastError?: string;
751
+ lastDeliveryAt: number | null;
752
+ createdAt: number;
753
+ }
754
+ interface WebhookOpts {
755
+ url?: string;
756
+ secret?: string;
757
+ contentType?: 'json' | 'form';
758
+ events?: string[];
759
+ active?: boolean;
760
+ }
761
+ interface Delivery {
762
+ id: number;
763
+ event: string;
764
+ status: number;
765
+ error?: string;
766
+ durationMs: number;
767
+ createdAt: number;
768
+ [k: string]: unknown;
769
+ }
770
+ interface BranchRule {
771
+ id: number;
772
+ pattern: string;
773
+ requirePullRequest: boolean;
774
+ requiredApprovals: number;
775
+ requiredChecks: string[];
776
+ blockForcePush: boolean;
777
+ blockDeletion: boolean;
778
+ enforceAdmins: boolean;
779
+ requireCodeOwners: boolean;
780
+ createdAt: number;
781
+ }
782
+ type BranchRuleOpts = Partial<Omit<BranchRule, 'id' | 'createdAt'>>;
783
+ interface Release {
784
+ id: number;
785
+ tag: string;
786
+ target: string;
787
+ sha: string;
788
+ name: string;
789
+ body: string;
790
+ draft: boolean;
791
+ prerelease: boolean;
792
+ author: string;
793
+ createdAt: number;
794
+ assets: Array<{
795
+ id: number;
796
+ name: string;
797
+ size: number;
798
+ contentType: string;
799
+ downloads?: number;
800
+ }>;
801
+ }
802
+ interface ReleaseOpts {
803
+ tag: string;
804
+ target?: string;
805
+ name?: string;
806
+ body?: string;
807
+ draft?: boolean;
808
+ prerelease?: boolean;
809
+ }
810
+ interface CommitStatus {
811
+ state: 'pending' | 'success' | 'failure' | 'error';
812
+ context: string;
813
+ description?: string;
814
+ target_url?: string;
815
+ }
816
+ interface CombinedStatus {
817
+ sha: string;
818
+ state: string;
819
+ total_count: number;
820
+ statuses: Array<CommitStatus & {
821
+ createdAt: number;
822
+ creator: string;
823
+ }>;
824
+ }
825
+ interface Notification {
826
+ id: number;
827
+ reason: string;
828
+ repo: string;
829
+ number: number;
830
+ title: string;
831
+ actor: string;
832
+ url: string;
833
+ unread: boolean;
834
+ updatedAt: number;
835
+ }
836
+ interface Token {
837
+ id: number;
838
+ name: string;
839
+ repos: string[];
840
+ refs: string[];
841
+ paths: string[];
842
+ readOnly: boolean;
843
+ createdAt: number;
844
+ lastUsedAt: number | null;
845
+ }
846
+ interface TokenOpts {
847
+ name: string;
848
+ repos?: string[];
849
+ refs?: string[];
850
+ paths?: string[];
851
+ readOnly?: boolean;
852
+ }
853
+ interface GitUser {
854
+ id: number;
855
+ login: string;
856
+ name: string;
857
+ avatarUrl: string;
858
+ bio: string;
859
+ createdAt: number;
860
+ }
861
+ /** HTTP to Lizard Git with the connection's API key. */
862
+ declare class GitClient {
863
+ readonly config: ConnectionConfig;
864
+ readonly url: string;
865
+ constructor(config: ConnectionConfig, url?: string);
866
+ raw(method: string, path: string, body?: BodyInit, headers?: Record<string, string>): Promise<Response>;
867
+ request<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
868
+ get<T>(path: string): Promise<T>;
869
+ post<T>(path: string, body?: unknown): Promise<T>;
870
+ put<T>(path: string, body?: unknown): Promise<T>;
871
+ patch<T>(path: string, body: unknown): Promise<T>;
872
+ delete<T = void>(path: string): Promise<T>;
873
+ bytes(path: string): Promise<Uint8Array>;
874
+ }
875
+ declare class GitReposAPI {
876
+ private readonly c;
877
+ constructor(c: GitClient);
878
+ /** Yours and the ones you collaborate on by default; `owner`, `q`, `starred` narrow it. */
879
+ list(opts?: {
880
+ owner?: string;
881
+ member?: string;
882
+ starred?: string;
883
+ q?: string;
884
+ sort?: 'updated' | 'stars' | 'name';
885
+ }): Promise<Repo[]>;
886
+ /** Answers the new repository's `owner` and `name`. */
887
+ create(opts: {
888
+ name: string;
889
+ description?: string;
890
+ private?: boolean;
891
+ readme?: boolean;
892
+ defaultBranch?: string;
893
+ }): Promise<{
894
+ owner: string;
895
+ name: string;
896
+ }>;
897
+ get(repo: RepoRef): Promise<RepoMeta>;
898
+ update(repo: RepoRef, opts: {
899
+ name?: string;
900
+ description?: string;
901
+ private?: boolean;
902
+ defaultBranch?: string;
903
+ }): Promise<{
904
+ ok: boolean;
905
+ }>;
906
+ delete(repo: RepoRef): Promise<void>;
907
+ star(repo: RepoRef): Promise<void>;
908
+ unstar(repo: RepoRef): Promise<void>;
909
+ /** Fork into your account (`name` defaults to the same name). */
910
+ fork(repo: RepoRef, opts?: {
911
+ name?: string;
912
+ }): Promise<{
913
+ owner: string;
914
+ name: string;
915
+ }>;
916
+ forks(repo: RepoRef): Promise<Repo[]>;
917
+ /** Branches and tags. */
918
+ refs(repo: RepoRef): Promise<Ref[]>;
919
+ createBranch(repo: RepoRef, name: string, from?: string): Promise<{
920
+ name: string;
921
+ sha: string;
922
+ }>;
923
+ deleteBranch(repo: RepoRef, name: string): Promise<void>;
924
+ tree(repo: RepoRef, opts?: {
925
+ ref?: string;
926
+ path?: string;
927
+ }): Promise<{
928
+ commit: string;
929
+ path: string;
930
+ entries: TreeEntry[];
931
+ }>;
932
+ /** A file as JSON (text in `content`). */
933
+ file(repo: RepoRef, path: string, ref?: string): Promise<Blob$1>;
934
+ /** A file's bytes, whatever its size or type. */
935
+ raw(repo: RepoRef, path: string, ref: string): Promise<Uint8Array>;
936
+ /** Every file path at a ref. */
937
+ files(repo: RepoRef, ref?: string): Promise<string[]>;
938
+ search(repo: RepoRef, q: string, ref?: string): Promise<unknown>;
939
+ commits(repo: RepoRef, opts?: {
940
+ ref?: string;
941
+ path?: string;
942
+ page?: number;
943
+ }): Promise<{
944
+ commits: Commit[];
945
+ more: boolean;
946
+ }>;
947
+ commit(repo: RepoRef, sha: string): Promise<{
948
+ commit: Commit;
949
+ diff: unknown;
950
+ }>;
951
+ compare(repo: RepoRef, base: string, head: string): Promise<unknown>;
952
+ /** Commit files on the server: no clone, no push. Answers 409 when `expect` no longer matches. */
953
+ commitFiles(repo: RepoRef, opts: CommitFilesOpts): Promise<{
954
+ sha: string;
955
+ branch: string;
956
+ [k: string]: unknown;
957
+ }>;
958
+ /** Rebase `head` (branch or commit) onto `onto` on the server and move `onto` there; retried on races. */
959
+ land(repo: RepoRef, opts: {
960
+ head: string;
961
+ onto: string;
962
+ deleteHead?: boolean;
963
+ }): Promise<{
964
+ sha: string;
965
+ [k: string]: unknown;
966
+ }>;
967
+ /** Who moved which branch, when. */
968
+ reflog(repo: RepoRef, ref?: string): Promise<unknown[]>;
969
+ archive(repo: RepoRef, ref: string, format?: 'zip' | 'tar.gz'): Promise<Uint8Array>;
970
+ /** The HTTPS clone URL. With `withKey`, it carries the API key, so plain `git clone` works without a helper. */
971
+ cloneUrl(repo: RepoRef, opts?: {
972
+ withKey?: boolean;
973
+ }): string;
974
+ }
975
+ declare class GitIssuesAPI {
976
+ protected readonly c: GitClient;
977
+ private readonly pulls;
978
+ constructor(c: GitClient, pulls?: boolean);
979
+ protected base(repo: RepoRef): string;
980
+ list(repo: RepoRef, opts?: ListIssuesOpts): Promise<IssueList>;
981
+ get(repo: RepoRef, number: number): Promise<IssueDetail>;
982
+ update(repo: RepoRef, number: number, opts: UpdateIssueOpts): Promise<{
983
+ ok: boolean;
984
+ }>;
985
+ comment(repo: RepoRef, number: number, body: string): Promise<{
986
+ id: number;
987
+ }>;
988
+ close(repo: RepoRef, number: number): Promise<{
989
+ ok: boolean;
990
+ }>;
991
+ reopen(repo: RepoRef, number: number): Promise<{
992
+ ok: boolean;
993
+ }>;
994
+ }
995
+ declare class GitIssuesOnlyAPI extends GitIssuesAPI {
996
+ constructor(c: GitClient);
997
+ create(repo: RepoRef, opts: {
998
+ title: string;
999
+ body?: string;
1000
+ }): Promise<{
1001
+ number: number;
1002
+ }>;
1003
+ }
1004
+ declare class GitPullsAPI extends GitIssuesAPI {
1005
+ constructor(c: GitClient);
1006
+ create(repo: RepoRef, opts: CreatePullOpts): Promise<{
1007
+ number: number;
1008
+ }>;
1009
+ /** Mark a draft ready for review. */
1010
+ ready(repo: RepoRef, number: number): Promise<{
1011
+ ok: boolean;
1012
+ }>;
1013
+ merge(repo: RepoRef, number: number, opts?: MergeOpts): Promise<{
1014
+ sha: string;
1015
+ }>;
1016
+ diff(repo: RepoRef, number: number): Promise<unknown>;
1017
+ commits(repo: RepoRef, number: number): Promise<Commit[]>;
1018
+ reviews(repo: RepoRef, number: number): Promise<{
1019
+ reviews: unknown[];
1020
+ comments: unknown[];
1021
+ decision: {
1022
+ approvals: string[];
1023
+ changesRequested: string[];
1024
+ };
1025
+ }>;
1026
+ review(repo: RepoRef, number: number, opts: ReviewOpts): Promise<{
1027
+ id: number;
1028
+ state: string;
1029
+ }>;
1030
+ approve(repo: RepoRef, number: number, body?: string): Promise<{
1031
+ id: number;
1032
+ state: string;
1033
+ }>;
1034
+ requestChanges(repo: RepoRef, number: number, body: string): Promise<{
1035
+ id: number;
1036
+ state: string;
1037
+ }>;
1038
+ lineComment(repo: RepoRef, number: number, c: LineComment): Promise<{
1039
+ id: number;
1040
+ }>;
1041
+ deleteLineComment(repo: RepoRef, number: number, id: number): Promise<void>;
1042
+ /** The combined commit status of the pull request's head (CI and external checks). */
1043
+ checks(repo: RepoRef, number: number): Promise<CombinedStatus>;
1044
+ }
1045
+ declare class GitSecretsAPI {
1046
+ private readonly c;
1047
+ constructor(c: GitClient);
1048
+ list(repo: RepoRef): Promise<{
1049
+ configured: boolean;
1050
+ secrets: Array<{
1051
+ name: string;
1052
+ updatedAt: number;
1053
+ }>;
1054
+ }>;
1055
+ set(repo: RepoRef, name: string, value: string): Promise<void>;
1056
+ delete(repo: RepoRef, name: string): Promise<void>;
1057
+ }
1058
+ declare class GitActionsAPI {
1059
+ private readonly c;
1060
+ readonly secrets: GitSecretsAPI;
1061
+ constructor(c: GitClient);
1062
+ runs(repo: RepoRef, opts?: ListRunsOpts): Promise<{
1063
+ runs: Run[];
1064
+ more: boolean;
1065
+ }>;
1066
+ run(repo: RepoRef, number: number): Promise<Run>;
1067
+ cancel(repo: RepoRef, number: number): Promise<void>;
1068
+ /** Run the same workflow at the same commit again (a new run). */
1069
+ rerun(repo: RepoRef, number: number): Promise<{
1070
+ number: number;
1071
+ }>;
1072
+ /** Let a run from a fork's pull request start (it waits for someone with write access). */
1073
+ approve(repo: RepoRef, number: number): Promise<void>;
1074
+ /** Part of a job's log from `offset`; follow `next` until `done`. */
1075
+ log(repo: RepoRef, jobId: number, offset?: number): Promise<LogChunk>;
1076
+ fullLog(repo: RepoRef, jobId: number): Promise<string>;
1077
+ /** Each new piece of the log as it's written, until the job ends. */
1078
+ followLog(repo: RepoRef, jobId: number, opts?: {
1079
+ intervalMs?: number;
1080
+ signal?: AbortSignal;
1081
+ }): AsyncGenerator<string>;
1082
+ /** Wait until the run ends (success, failure, cancelled, ...). */
1083
+ wait(repo: RepoRef, number: number, opts?: {
1084
+ timeoutMs?: number;
1085
+ intervalMs?: number;
1086
+ }): Promise<Run>;
1087
+ artifacts(repo: RepoRef, number: number): Promise<Artifact[]>;
1088
+ /** An artifact as a .tar.gz. */
1089
+ downloadArtifact(repo: RepoRef, number: number, name: string): Promise<Uint8Array>;
1090
+ workflows(repo: RepoRef): Promise<{
1091
+ enabled: boolean;
1092
+ reason?: string;
1093
+ workflows: Workflow[];
1094
+ }>;
1095
+ /** Start a workflow that has `on: workflow_dispatch`. */
1096
+ dispatch(repo: RepoRef, opts: {
1097
+ workflow: string;
1098
+ ref?: string;
1099
+ inputs?: Record<string, string>;
1100
+ }): Promise<{
1101
+ number: number;
1102
+ }>;
1103
+ /** Latest run status per commit, for the given commits. */
1104
+ status(repo: RepoRef, shas: string[]): Promise<Record<string, string>>;
1105
+ }
1106
+ declare class GitCollaboratorsAPI {
1107
+ private readonly c;
1108
+ constructor(c: GitClient);
1109
+ list(repo: RepoRef): Promise<{
1110
+ collaborators: Collaborator[];
1111
+ invitations: Invitation[];
1112
+ role: string;
1113
+ }>;
1114
+ /** Invite someone with a Lizard Git account (they sign in once first); they're in once they accept. */
1115
+ invite(repo: RepoRef, login: string, role?: Role): Promise<{
1116
+ login: string;
1117
+ role: Role;
1118
+ status: 'invited' | 'updated';
1119
+ }>;
1120
+ setRole(repo: RepoRef, login: string, role: Role): Promise<{
1121
+ login: string;
1122
+ role: Role;
1123
+ }>;
1124
+ /** Remove someone (or yourself: leave). */
1125
+ remove(repo: RepoRef, login: string): Promise<void>;
1126
+ cancelInvitation(repo: RepoRef, id: number): Promise<void>;
1127
+ /** Invitations waiting for you. */
1128
+ invitations(): Promise<Invitation[]>;
1129
+ accept(id: number): Promise<void>;
1130
+ decline(id: number): Promise<void>;
1131
+ }
1132
+ declare class GitWebhooksAPI {
1133
+ private readonly c;
1134
+ constructor(c: GitClient);
1135
+ list(repo: RepoRef): Promise<{
1136
+ hooks: Webhook[];
1137
+ events: string[];
1138
+ }>;
1139
+ /** GitHub-style payloads, signed with `X-Hub-Signature-256` when there's a secret. */
1140
+ create(repo: RepoRef, opts: WebhookOpts & {
1141
+ url: string;
1142
+ }): Promise<Webhook>;
1143
+ get(repo: RepoRef, id: number): Promise<Webhook>;
1144
+ update(repo: RepoRef, id: number, opts: WebhookOpts): Promise<Webhook>;
1145
+ delete(repo: RepoRef, id: number): Promise<void>;
1146
+ ping(repo: RepoRef, id: number): Promise<void>;
1147
+ deliveries(repo: RepoRef, id: number): Promise<Delivery[]>;
1148
+ delivery(repo: RepoRef, id: number, deliveryId: number): Promise<Delivery>;
1149
+ redeliver(repo: RepoRef, id: number, deliveryId: number): Promise<void>;
1150
+ }
1151
+ declare class GitBranchRulesAPI {
1152
+ private readonly c;
1153
+ constructor(c: GitClient);
1154
+ list(repo: RepoRef): Promise<BranchRule[]>;
1155
+ create(repo: RepoRef, opts: BranchRuleOpts & {
1156
+ pattern: string;
1157
+ }): Promise<BranchRule>;
1158
+ update(repo: RepoRef, id: number, opts: BranchRuleOpts): Promise<BranchRule>;
1159
+ delete(repo: RepoRef, id: number): Promise<void>;
1160
+ }
1161
+ declare class GitLabelsAPI {
1162
+ private readonly c;
1163
+ constructor(c: GitClient);
1164
+ list(repo: RepoRef): Promise<Label[]>;
1165
+ create(repo: RepoRef, opts: {
1166
+ name: string;
1167
+ color?: string;
1168
+ description?: string;
1169
+ }): Promise<Label>;
1170
+ update(repo: RepoRef, name: string, opts: {
1171
+ name?: string;
1172
+ color?: string;
1173
+ description?: string;
1174
+ }): Promise<Label>;
1175
+ delete(repo: RepoRef, name: string): Promise<void>;
1176
+ }
1177
+ declare class GitReleasesAPI {
1178
+ private readonly c;
1179
+ constructor(c: GitClient);
1180
+ list(repo: RepoRef): Promise<Release[]>;
1181
+ /** Creates the tag too when it doesn't exist (at `target`, default branch by default). */
1182
+ create(repo: RepoRef, opts: ReleaseOpts): Promise<Release>;
1183
+ get(repo: RepoRef, id: number): Promise<Release>;
1184
+ getByTag(repo: RepoRef, tag: string): Promise<Release>;
1185
+ update(repo: RepoRef, id: number, opts: {
1186
+ name?: string;
1187
+ body?: string;
1188
+ draft?: boolean;
1189
+ prerelease?: boolean;
1190
+ }): Promise<Release>;
1191
+ delete(repo: RepoRef, id: number): Promise<void>;
1192
+ uploadAsset(repo: RepoRef, id: number, name: string, data: Uint8Array | Blob$1 | string, contentType?: string): Promise<{
1193
+ id: number;
1194
+ name: string;
1195
+ size: number;
1196
+ contentType: string;
1197
+ }>;
1198
+ downloadAsset(repo: RepoRef, id: number, assetId: number): Promise<Uint8Array>;
1199
+ deleteAsset(repo: RepoRef, id: number, assetId: number): Promise<void>;
1200
+ }
1201
+ declare class GitStatusesAPI {
1202
+ private readonly c;
1203
+ constructor(c: GitClient);
1204
+ /** Report a check on a commit (what required checks in branch rules wait for). */
1205
+ create(repo: RepoRef, sha: string, status: CommitStatus): Promise<unknown>;
1206
+ list(repo: RepoRef, ref: string): Promise<unknown[]>;
1207
+ combined(repo: RepoRef, ref: string): Promise<CombinedStatus>;
1208
+ }
1209
+ declare class GitNotificationsAPI {
1210
+ private readonly c;
1211
+ constructor(c: GitClient);
1212
+ list(opts?: {
1213
+ all?: boolean;
1214
+ }): Promise<{
1215
+ notifications: Notification[];
1216
+ unread: number;
1217
+ }>;
1218
+ markRead(ids?: number[]): Promise<void>;
1219
+ }
1220
+ declare class GitTokensAPI {
1221
+ private readonly c;
1222
+ constructor(c: GitClient);
1223
+ list(): Promise<Token[]>;
1224
+ /** A Lizard Git token (lzg_...), optionally limited to repos, refs, paths, or read-only. The secret is in `token`, once. */
1225
+ create(opts: TokenOpts): Promise<{
1226
+ id: number;
1227
+ name: string;
1228
+ token: string;
1229
+ }>;
1230
+ delete(id: number): Promise<void>;
1231
+ }
1232
+ /** `lizard.git`: everything Lizard Git does, with the client's API key. */
1233
+ declare class GitAPI {
1234
+ readonly client: GitClient;
1235
+ readonly repos: GitReposAPI;
1236
+ readonly issues: GitIssuesOnlyAPI;
1237
+ readonly pulls: GitPullsAPI;
1238
+ readonly actions: GitActionsAPI;
1239
+ readonly collaborators: GitCollaboratorsAPI;
1240
+ readonly webhooks: GitWebhooksAPI;
1241
+ readonly branchRules: GitBranchRulesAPI;
1242
+ readonly labels: GitLabelsAPI;
1243
+ readonly releases: GitReleasesAPI;
1244
+ readonly statuses: GitStatusesAPI;
1245
+ readonly notifications: GitNotificationsAPI;
1246
+ readonly tokens: GitTokensAPI;
1247
+ constructor(config: ConnectionConfig, url?: string);
1248
+ /** Who the key signs in as on Lizard Git. */
1249
+ me(): Promise<GitUser>;
1250
+ user(login: string): Promise<{
1251
+ user: GitUser;
1252
+ starred: Repo[];
1253
+ }>;
1254
+ }
1255
+
463
1256
  /** A process this sandbox is currently running (one started through `exec`). */
464
1257
  interface ProcessInfo {
465
1258
  pid: number;
@@ -714,7 +1507,7 @@ declare class Fs {
714
1507
  * }, 1000)
715
1508
  * ```
716
1509
  *
717
- * Not available on Firecracker sandboxes yet: the call throws `LizardError` (501).
1510
+ * Not available yet: the call throws `LizardError` (501).
718
1511
  */
719
1512
  watch(path: string, opts?: {
720
1513
  recursive?: boolean;
@@ -864,12 +1657,12 @@ interface SandboxInfo {
864
1657
  /** Region the sandbox runs in — the volume's region when one is attached. */
865
1658
  region?: string;
866
1659
  status?: string;
867
- /** The sandbox runtime: `'firecracker'` (a microVM), `'container'`, or `null` when unknown. */
1660
+ /** The sandbox runtime: `'firecracker'` (a microVM), or `null` when unknown. */
868
1661
  runtime?: 'firecracker' | 'container' | null;
869
1662
  pauseError?: string | null;
870
- /** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage, such as one restored from a container snapshot. */
1663
+ /** Machine size (`'small' | 'medium' | 'large'`); may be `null` for a sandbox billed by measured usage. */
871
1664
  size?: 'small' | 'medium' | 'large' | null;
872
- /** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage (a container snapshot). */
1665
+ /** Flat hourly price in USD for `size`, billed per second while running; may be `null` when billed by measured usage. */
873
1666
  pricePerHour?: number | null;
874
1667
  cpus?: number;
875
1668
  memoryMb?: number;
@@ -1011,7 +1804,7 @@ interface SandboxSnapshot {
1011
1804
  */
1012
1805
  type SnapshotScope = 'user' | 'workspace' | 'project';
1013
1806
  interface SnapshotOpts {
1014
- /** Warm copies to keep ready (container sandboxes only; ignored for Firecracker, whose snapshots restore from disk). */
1807
+ /** Warm copies to keep ready for an older snapshot. Firecracker snapshots ignore it: they restore from disk. */
1015
1808
  poolSize?: number;
1016
1809
  /** Where it may be restored. Default `'user'`: any of your projects and workspaces; with a key
1017
1810
  * limited to a workspace or project, only what the key covers (a wider scope is narrowed). */
@@ -1259,11 +2052,11 @@ declare class Sandbox extends SandboxClient {
1259
2052
  * snapshot. A Firecracker snapshot is `ready` as soon as this returns: about 2 s, up to
1260
2053
  * a few minutes for a sandbox that filled most of its memory (its memory is uploaded
1261
2054
  * first), so the call waits up to 11 minutes. Start copies of it with {@link Sandbox.restore}
1262
- * (about 0.4 s each). The source keeps running. `poolSize` applies to container sandboxes only.
2055
+ * (about 0.4 s each). The source keeps running. Firecracker snapshots ignore `poolSize`.
1263
2056
  */
1264
2057
  snapshot(name?: string, opts?: SnapshotOpts): Promise<SandboxSnapshot>;
1265
2058
  unexpose(port: number): Promise<void>;
1266
- /** Stream the sandbox's logs. Not available on Firecracker sandboxes yet (`LizardError`, 501). */
2059
+ /** Stream the sandbox's logs. Not available yet (`LizardError`, 501). */
1267
2060
  logs(opts?: {
1268
2061
  tail?: number;
1269
2062
  signal?: AbortSignal;
@@ -1286,7 +2079,7 @@ declare class Sandbox extends SandboxClient {
1286
2079
  /** Change where a snapshot you took may be restored. */
1287
2080
  static setSnapshotScope(snapshotId: string, scope: SnapshotScope, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
1288
2081
  static setSnapshotWarmPool(snapshotId: string, poolSize: number, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
1289
- /** Release idle warm copies (container snapshots); retain saved state and existing claimed sandboxes. */
2082
+ /** Release idle warm copies of an older snapshot; retain saved state and existing claimed sandboxes. Firecracker snapshots have no warm copies. */
1290
2083
  static pauseSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
1291
2084
  /** Refill the configured warm pool without another capture. */
1292
2085
  static resumeSnapshot(snapshotId: string, opts?: ConnectionOpts): Promise<SandboxSnapshot>;
@@ -1957,7 +2750,7 @@ interface VolumeInfo {
1957
2750
  status: string;
1958
2751
  /** Id of the sandbox the volume is attached to, or `null` when it is free. */
1959
2752
  attachedTo?: string | null;
1960
- /** Creation time: an ISO-8601 string for Firecracker volumes, unix milliseconds for container volumes. */
2753
+ /** Creation time: an ISO-8601 string, or unix milliseconds for an older volume. */
1961
2754
  createdAt: string | number;
1962
2755
  /**
1963
2756
  * Whether `sizeGb` is actually enforced as a hard limit on the volume's node.
@@ -2026,13 +2819,11 @@ declare class Volume {
2026
2819
  /**
2027
2820
  * Resize a volume, by name or by id, to `sizeGb`.
2028
2821
  *
2029
- * A Firecracker volume (the default) can only grow. The change is in place and
2030
- * online: a sandbox with the volume attached keeps running and sees the new size.
2031
- * A smaller size throws `LizardError` (400) with `code: 'volume_shrink_unsupported'`.
2822
+ * A volume grows in place and online: a sandbox with the volume attached keeps
2823
+ * running and sees the new size. A smaller size throws `LizardError` (400) with
2824
+ * `code: 'volume_shrink_unsupported'`.
2032
2825
  *
2033
- * On a container volume the change is in place and online: the size is a quota,
2034
- * so no data is copied and a mounted sandbox sees the new size immediately. Both
2035
- * growing and shrinking are allowed, but a shrink must leave at least 10% of the
2826
+ * An older volume can also shrink, but the shrink must leave at least 10% of the
2036
2827
  * new size free — otherwise it throws `ConflictError` with
2037
2828
  * `code: 'volume_too_full_to_shrink'`.
2038
2829
  *
@@ -2042,7 +2833,7 @@ declare class Volume {
2042
2833
  * `volume_capacity_unavailable`, and `volume_resize_timeout` (a `TimeoutError`;
2043
2834
  * the size is left unchanged).
2044
2835
  *
2045
- * @returns The volume's updated info, including `sizeEnforced` for a container volume.
2836
+ * @returns The volume's updated info, including `sizeEnforced` for an older volume.
2046
2837
  */
2047
2838
  static resize(projectId: string, nameOrId: string, sizeGb: number, opts?: ConnectionOpts): Promise<VolumeInfo>;
2048
2839
  getInfo(projectId: string): Promise<VolumeInfo>;
@@ -2058,6 +2849,8 @@ interface LizardOpts extends ConnectionOpts {
2058
2849
  * management (projects, services, addons, etc.).
2059
2850
  */
2060
2851
  project?: string;
2852
+ /** Lizard Git's address. Defaults to `LIZARD_GIT_URL`, then https://git.lizard.build. */
2853
+ gitUrl?: string;
2061
2854
  }
2062
2855
  /**
2063
2856
  * The Lizard client — entry point for sandboxes and platform management.
@@ -2114,6 +2907,11 @@ declare class Lizard {
2114
2907
  readonly metrics: MetricsAPI;
2115
2908
  readonly storage: StorageAPI;
2116
2909
  readonly github: GitHubAPI;
2910
+ /**
2911
+ * Lizard Git (git.lizard.build): repositories, issues, pull requests, reviews, CI runs,
2912
+ * releases, webhooks, branch rules. Needs a key with no scopes.
2913
+ */
2914
+ readonly git: GitAPI;
2117
2915
  constructor(opts: LizardOpts);
2118
2916
  /** Resolve the client's project reference to a stable project ID (cached). */
2119
2917
  projectId(): Promise<string>;
@@ -2471,4 +3269,4 @@ declare class LizardCLI {
2471
3269
  }): Promise<CLIResult>;
2472
3270
  }
2473
3271
 
2474
- export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitHubAPI, LimitExceededError, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogLine, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type ResaleMultipliers, type ResalePricing, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type Transaction, type TransactionPage, Volume, type VolumeInfo, type Workspace, type WorkspaceLimits, type WorkspaceLimitsInfo, type WorkspaceUsage, WorkspacesAPI, resolveProjectId };
3272
+ export { type Account, type Addon, type AddonType, AddonsAPI, type ApiKey, type ApiKeyScope, ApiKeysAPI, AuthenticationError, type Balance, BillingAPI, type BranchRule, type BranchRuleOpts, type CLIOptions, type CLIResult, type CheckoutSession, type ClickOpts, type CodeContext, CodeSandbox, type CombinedStatus, type CommitFilesOpts, type CommitStatus, ConfigApplyError, type ConfigResult, ConflictError, type ConnectionOpts, type CostMetrics, type CreateAddonOpts, type CreateApiKeyOpts, type CreateContextOpts, type CreateProjectOpts, type CreatePullOpts, type CreateServiceOpts, type CreateVolumeOpts, type CreateWorkspaceOpts, type CreatedApiKey, DEFAULT_GIT_URL, type DeployEvent, DeployHandle, Desktop, type DesktopInfo, type DesktopStartOpts, type DomainInfo, type DomainStatus, DomainsAPI, Execution, ExecutionError, type ExposedPort, type FileInfo, type ForkResult, type FsEvent, type FsOpts, GitAPI, GitActionsAPI, type Artifact as GitArtifact, type Blob$1 as GitBlob, GitBranchRulesAPI, GitClient, type Collaborator as GitCollaborator, GitCollaboratorsAPI, type Commit as GitCommit, type Delivery as GitDelivery, type FileChange as GitFileChange, GitHubAPI, type Invitation as GitInvitation, type Issue as GitIssue, type IssueDetail as GitIssueDetail, type IssueList as GitIssueList, GitIssuesOnlyAPI, type Job as GitJob, type Label as GitLabel, GitLabelsAPI, type Notification as GitNotification, GitNotificationsAPI, GitPullsAPI, type Ref as GitRef, type Release as GitRelease, GitReleasesAPI, type Repo as GitRepo, type RepoMeta as GitRepoMeta, GitReposAPI, type Role as GitRole, type Run as GitRun, GitSecretsAPI, GitStatusesAPI, type Token as GitToken, GitTokensAPI, type TreeEntry as GitTreeEntry, type GitUser, type Webhook as GitWebhook, GitWebhooksAPI, type Workflow as GitWorkflow, LimitExceededError, type LineComment, type ListIssuesOpts, type ListRunsOpts, type ListTransactionsOpts, Lizard, LizardCLI, LizardError, type LizardOpts, type LogChunk, type LogLine, type MergeOpts, type MetricPoint, type MetricRange, MetricsAPI, type MouseButton, NotFoundError, PaymentRequiredError, type Plan, PlatformClient, type ProcessInfo, type ProcessOpts, type ProcessResult, type ProcessSignal, type Project, type ProjectConfig, type ProjectCost, ProjectsAPI, type PromoRedemption, type RawMetrics, type Region, RegionsAPI, type ReleaseOpts, type RepoRef, type ResaleMultipliers, type ResalePricing, type ReviewOpts, type RunCodeLanguage, type RunCodeOpts, Sandbox, type SandboxInfo, type SandboxOpts, type SandboxSnapshot, type ScaleOpts, type ScrollDirection, type Secret, SecretsAPI, type Service, type ServiceMetrics, type ServiceUpdate, ServicesAPI, type SetSecretOpts, type SnapshotOpts, type SnapshotScope, type SnapshotWaitOpts, type StartCheckoutOpts, type StartProNowResult, StorageAPI, type StreamEvent, type Subscription, type SubscriptionStatus, TimeoutError, type TokenOpts, type Transaction, type TransactionPage, type UpdateIssueOpts, Volume, type VolumeInfo, type WebhookOpts, type Workspace, type WorkspaceLimits, type WorkspaceLimitsInfo, type WorkspaceUsage, WorkspacesAPI, resolveProjectId };