@lizard-build/sdk 0.1.74 → 0.1.76
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 +101 -2
- package/dist/index.d.ts +101 -2
- package/dist/index.js +70 -2
- package/dist/index.mjs +68 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -895,11 +895,13 @@ declare class GitReposAPI {
|
|
|
895
895
|
name: string;
|
|
896
896
|
}>;
|
|
897
897
|
get(repo: RepoRef): Promise<RepoMeta>;
|
|
898
|
+
/** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
|
|
898
899
|
update(repo: RepoRef, opts: {
|
|
899
900
|
name?: string;
|
|
900
901
|
description?: string;
|
|
901
902
|
private?: boolean;
|
|
902
903
|
defaultBranch?: string;
|
|
904
|
+
apiCommits?: boolean;
|
|
903
905
|
}): Promise<{
|
|
904
906
|
ok: boolean;
|
|
905
907
|
}>;
|
|
@@ -949,7 +951,11 @@ declare class GitReposAPI {
|
|
|
949
951
|
diff: unknown;
|
|
950
952
|
}>;
|
|
951
953
|
compare(repo: RepoRef, base: string, head: string): Promise<unknown>;
|
|
952
|
-
/**
|
|
954
|
+
/**
|
|
955
|
+
* Commit files on the server: no clone, no push. Only on a repository whose admin allowed
|
|
956
|
+
* it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
|
|
957
|
+
* (403 otherwise). Answers 409 when `expect` no longer matches.
|
|
958
|
+
*/
|
|
953
959
|
commitFiles(repo: RepoRef, opts: CommitFilesOpts): Promise<{
|
|
954
960
|
sha: string;
|
|
955
961
|
branch: string;
|
|
@@ -1059,10 +1065,102 @@ declare class GitSecretsAPI {
|
|
|
1059
1065
|
set(repo: RepoRef, name: string, value: string): Promise<void>;
|
|
1060
1066
|
delete(repo: RepoRef, name: string): Promise<void>;
|
|
1061
1067
|
}
|
|
1068
|
+
interface Environment {
|
|
1069
|
+
id: number;
|
|
1070
|
+
name: string;
|
|
1071
|
+
reviewers: string[];
|
|
1072
|
+
preventSelfReview: boolean;
|
|
1073
|
+
waitMinutes: number;
|
|
1074
|
+
branchPolicy: 'all' | 'protected' | 'custom';
|
|
1075
|
+
branches: string[];
|
|
1076
|
+
secrets: string[];
|
|
1077
|
+
variables: string[];
|
|
1078
|
+
createdAt: number;
|
|
1079
|
+
}
|
|
1080
|
+
interface EnvironmentOpts {
|
|
1081
|
+
/** Up to 6 people with write access; any one approves a deployment. */
|
|
1082
|
+
reviewers?: string[];
|
|
1083
|
+
/** Whoever started a run can't approve its deployment. */
|
|
1084
|
+
preventSelfReview?: boolean;
|
|
1085
|
+
/** Minutes after approval before the job starts. */
|
|
1086
|
+
waitMinutes?: number;
|
|
1087
|
+
/** Which branches and tags may deploy: all, protected (with a branch rule), or `branches` patterns. */
|
|
1088
|
+
branchPolicy?: 'all' | 'protected' | 'custom';
|
|
1089
|
+
branches?: string[];
|
|
1090
|
+
}
|
|
1091
|
+
interface Deployment {
|
|
1092
|
+
jobId: number;
|
|
1093
|
+
environment: string;
|
|
1094
|
+
url?: string;
|
|
1095
|
+
state: 'waiting' | 'timer' | 'approved' | 'rejected';
|
|
1096
|
+
readyAt?: number;
|
|
1097
|
+
reviewer?: string;
|
|
1098
|
+
comment?: string;
|
|
1099
|
+
updatedAt: number;
|
|
1100
|
+
canReview: boolean;
|
|
1101
|
+
reviewers?: string[];
|
|
1102
|
+
}
|
|
1103
|
+
interface Variable {
|
|
1104
|
+
name: string;
|
|
1105
|
+
value: string;
|
|
1106
|
+
updatedAt: number;
|
|
1107
|
+
}
|
|
1108
|
+
declare class GitVariablesAPI {
|
|
1109
|
+
private readonly c;
|
|
1110
|
+
private readonly base;
|
|
1111
|
+
constructor(c: GitClient, base: (repo: RepoRef) => string);
|
|
1112
|
+
list(repo: RepoRef): Promise<{
|
|
1113
|
+
variables: Variable[];
|
|
1114
|
+
}>;
|
|
1115
|
+
set(repo: RepoRef, name: string, value: string): Promise<{
|
|
1116
|
+
name: string;
|
|
1117
|
+
}>;
|
|
1118
|
+
delete(repo: RepoRef, name: string): Promise<void>;
|
|
1119
|
+
}
|
|
1120
|
+
/** Environments: deployment protection rules, their secrets and variables (admins). */
|
|
1121
|
+
declare class GitEnvironmentsAPI {
|
|
1122
|
+
private readonly c;
|
|
1123
|
+
constructor(c: GitClient);
|
|
1124
|
+
private path;
|
|
1125
|
+
list(repo: RepoRef): Promise<{
|
|
1126
|
+
environments: Environment[];
|
|
1127
|
+
}>;
|
|
1128
|
+
get(repo: RepoRef, env: string): Promise<Environment>;
|
|
1129
|
+
/** Create it, or change its rules (fields left out stay). */
|
|
1130
|
+
set(repo: RepoRef, env: string, opts?: EnvironmentOpts): Promise<Environment>;
|
|
1131
|
+
delete(repo: RepoRef, env: string): Promise<void>;
|
|
1132
|
+
listSecrets(repo: RepoRef, env: string): Promise<{
|
|
1133
|
+
secrets: Array<{
|
|
1134
|
+
name: string;
|
|
1135
|
+
updatedAt: number;
|
|
1136
|
+
}>;
|
|
1137
|
+
}>;
|
|
1138
|
+
/** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
|
|
1139
|
+
setSecret(repo: RepoRef, env: string, name: string, value: string): Promise<{
|
|
1140
|
+
name: string;
|
|
1141
|
+
}>;
|
|
1142
|
+
deleteSecret(repo: RepoRef, env: string, name: string): Promise<void>;
|
|
1143
|
+
variables(env: string): GitVariablesAPI;
|
|
1144
|
+
}
|
|
1062
1145
|
declare class GitActionsAPI {
|
|
1063
1146
|
private readonly c;
|
|
1064
1147
|
readonly secrets: GitSecretsAPI;
|
|
1148
|
+
/** Repository variables: vars.NAME in every job. */
|
|
1149
|
+
readonly variables: GitVariablesAPI;
|
|
1065
1150
|
constructor(c: GitClient);
|
|
1151
|
+
/** A run's jobs that deploy to an environment, and what each waits for. */
|
|
1152
|
+
deployments(repo: RepoRef, number: number): Promise<{
|
|
1153
|
+
deployments: Deployment[];
|
|
1154
|
+
}>;
|
|
1155
|
+
/** Approve or reject the run's waiting deployments (all you may review, or those named). */
|
|
1156
|
+
reviewDeployments(repo: RepoRef, number: number, opts: {
|
|
1157
|
+
state: 'approved' | 'rejected';
|
|
1158
|
+
environments?: string[];
|
|
1159
|
+
comment?: string;
|
|
1160
|
+
}): Promise<{
|
|
1161
|
+
state: string;
|
|
1162
|
+
environments: string[];
|
|
1163
|
+
}>;
|
|
1066
1164
|
runs(repo: RepoRef, opts?: ListRunsOpts): Promise<{
|
|
1067
1165
|
runs: Run[];
|
|
1068
1166
|
more: boolean;
|
|
@@ -1240,6 +1338,7 @@ declare class GitAPI {
|
|
|
1240
1338
|
readonly issues: GitIssuesOnlyAPI;
|
|
1241
1339
|
readonly pulls: GitPullsAPI;
|
|
1242
1340
|
readonly actions: GitActionsAPI;
|
|
1341
|
+
readonly environments: GitEnvironmentsAPI;
|
|
1243
1342
|
readonly collaborators: GitCollaboratorsAPI;
|
|
1244
1343
|
readonly webhooks: GitWebhooksAPI;
|
|
1245
1344
|
readonly branchRules: GitBranchRulesAPI;
|
|
@@ -3273,4 +3372,4 @@ declare class LizardCLI {
|
|
|
3273
3372
|
}): Promise<CLIResult>;
|
|
3274
3373
|
}
|
|
3275
3374
|
|
|
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 };
|
|
3375
|
+
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
|
@@ -895,11 +895,13 @@ declare class GitReposAPI {
|
|
|
895
895
|
name: string;
|
|
896
896
|
}>;
|
|
897
897
|
get(repo: RepoRef): Promise<RepoMeta>;
|
|
898
|
+
/** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
|
|
898
899
|
update(repo: RepoRef, opts: {
|
|
899
900
|
name?: string;
|
|
900
901
|
description?: string;
|
|
901
902
|
private?: boolean;
|
|
902
903
|
defaultBranch?: string;
|
|
904
|
+
apiCommits?: boolean;
|
|
903
905
|
}): Promise<{
|
|
904
906
|
ok: boolean;
|
|
905
907
|
}>;
|
|
@@ -949,7 +951,11 @@ declare class GitReposAPI {
|
|
|
949
951
|
diff: unknown;
|
|
950
952
|
}>;
|
|
951
953
|
compare(repo: RepoRef, base: string, head: string): Promise<unknown>;
|
|
952
|
-
/**
|
|
954
|
+
/**
|
|
955
|
+
* Commit files on the server: no clone, no push. Only on a repository whose admin allowed
|
|
956
|
+
* it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
|
|
957
|
+
* (403 otherwise). Answers 409 when `expect` no longer matches.
|
|
958
|
+
*/
|
|
953
959
|
commitFiles(repo: RepoRef, opts: CommitFilesOpts): Promise<{
|
|
954
960
|
sha: string;
|
|
955
961
|
branch: string;
|
|
@@ -1059,10 +1065,102 @@ declare class GitSecretsAPI {
|
|
|
1059
1065
|
set(repo: RepoRef, name: string, value: string): Promise<void>;
|
|
1060
1066
|
delete(repo: RepoRef, name: string): Promise<void>;
|
|
1061
1067
|
}
|
|
1068
|
+
interface Environment {
|
|
1069
|
+
id: number;
|
|
1070
|
+
name: string;
|
|
1071
|
+
reviewers: string[];
|
|
1072
|
+
preventSelfReview: boolean;
|
|
1073
|
+
waitMinutes: number;
|
|
1074
|
+
branchPolicy: 'all' | 'protected' | 'custom';
|
|
1075
|
+
branches: string[];
|
|
1076
|
+
secrets: string[];
|
|
1077
|
+
variables: string[];
|
|
1078
|
+
createdAt: number;
|
|
1079
|
+
}
|
|
1080
|
+
interface EnvironmentOpts {
|
|
1081
|
+
/** Up to 6 people with write access; any one approves a deployment. */
|
|
1082
|
+
reviewers?: string[];
|
|
1083
|
+
/** Whoever started a run can't approve its deployment. */
|
|
1084
|
+
preventSelfReview?: boolean;
|
|
1085
|
+
/** Minutes after approval before the job starts. */
|
|
1086
|
+
waitMinutes?: number;
|
|
1087
|
+
/** Which branches and tags may deploy: all, protected (with a branch rule), or `branches` patterns. */
|
|
1088
|
+
branchPolicy?: 'all' | 'protected' | 'custom';
|
|
1089
|
+
branches?: string[];
|
|
1090
|
+
}
|
|
1091
|
+
interface Deployment {
|
|
1092
|
+
jobId: number;
|
|
1093
|
+
environment: string;
|
|
1094
|
+
url?: string;
|
|
1095
|
+
state: 'waiting' | 'timer' | 'approved' | 'rejected';
|
|
1096
|
+
readyAt?: number;
|
|
1097
|
+
reviewer?: string;
|
|
1098
|
+
comment?: string;
|
|
1099
|
+
updatedAt: number;
|
|
1100
|
+
canReview: boolean;
|
|
1101
|
+
reviewers?: string[];
|
|
1102
|
+
}
|
|
1103
|
+
interface Variable {
|
|
1104
|
+
name: string;
|
|
1105
|
+
value: string;
|
|
1106
|
+
updatedAt: number;
|
|
1107
|
+
}
|
|
1108
|
+
declare class GitVariablesAPI {
|
|
1109
|
+
private readonly c;
|
|
1110
|
+
private readonly base;
|
|
1111
|
+
constructor(c: GitClient, base: (repo: RepoRef) => string);
|
|
1112
|
+
list(repo: RepoRef): Promise<{
|
|
1113
|
+
variables: Variable[];
|
|
1114
|
+
}>;
|
|
1115
|
+
set(repo: RepoRef, name: string, value: string): Promise<{
|
|
1116
|
+
name: string;
|
|
1117
|
+
}>;
|
|
1118
|
+
delete(repo: RepoRef, name: string): Promise<void>;
|
|
1119
|
+
}
|
|
1120
|
+
/** Environments: deployment protection rules, their secrets and variables (admins). */
|
|
1121
|
+
declare class GitEnvironmentsAPI {
|
|
1122
|
+
private readonly c;
|
|
1123
|
+
constructor(c: GitClient);
|
|
1124
|
+
private path;
|
|
1125
|
+
list(repo: RepoRef): Promise<{
|
|
1126
|
+
environments: Environment[];
|
|
1127
|
+
}>;
|
|
1128
|
+
get(repo: RepoRef, env: string): Promise<Environment>;
|
|
1129
|
+
/** Create it, or change its rules (fields left out stay). */
|
|
1130
|
+
set(repo: RepoRef, env: string, opts?: EnvironmentOpts): Promise<Environment>;
|
|
1131
|
+
delete(repo: RepoRef, env: string): Promise<void>;
|
|
1132
|
+
listSecrets(repo: RepoRef, env: string): Promise<{
|
|
1133
|
+
secrets: Array<{
|
|
1134
|
+
name: string;
|
|
1135
|
+
updatedAt: number;
|
|
1136
|
+
}>;
|
|
1137
|
+
}>;
|
|
1138
|
+
/** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
|
|
1139
|
+
setSecret(repo: RepoRef, env: string, name: string, value: string): Promise<{
|
|
1140
|
+
name: string;
|
|
1141
|
+
}>;
|
|
1142
|
+
deleteSecret(repo: RepoRef, env: string, name: string): Promise<void>;
|
|
1143
|
+
variables(env: string): GitVariablesAPI;
|
|
1144
|
+
}
|
|
1062
1145
|
declare class GitActionsAPI {
|
|
1063
1146
|
private readonly c;
|
|
1064
1147
|
readonly secrets: GitSecretsAPI;
|
|
1148
|
+
/** Repository variables: vars.NAME in every job. */
|
|
1149
|
+
readonly variables: GitVariablesAPI;
|
|
1065
1150
|
constructor(c: GitClient);
|
|
1151
|
+
/** A run's jobs that deploy to an environment, and what each waits for. */
|
|
1152
|
+
deployments(repo: RepoRef, number: number): Promise<{
|
|
1153
|
+
deployments: Deployment[];
|
|
1154
|
+
}>;
|
|
1155
|
+
/** Approve or reject the run's waiting deployments (all you may review, or those named). */
|
|
1156
|
+
reviewDeployments(repo: RepoRef, number: number, opts: {
|
|
1157
|
+
state: 'approved' | 'rejected';
|
|
1158
|
+
environments?: string[];
|
|
1159
|
+
comment?: string;
|
|
1160
|
+
}): Promise<{
|
|
1161
|
+
state: string;
|
|
1162
|
+
environments: string[];
|
|
1163
|
+
}>;
|
|
1066
1164
|
runs(repo: RepoRef, opts?: ListRunsOpts): Promise<{
|
|
1067
1165
|
runs: Run[];
|
|
1068
1166
|
more: boolean;
|
|
@@ -1240,6 +1338,7 @@ declare class GitAPI {
|
|
|
1240
1338
|
readonly issues: GitIssuesOnlyAPI;
|
|
1241
1339
|
readonly pulls: GitPullsAPI;
|
|
1242
1340
|
readonly actions: GitActionsAPI;
|
|
1341
|
+
readonly environments: GitEnvironmentsAPI;
|
|
1243
1342
|
readonly collaborators: GitCollaboratorsAPI;
|
|
1244
1343
|
readonly webhooks: GitWebhooksAPI;
|
|
1245
1344
|
readonly branchRules: GitBranchRulesAPI;
|
|
@@ -3273,4 +3372,4 @@ declare class LizardCLI {
|
|
|
3273
3372
|
}): Promise<CLIResult>;
|
|
3274
3373
|
}
|
|
3275
3374
|
|
|
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 };
|
|
3375
|
+
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,
|
|
@@ -630,6 +632,7 @@ var GitReposAPI = class {
|
|
|
630
632
|
get(repo) {
|
|
631
633
|
return this.c.get(repoPath(repo));
|
|
632
634
|
}
|
|
635
|
+
/** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
|
|
633
636
|
update(repo, opts) {
|
|
634
637
|
return this.c.patch(repoPath(repo), opts);
|
|
635
638
|
}
|
|
@@ -688,7 +691,11 @@ var GitReposAPI = class {
|
|
|
688
691
|
compare(repo, base, head) {
|
|
689
692
|
return this.c.get(qs(`${repoPath(repo)}/compare`, { base, head }));
|
|
690
693
|
}
|
|
691
|
-
/**
|
|
694
|
+
/**
|
|
695
|
+
* Commit files on the server: no clone, no push. Only on a repository whose admin allowed
|
|
696
|
+
* it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
|
|
697
|
+
* (403 otherwise). Answers 409 when `expect` no longer matches.
|
|
698
|
+
*/
|
|
692
699
|
commitFiles(repo, opts) {
|
|
693
700
|
const { idempotencyKey, ...body } = opts;
|
|
694
701
|
return this.c.request("POST", `${repoPath(repo)}/commits`, body, idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {});
|
|
@@ -813,10 +820,68 @@ var GitSecretsAPI = class {
|
|
|
813
820
|
return this.c.delete(`${repoPath(repo)}/actions/secrets/${seg(name)}`);
|
|
814
821
|
}
|
|
815
822
|
};
|
|
823
|
+
var GitVariablesAPI = class {
|
|
824
|
+
constructor(c, base) {
|
|
825
|
+
this.c = c;
|
|
826
|
+
this.base = base;
|
|
827
|
+
}
|
|
828
|
+
list(repo) {
|
|
829
|
+
return this.c.get(`${this.base(repo)}/variables`);
|
|
830
|
+
}
|
|
831
|
+
set(repo, name, value) {
|
|
832
|
+
return this.c.put(`${this.base(repo)}/variables/${seg(name)}`, { value });
|
|
833
|
+
}
|
|
834
|
+
delete(repo, name) {
|
|
835
|
+
return this.c.delete(`${this.base(repo)}/variables/${seg(name)}`);
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
var GitEnvironmentsAPI = class {
|
|
839
|
+
constructor(c) {
|
|
840
|
+
this.c = c;
|
|
841
|
+
}
|
|
842
|
+
path(repo, env) {
|
|
843
|
+
return `${repoPath(repo)}/actions/environments/${seg(env)}`;
|
|
844
|
+
}
|
|
845
|
+
list(repo) {
|
|
846
|
+
return this.c.get(`${repoPath(repo)}/actions/environments`);
|
|
847
|
+
}
|
|
848
|
+
get(repo, env) {
|
|
849
|
+
return this.c.get(this.path(repo, env));
|
|
850
|
+
}
|
|
851
|
+
/** Create it, or change its rules (fields left out stay). */
|
|
852
|
+
set(repo, env, opts = {}) {
|
|
853
|
+
return this.c.put(this.path(repo, env), opts);
|
|
854
|
+
}
|
|
855
|
+
delete(repo, env) {
|
|
856
|
+
return this.c.delete(this.path(repo, env));
|
|
857
|
+
}
|
|
858
|
+
listSecrets(repo, env) {
|
|
859
|
+
return this.c.get(`${this.path(repo, env)}/secrets`);
|
|
860
|
+
}
|
|
861
|
+
/** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
|
|
862
|
+
setSecret(repo, env, name, value) {
|
|
863
|
+
return this.c.put(`${this.path(repo, env)}/secrets/${seg(name)}`, { value });
|
|
864
|
+
}
|
|
865
|
+
deleteSecret(repo, env, name) {
|
|
866
|
+
return this.c.delete(`${this.path(repo, env)}/secrets/${seg(name)}`);
|
|
867
|
+
}
|
|
868
|
+
variables(env) {
|
|
869
|
+
return new GitVariablesAPI(this.c, (repo) => this.path(repo, env));
|
|
870
|
+
}
|
|
871
|
+
};
|
|
816
872
|
var GitActionsAPI = class {
|
|
817
873
|
constructor(c) {
|
|
818
874
|
this.c = c;
|
|
819
875
|
this.secrets = new GitSecretsAPI(c);
|
|
876
|
+
this.variables = new GitVariablesAPI(c, (repo) => `${repoPath(repo)}/actions`);
|
|
877
|
+
}
|
|
878
|
+
/** A run's jobs that deploy to an environment, and what each waits for. */
|
|
879
|
+
deployments(repo, number) {
|
|
880
|
+
return this.c.get(`${repoPath(repo)}/actions/runs/${number}/deployments`);
|
|
881
|
+
}
|
|
882
|
+
/** Approve or reject the run's waiting deployments (all you may review, or those named). */
|
|
883
|
+
reviewDeployments(repo, number, opts) {
|
|
884
|
+
return this.c.post(`${repoPath(repo)}/actions/runs/${number}/deployments`, opts);
|
|
820
885
|
}
|
|
821
886
|
runs(repo, opts = {}) {
|
|
822
887
|
return this.c.get(qs(`${repoPath(repo)}/actions/runs`, { ...opts }));
|
|
@@ -858,7 +923,7 @@ var GitActionsAPI = class {
|
|
|
858
923
|
const until = Date.now() + (opts.timeoutMs ?? 30 * 6e4);
|
|
859
924
|
for (; ; ) {
|
|
860
925
|
const run = await this.run(repo, number);
|
|
861
|
-
if (!["queued", "running", "waiting", "pending"].includes(run.status)) return run;
|
|
926
|
+
if (!["queued", "running", "waiting", "pending", "dispatched"].includes(run.status)) return run;
|
|
862
927
|
if (Date.now() > until) throw new Error(`run ${number} is still ${run.status}`);
|
|
863
928
|
await new Promise((r) => setTimeout(r, opts.intervalMs ?? 3e3));
|
|
864
929
|
}
|
|
@@ -1064,6 +1129,7 @@ var GitAPI = class {
|
|
|
1064
1129
|
this.issues = new GitIssuesOnlyAPI(c);
|
|
1065
1130
|
this.pulls = new GitPullsAPI(c);
|
|
1066
1131
|
this.actions = new GitActionsAPI(c);
|
|
1132
|
+
this.environments = new GitEnvironmentsAPI(c);
|
|
1067
1133
|
this.collaborators = new GitCollaboratorsAPI(c);
|
|
1068
1134
|
this.webhooks = new GitWebhooksAPI(c);
|
|
1069
1135
|
this.branchRules = new GitBranchRulesAPI(c);
|
|
@@ -3260,6 +3326,7 @@ var LizardCLI = class {
|
|
|
3260
3326
|
GitBranchRulesAPI,
|
|
3261
3327
|
GitClient,
|
|
3262
3328
|
GitCollaboratorsAPI,
|
|
3329
|
+
GitEnvironmentsAPI,
|
|
3263
3330
|
GitHubAPI,
|
|
3264
3331
|
GitIssuesOnlyAPI,
|
|
3265
3332
|
GitLabelsAPI,
|
|
@@ -3270,6 +3337,7 @@ var LizardCLI = class {
|
|
|
3270
3337
|
GitSecretsAPI,
|
|
3271
3338
|
GitStatusesAPI,
|
|
3272
3339
|
GitTokensAPI,
|
|
3340
|
+
GitVariablesAPI,
|
|
3273
3341
|
GitWebhooksAPI,
|
|
3274
3342
|
LimitExceededError,
|
|
3275
3343
|
Lizard,
|
package/dist/index.mjs
CHANGED
|
@@ -560,6 +560,7 @@ var GitReposAPI = class {
|
|
|
560
560
|
get(repo) {
|
|
561
561
|
return this.c.get(repoPath(repo));
|
|
562
562
|
}
|
|
563
|
+
/** `apiCommits`: also accept commits written through the API (`commitFiles`, `land`); new repositories take pushes only. */
|
|
563
564
|
update(repo, opts) {
|
|
564
565
|
return this.c.patch(repoPath(repo), opts);
|
|
565
566
|
}
|
|
@@ -618,7 +619,11 @@ var GitReposAPI = class {
|
|
|
618
619
|
compare(repo, base, head) {
|
|
619
620
|
return this.c.get(qs(`${repoPath(repo)}/compare`, { base, head }));
|
|
620
621
|
}
|
|
621
|
-
/**
|
|
622
|
+
/**
|
|
623
|
+
* Commit files on the server: no clone, no push. Only on a repository whose admin allowed
|
|
624
|
+
* it (`update(repo, { apiCommits: true })`); new repositories take changes by git push only
|
|
625
|
+
* (403 otherwise). Answers 409 when `expect` no longer matches.
|
|
626
|
+
*/
|
|
622
627
|
commitFiles(repo, opts) {
|
|
623
628
|
const { idempotencyKey, ...body } = opts;
|
|
624
629
|
return this.c.request("POST", `${repoPath(repo)}/commits`, body, idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {});
|
|
@@ -743,10 +748,68 @@ var GitSecretsAPI = class {
|
|
|
743
748
|
return this.c.delete(`${repoPath(repo)}/actions/secrets/${seg(name)}`);
|
|
744
749
|
}
|
|
745
750
|
};
|
|
751
|
+
var GitVariablesAPI = class {
|
|
752
|
+
constructor(c, base) {
|
|
753
|
+
this.c = c;
|
|
754
|
+
this.base = base;
|
|
755
|
+
}
|
|
756
|
+
list(repo) {
|
|
757
|
+
return this.c.get(`${this.base(repo)}/variables`);
|
|
758
|
+
}
|
|
759
|
+
set(repo, name, value) {
|
|
760
|
+
return this.c.put(`${this.base(repo)}/variables/${seg(name)}`, { value });
|
|
761
|
+
}
|
|
762
|
+
delete(repo, name) {
|
|
763
|
+
return this.c.delete(`${this.base(repo)}/variables/${seg(name)}`);
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
var GitEnvironmentsAPI = class {
|
|
767
|
+
constructor(c) {
|
|
768
|
+
this.c = c;
|
|
769
|
+
}
|
|
770
|
+
path(repo, env) {
|
|
771
|
+
return `${repoPath(repo)}/actions/environments/${seg(env)}`;
|
|
772
|
+
}
|
|
773
|
+
list(repo) {
|
|
774
|
+
return this.c.get(`${repoPath(repo)}/actions/environments`);
|
|
775
|
+
}
|
|
776
|
+
get(repo, env) {
|
|
777
|
+
return this.c.get(this.path(repo, env));
|
|
778
|
+
}
|
|
779
|
+
/** Create it, or change its rules (fields left out stay). */
|
|
780
|
+
set(repo, env, opts = {}) {
|
|
781
|
+
return this.c.put(this.path(repo, env), opts);
|
|
782
|
+
}
|
|
783
|
+
delete(repo, env) {
|
|
784
|
+
return this.c.delete(this.path(repo, env));
|
|
785
|
+
}
|
|
786
|
+
listSecrets(repo, env) {
|
|
787
|
+
return this.c.get(`${this.path(repo, env)}/secrets`);
|
|
788
|
+
}
|
|
789
|
+
/** Only this environment's jobs get it, after its rules pass; it wins over a repository secret of the same name. */
|
|
790
|
+
setSecret(repo, env, name, value) {
|
|
791
|
+
return this.c.put(`${this.path(repo, env)}/secrets/${seg(name)}`, { value });
|
|
792
|
+
}
|
|
793
|
+
deleteSecret(repo, env, name) {
|
|
794
|
+
return this.c.delete(`${this.path(repo, env)}/secrets/${seg(name)}`);
|
|
795
|
+
}
|
|
796
|
+
variables(env) {
|
|
797
|
+
return new GitVariablesAPI(this.c, (repo) => this.path(repo, env));
|
|
798
|
+
}
|
|
799
|
+
};
|
|
746
800
|
var GitActionsAPI = class {
|
|
747
801
|
constructor(c) {
|
|
748
802
|
this.c = c;
|
|
749
803
|
this.secrets = new GitSecretsAPI(c);
|
|
804
|
+
this.variables = new GitVariablesAPI(c, (repo) => `${repoPath(repo)}/actions`);
|
|
805
|
+
}
|
|
806
|
+
/** A run's jobs that deploy to an environment, and what each waits for. */
|
|
807
|
+
deployments(repo, number) {
|
|
808
|
+
return this.c.get(`${repoPath(repo)}/actions/runs/${number}/deployments`);
|
|
809
|
+
}
|
|
810
|
+
/** Approve or reject the run's waiting deployments (all you may review, or those named). */
|
|
811
|
+
reviewDeployments(repo, number, opts) {
|
|
812
|
+
return this.c.post(`${repoPath(repo)}/actions/runs/${number}/deployments`, opts);
|
|
750
813
|
}
|
|
751
814
|
runs(repo, opts = {}) {
|
|
752
815
|
return this.c.get(qs(`${repoPath(repo)}/actions/runs`, { ...opts }));
|
|
@@ -788,7 +851,7 @@ var GitActionsAPI = class {
|
|
|
788
851
|
const until = Date.now() + (opts.timeoutMs ?? 30 * 6e4);
|
|
789
852
|
for (; ; ) {
|
|
790
853
|
const run = await this.run(repo, number);
|
|
791
|
-
if (!["queued", "running", "waiting", "pending"].includes(run.status)) return run;
|
|
854
|
+
if (!["queued", "running", "waiting", "pending", "dispatched"].includes(run.status)) return run;
|
|
792
855
|
if (Date.now() > until) throw new Error(`run ${number} is still ${run.status}`);
|
|
793
856
|
await new Promise((r) => setTimeout(r, opts.intervalMs ?? 3e3));
|
|
794
857
|
}
|
|
@@ -994,6 +1057,7 @@ var GitAPI = class {
|
|
|
994
1057
|
this.issues = new GitIssuesOnlyAPI(c);
|
|
995
1058
|
this.pulls = new GitPullsAPI(c);
|
|
996
1059
|
this.actions = new GitActionsAPI(c);
|
|
1060
|
+
this.environments = new GitEnvironmentsAPI(c);
|
|
997
1061
|
this.collaborators = new GitCollaboratorsAPI(c);
|
|
998
1062
|
this.webhooks = new GitWebhooksAPI(c);
|
|
999
1063
|
this.branchRules = new GitBranchRulesAPI(c);
|
|
@@ -3189,6 +3253,7 @@ export {
|
|
|
3189
3253
|
GitBranchRulesAPI,
|
|
3190
3254
|
GitClient,
|
|
3191
3255
|
GitCollaboratorsAPI,
|
|
3256
|
+
GitEnvironmentsAPI,
|
|
3192
3257
|
GitHubAPI,
|
|
3193
3258
|
GitIssuesOnlyAPI,
|
|
3194
3259
|
GitLabelsAPI,
|
|
@@ -3199,6 +3264,7 @@ export {
|
|
|
3199
3264
|
GitSecretsAPI,
|
|
3200
3265
|
GitStatusesAPI,
|
|
3201
3266
|
GitTokensAPI,
|
|
3267
|
+
GitVariablesAPI,
|
|
3202
3268
|
GitWebhooksAPI,
|
|
3203
3269
|
LimitExceededError,
|
|
3204
3270
|
Lizard,
|
package/package.json
CHANGED