@lizard-build/sdk 0.1.74 → 0.1.75

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
@@ -1059,10 +1059,102 @@ declare class GitSecretsAPI {
1059
1059
  set(repo: RepoRef, name: string, value: string): Promise<void>;
1060
1060
  delete(repo: RepoRef, name: string): Promise<void>;
1061
1061
  }
1062
+ interface Environment {
1063
+ id: number;
1064
+ name: string;
1065
+ reviewers: string[];
1066
+ preventSelfReview: boolean;
1067
+ waitMinutes: number;
1068
+ branchPolicy: 'all' | 'protected' | 'custom';
1069
+ branches: string[];
1070
+ secrets: string[];
1071
+ variables: string[];
1072
+ createdAt: number;
1073
+ }
1074
+ interface EnvironmentOpts {
1075
+ /** Up to 6 people with write access; any one approves a deployment. */
1076
+ reviewers?: string[];
1077
+ /** Whoever started a run can't approve its deployment. */
1078
+ preventSelfReview?: boolean;
1079
+ /** Minutes after approval before the job starts. */
1080
+ waitMinutes?: number;
1081
+ /** Which branches and tags may deploy: all, protected (with a branch rule), or `branches` patterns. */
1082
+ branchPolicy?: 'all' | 'protected' | 'custom';
1083
+ branches?: string[];
1084
+ }
1085
+ interface Deployment {
1086
+ jobId: number;
1087
+ environment: string;
1088
+ url?: string;
1089
+ state: 'waiting' | 'timer' | 'approved' | 'rejected';
1090
+ readyAt?: number;
1091
+ reviewer?: string;
1092
+ comment?: string;
1093
+ updatedAt: number;
1094
+ canReview: boolean;
1095
+ reviewers?: string[];
1096
+ }
1097
+ interface Variable {
1098
+ name: string;
1099
+ value: string;
1100
+ updatedAt: number;
1101
+ }
1102
+ declare class GitVariablesAPI {
1103
+ private readonly c;
1104
+ private readonly base;
1105
+ constructor(c: GitClient, base: (repo: RepoRef) => string);
1106
+ list(repo: RepoRef): Promise<{
1107
+ variables: Variable[];
1108
+ }>;
1109
+ set(repo: RepoRef, name: string, value: string): Promise<{
1110
+ name: string;
1111
+ }>;
1112
+ delete(repo: RepoRef, name: string): Promise<void>;
1113
+ }
1114
+ /** Environments: deployment protection rules, their secrets and variables (admins). */
1115
+ declare class GitEnvironmentsAPI {
1116
+ private readonly c;
1117
+ constructor(c: GitClient);
1118
+ private path;
1119
+ list(repo: RepoRef): Promise<{
1120
+ environments: Environment[];
1121
+ }>;
1122
+ get(repo: RepoRef, env: string): Promise<Environment>;
1123
+ /** Create it, or change its rules (fields left out stay). */
1124
+ set(repo: RepoRef, env: string, opts?: EnvironmentOpts): Promise<Environment>;
1125
+ delete(repo: RepoRef, env: string): Promise<void>;
1126
+ listSecrets(repo: RepoRef, env: string): Promise<{
1127
+ secrets: Array<{
1128
+ name: string;
1129
+ updatedAt: number;
1130
+ }>;
1131
+ }>;
1132
+ /** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
1133
+ setSecret(repo: RepoRef, env: string, name: string, value: string): Promise<{
1134
+ name: string;
1135
+ }>;
1136
+ deleteSecret(repo: RepoRef, env: string, name: string): Promise<void>;
1137
+ variables(env: string): GitVariablesAPI;
1138
+ }
1062
1139
  declare class GitActionsAPI {
1063
1140
  private readonly c;
1064
1141
  readonly secrets: GitSecretsAPI;
1142
+ /** Repository variables: vars.NAME in every job. */
1143
+ readonly variables: GitVariablesAPI;
1065
1144
  constructor(c: GitClient);
1145
+ /** A run's jobs that deploy to an environment, and what each waits for. */
1146
+ deployments(repo: RepoRef, number: number): Promise<{
1147
+ deployments: Deployment[];
1148
+ }>;
1149
+ /** Approve or reject the run's waiting deployments (all you may review, or those named). */
1150
+ reviewDeployments(repo: RepoRef, number: number, opts: {
1151
+ state: 'approved' | 'rejected';
1152
+ environments?: string[];
1153
+ comment?: string;
1154
+ }): Promise<{
1155
+ state: string;
1156
+ environments: string[];
1157
+ }>;
1066
1158
  runs(repo: RepoRef, opts?: ListRunsOpts): Promise<{
1067
1159
  runs: Run[];
1068
1160
  more: boolean;
@@ -1240,6 +1332,7 @@ declare class GitAPI {
1240
1332
  readonly issues: GitIssuesOnlyAPI;
1241
1333
  readonly pulls: GitPullsAPI;
1242
1334
  readonly actions: GitActionsAPI;
1335
+ readonly environments: GitEnvironmentsAPI;
1243
1336
  readonly collaborators: GitCollaboratorsAPI;
1244
1337
  readonly webhooks: GitWebhooksAPI;
1245
1338
  readonly branchRules: GitBranchRulesAPI;
@@ -3273,4 +3366,4 @@ declare class LizardCLI {
3273
3366
  }): Promise<CLIResult>;
3274
3367
  }
3275
3368
 
3276
- 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 };
3369
+ 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, type EnvironmentOpts, 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 Deployment as GitDeployment, type Environment as GitEnvironment, GitEnvironmentsAPI, 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 Variable as GitVariable, GitVariablesAPI, 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 };
package/dist/index.d.ts CHANGED
@@ -1059,10 +1059,102 @@ declare class GitSecretsAPI {
1059
1059
  set(repo: RepoRef, name: string, value: string): Promise<void>;
1060
1060
  delete(repo: RepoRef, name: string): Promise<void>;
1061
1061
  }
1062
+ interface Environment {
1063
+ id: number;
1064
+ name: string;
1065
+ reviewers: string[];
1066
+ preventSelfReview: boolean;
1067
+ waitMinutes: number;
1068
+ branchPolicy: 'all' | 'protected' | 'custom';
1069
+ branches: string[];
1070
+ secrets: string[];
1071
+ variables: string[];
1072
+ createdAt: number;
1073
+ }
1074
+ interface EnvironmentOpts {
1075
+ /** Up to 6 people with write access; any one approves a deployment. */
1076
+ reviewers?: string[];
1077
+ /** Whoever started a run can't approve its deployment. */
1078
+ preventSelfReview?: boolean;
1079
+ /** Minutes after approval before the job starts. */
1080
+ waitMinutes?: number;
1081
+ /** Which branches and tags may deploy: all, protected (with a branch rule), or `branches` patterns. */
1082
+ branchPolicy?: 'all' | 'protected' | 'custom';
1083
+ branches?: string[];
1084
+ }
1085
+ interface Deployment {
1086
+ jobId: number;
1087
+ environment: string;
1088
+ url?: string;
1089
+ state: 'waiting' | 'timer' | 'approved' | 'rejected';
1090
+ readyAt?: number;
1091
+ reviewer?: string;
1092
+ comment?: string;
1093
+ updatedAt: number;
1094
+ canReview: boolean;
1095
+ reviewers?: string[];
1096
+ }
1097
+ interface Variable {
1098
+ name: string;
1099
+ value: string;
1100
+ updatedAt: number;
1101
+ }
1102
+ declare class GitVariablesAPI {
1103
+ private readonly c;
1104
+ private readonly base;
1105
+ constructor(c: GitClient, base: (repo: RepoRef) => string);
1106
+ list(repo: RepoRef): Promise<{
1107
+ variables: Variable[];
1108
+ }>;
1109
+ set(repo: RepoRef, name: string, value: string): Promise<{
1110
+ name: string;
1111
+ }>;
1112
+ delete(repo: RepoRef, name: string): Promise<void>;
1113
+ }
1114
+ /** Environments: deployment protection rules, their secrets and variables (admins). */
1115
+ declare class GitEnvironmentsAPI {
1116
+ private readonly c;
1117
+ constructor(c: GitClient);
1118
+ private path;
1119
+ list(repo: RepoRef): Promise<{
1120
+ environments: Environment[];
1121
+ }>;
1122
+ get(repo: RepoRef, env: string): Promise<Environment>;
1123
+ /** Create it, or change its rules (fields left out stay). */
1124
+ set(repo: RepoRef, env: string, opts?: EnvironmentOpts): Promise<Environment>;
1125
+ delete(repo: RepoRef, env: string): Promise<void>;
1126
+ listSecrets(repo: RepoRef, env: string): Promise<{
1127
+ secrets: Array<{
1128
+ name: string;
1129
+ updatedAt: number;
1130
+ }>;
1131
+ }>;
1132
+ /** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
1133
+ setSecret(repo: RepoRef, env: string, name: string, value: string): Promise<{
1134
+ name: string;
1135
+ }>;
1136
+ deleteSecret(repo: RepoRef, env: string, name: string): Promise<void>;
1137
+ variables(env: string): GitVariablesAPI;
1138
+ }
1062
1139
  declare class GitActionsAPI {
1063
1140
  private readonly c;
1064
1141
  readonly secrets: GitSecretsAPI;
1142
+ /** Repository variables: vars.NAME in every job. */
1143
+ readonly variables: GitVariablesAPI;
1065
1144
  constructor(c: GitClient);
1145
+ /** A run's jobs that deploy to an environment, and what each waits for. */
1146
+ deployments(repo: RepoRef, number: number): Promise<{
1147
+ deployments: Deployment[];
1148
+ }>;
1149
+ /** Approve or reject the run's waiting deployments (all you may review, or those named). */
1150
+ reviewDeployments(repo: RepoRef, number: number, opts: {
1151
+ state: 'approved' | 'rejected';
1152
+ environments?: string[];
1153
+ comment?: string;
1154
+ }): Promise<{
1155
+ state: string;
1156
+ environments: string[];
1157
+ }>;
1066
1158
  runs(repo: RepoRef, opts?: ListRunsOpts): Promise<{
1067
1159
  runs: Run[];
1068
1160
  more: boolean;
@@ -1240,6 +1332,7 @@ declare class GitAPI {
1240
1332
  readonly issues: GitIssuesOnlyAPI;
1241
1333
  readonly pulls: GitPullsAPI;
1242
1334
  readonly actions: GitActionsAPI;
1335
+ readonly environments: GitEnvironmentsAPI;
1243
1336
  readonly collaborators: GitCollaboratorsAPI;
1244
1337
  readonly webhooks: GitWebhooksAPI;
1245
1338
  readonly branchRules: GitBranchRulesAPI;
@@ -3273,4 +3366,4 @@ declare class LizardCLI {
3273
3366
  }): Promise<CLIResult>;
3274
3367
  }
3275
3368
 
3276
- 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 };
3369
+ 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, type EnvironmentOpts, 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 Deployment as GitDeployment, type Environment as GitEnvironment, GitEnvironmentsAPI, 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 Variable as GitVariable, GitVariablesAPI, 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 };
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  GitBranchRulesAPI: () => GitBranchRulesAPI,
37
37
  GitClient: () => GitClient,
38
38
  GitCollaboratorsAPI: () => GitCollaboratorsAPI,
39
+ GitEnvironmentsAPI: () => GitEnvironmentsAPI,
39
40
  GitHubAPI: () => GitHubAPI,
40
41
  GitIssuesOnlyAPI: () => GitIssuesOnlyAPI,
41
42
  GitLabelsAPI: () => GitLabelsAPI,
@@ -46,6 +47,7 @@ __export(index_exports, {
46
47
  GitSecretsAPI: () => GitSecretsAPI,
47
48
  GitStatusesAPI: () => GitStatusesAPI,
48
49
  GitTokensAPI: () => GitTokensAPI,
50
+ GitVariablesAPI: () => GitVariablesAPI,
49
51
  GitWebhooksAPI: () => GitWebhooksAPI,
50
52
  LimitExceededError: () => LimitExceededError,
51
53
  Lizard: () => Lizard,
@@ -813,10 +815,68 @@ var GitSecretsAPI = class {
813
815
  return this.c.delete(`${repoPath(repo)}/actions/secrets/${seg(name)}`);
814
816
  }
815
817
  };
818
+ var GitVariablesAPI = class {
819
+ constructor(c, base) {
820
+ this.c = c;
821
+ this.base = base;
822
+ }
823
+ list(repo) {
824
+ return this.c.get(`${this.base(repo)}/variables`);
825
+ }
826
+ set(repo, name, value) {
827
+ return this.c.put(`${this.base(repo)}/variables/${seg(name)}`, { value });
828
+ }
829
+ delete(repo, name) {
830
+ return this.c.delete(`${this.base(repo)}/variables/${seg(name)}`);
831
+ }
832
+ };
833
+ var GitEnvironmentsAPI = class {
834
+ constructor(c) {
835
+ this.c = c;
836
+ }
837
+ path(repo, env) {
838
+ return `${repoPath(repo)}/actions/environments/${seg(env)}`;
839
+ }
840
+ list(repo) {
841
+ return this.c.get(`${repoPath(repo)}/actions/environments`);
842
+ }
843
+ get(repo, env) {
844
+ return this.c.get(this.path(repo, env));
845
+ }
846
+ /** Create it, or change its rules (fields left out stay). */
847
+ set(repo, env, opts = {}) {
848
+ return this.c.put(this.path(repo, env), opts);
849
+ }
850
+ delete(repo, env) {
851
+ return this.c.delete(this.path(repo, env));
852
+ }
853
+ listSecrets(repo, env) {
854
+ return this.c.get(`${this.path(repo, env)}/secrets`);
855
+ }
856
+ /** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
857
+ setSecret(repo, env, name, value) {
858
+ return this.c.put(`${this.path(repo, env)}/secrets/${seg(name)}`, { value });
859
+ }
860
+ deleteSecret(repo, env, name) {
861
+ return this.c.delete(`${this.path(repo, env)}/secrets/${seg(name)}`);
862
+ }
863
+ variables(env) {
864
+ return new GitVariablesAPI(this.c, (repo) => this.path(repo, env));
865
+ }
866
+ };
816
867
  var GitActionsAPI = class {
817
868
  constructor(c) {
818
869
  this.c = c;
819
870
  this.secrets = new GitSecretsAPI(c);
871
+ this.variables = new GitVariablesAPI(c, (repo) => `${repoPath(repo)}/actions`);
872
+ }
873
+ /** A run's jobs that deploy to an environment, and what each waits for. */
874
+ deployments(repo, number) {
875
+ return this.c.get(`${repoPath(repo)}/actions/runs/${number}/deployments`);
876
+ }
877
+ /** Approve or reject the run's waiting deployments (all you may review, or those named). */
878
+ reviewDeployments(repo, number, opts) {
879
+ return this.c.post(`${repoPath(repo)}/actions/runs/${number}/deployments`, opts);
820
880
  }
821
881
  runs(repo, opts = {}) {
822
882
  return this.c.get(qs(`${repoPath(repo)}/actions/runs`, { ...opts }));
@@ -858,7 +918,7 @@ var GitActionsAPI = class {
858
918
  const until = Date.now() + (opts.timeoutMs ?? 30 * 6e4);
859
919
  for (; ; ) {
860
920
  const run = await this.run(repo, number);
861
- if (!["queued", "running", "waiting", "pending"].includes(run.status)) return run;
921
+ if (!["queued", "running", "waiting", "pending", "dispatched"].includes(run.status)) return run;
862
922
  if (Date.now() > until) throw new Error(`run ${number} is still ${run.status}`);
863
923
  await new Promise((r) => setTimeout(r, opts.intervalMs ?? 3e3));
864
924
  }
@@ -1064,6 +1124,7 @@ var GitAPI = class {
1064
1124
  this.issues = new GitIssuesOnlyAPI(c);
1065
1125
  this.pulls = new GitPullsAPI(c);
1066
1126
  this.actions = new GitActionsAPI(c);
1127
+ this.environments = new GitEnvironmentsAPI(c);
1067
1128
  this.collaborators = new GitCollaboratorsAPI(c);
1068
1129
  this.webhooks = new GitWebhooksAPI(c);
1069
1130
  this.branchRules = new GitBranchRulesAPI(c);
@@ -3260,6 +3321,7 @@ var LizardCLI = class {
3260
3321
  GitBranchRulesAPI,
3261
3322
  GitClient,
3262
3323
  GitCollaboratorsAPI,
3324
+ GitEnvironmentsAPI,
3263
3325
  GitHubAPI,
3264
3326
  GitIssuesOnlyAPI,
3265
3327
  GitLabelsAPI,
@@ -3270,6 +3332,7 @@ var LizardCLI = class {
3270
3332
  GitSecretsAPI,
3271
3333
  GitStatusesAPI,
3272
3334
  GitTokensAPI,
3335
+ GitVariablesAPI,
3273
3336
  GitWebhooksAPI,
3274
3337
  LimitExceededError,
3275
3338
  Lizard,
package/dist/index.mjs CHANGED
@@ -743,10 +743,68 @@ var GitSecretsAPI = class {
743
743
  return this.c.delete(`${repoPath(repo)}/actions/secrets/${seg(name)}`);
744
744
  }
745
745
  };
746
+ var GitVariablesAPI = class {
747
+ constructor(c, base) {
748
+ this.c = c;
749
+ this.base = base;
750
+ }
751
+ list(repo) {
752
+ return this.c.get(`${this.base(repo)}/variables`);
753
+ }
754
+ set(repo, name, value) {
755
+ return this.c.put(`${this.base(repo)}/variables/${seg(name)}`, { value });
756
+ }
757
+ delete(repo, name) {
758
+ return this.c.delete(`${this.base(repo)}/variables/${seg(name)}`);
759
+ }
760
+ };
761
+ var GitEnvironmentsAPI = class {
762
+ constructor(c) {
763
+ this.c = c;
764
+ }
765
+ path(repo, env) {
766
+ return `${repoPath(repo)}/actions/environments/${seg(env)}`;
767
+ }
768
+ list(repo) {
769
+ return this.c.get(`${repoPath(repo)}/actions/environments`);
770
+ }
771
+ get(repo, env) {
772
+ return this.c.get(this.path(repo, env));
773
+ }
774
+ /** Create it, or change its rules (fields left out stay). */
775
+ set(repo, env, opts = {}) {
776
+ return this.c.put(this.path(repo, env), opts);
777
+ }
778
+ delete(repo, env) {
779
+ return this.c.delete(this.path(repo, env));
780
+ }
781
+ listSecrets(repo, env) {
782
+ return this.c.get(`${this.path(repo, env)}/secrets`);
783
+ }
784
+ /** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
785
+ setSecret(repo, env, name, value) {
786
+ return this.c.put(`${this.path(repo, env)}/secrets/${seg(name)}`, { value });
787
+ }
788
+ deleteSecret(repo, env, name) {
789
+ return this.c.delete(`${this.path(repo, env)}/secrets/${seg(name)}`);
790
+ }
791
+ variables(env) {
792
+ return new GitVariablesAPI(this.c, (repo) => this.path(repo, env));
793
+ }
794
+ };
746
795
  var GitActionsAPI = class {
747
796
  constructor(c) {
748
797
  this.c = c;
749
798
  this.secrets = new GitSecretsAPI(c);
799
+ this.variables = new GitVariablesAPI(c, (repo) => `${repoPath(repo)}/actions`);
800
+ }
801
+ /** A run's jobs that deploy to an environment, and what each waits for. */
802
+ deployments(repo, number) {
803
+ return this.c.get(`${repoPath(repo)}/actions/runs/${number}/deployments`);
804
+ }
805
+ /** Approve or reject the run's waiting deployments (all you may review, or those named). */
806
+ reviewDeployments(repo, number, opts) {
807
+ return this.c.post(`${repoPath(repo)}/actions/runs/${number}/deployments`, opts);
750
808
  }
751
809
  runs(repo, opts = {}) {
752
810
  return this.c.get(qs(`${repoPath(repo)}/actions/runs`, { ...opts }));
@@ -788,7 +846,7 @@ var GitActionsAPI = class {
788
846
  const until = Date.now() + (opts.timeoutMs ?? 30 * 6e4);
789
847
  for (; ; ) {
790
848
  const run = await this.run(repo, number);
791
- if (!["queued", "running", "waiting", "pending"].includes(run.status)) return run;
849
+ if (!["queued", "running", "waiting", "pending", "dispatched"].includes(run.status)) return run;
792
850
  if (Date.now() > until) throw new Error(`run ${number} is still ${run.status}`);
793
851
  await new Promise((r) => setTimeout(r, opts.intervalMs ?? 3e3));
794
852
  }
@@ -994,6 +1052,7 @@ var GitAPI = class {
994
1052
  this.issues = new GitIssuesOnlyAPI(c);
995
1053
  this.pulls = new GitPullsAPI(c);
996
1054
  this.actions = new GitActionsAPI(c);
1055
+ this.environments = new GitEnvironmentsAPI(c);
997
1056
  this.collaborators = new GitCollaboratorsAPI(c);
998
1057
  this.webhooks = new GitWebhooksAPI(c);
999
1058
  this.branchRules = new GitBranchRulesAPI(c);
@@ -3189,6 +3248,7 @@ export {
3189
3248
  GitBranchRulesAPI,
3190
3249
  GitClient,
3191
3250
  GitCollaboratorsAPI,
3251
+ GitEnvironmentsAPI,
3192
3252
  GitHubAPI,
3193
3253
  GitIssuesOnlyAPI,
3194
3254
  GitLabelsAPI,
@@ -3199,6 +3259,7 @@ export {
3199
3259
  GitSecretsAPI,
3200
3260
  GitStatusesAPI,
3201
3261
  GitTokensAPI,
3262
+ GitVariablesAPI,
3202
3263
  GitWebhooksAPI,
3203
3264
  LimitExceededError,
3204
3265
  Lizard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/sdk",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "description": "TypeScript SDK for Lizard: Firecracker microVM sandboxes, code execution and cloud apps.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",