forked from cerc-io/snowballtools-base
Integrate SP auctions for app deployment (#2)
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75) - Add support for configuring web-app deployers by - - Configuring deployer LRN (for targeted deployments) - Configuring SP auction params for deployment auction (max price and number of providers) Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Reviewed-on: cerc-io/snowballtools-base#2
This commit is contained in:
@@ -1 +1 @@
|
||||
# dist
|
||||
dist
|
||||
|
||||
Vendored
-295
@@ -1,295 +0,0 @@
|
||||
declare enum Role {
|
||||
Owner = "Owner",
|
||||
Maintainer = "Maintainer",
|
||||
Reader = "Reader"
|
||||
}
|
||||
declare enum Permission {
|
||||
View = "View",
|
||||
Edit = "Edit"
|
||||
}
|
||||
declare enum Environment {
|
||||
Production = "Production",
|
||||
Preview = "Preview",
|
||||
Development = "Development"
|
||||
}
|
||||
declare enum DeploymentStatus {
|
||||
Building = "Building",
|
||||
Ready = "Ready",
|
||||
Error = "Error",
|
||||
Deleting = "Deleting"
|
||||
}
|
||||
declare enum DomainStatus {
|
||||
Live = "Live",
|
||||
Pending = "Pending"
|
||||
}
|
||||
type EnvironmentVariable = {
|
||||
id: string;
|
||||
environment: Environment;
|
||||
key: string;
|
||||
value: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type Domain = {
|
||||
id: string;
|
||||
branch: string;
|
||||
name: string;
|
||||
status: DomainStatus;
|
||||
redirectTo: Domain | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type User = {
|
||||
id: string;
|
||||
name: string | null;
|
||||
email: string;
|
||||
isVerified: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
gitHubToken: string | null;
|
||||
};
|
||||
type Deployment = {
|
||||
id: string;
|
||||
domain: Domain;
|
||||
branch: string;
|
||||
commitHash: string;
|
||||
commitMessage: string;
|
||||
url?: string;
|
||||
environment: Environment;
|
||||
isCurrent: boolean;
|
||||
status: DeploymentStatus;
|
||||
createdBy: User;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type OrganizationMember = {
|
||||
id: string;
|
||||
member: User;
|
||||
role: Role;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type ProjectMember = {
|
||||
id: string;
|
||||
member: User;
|
||||
permissions: Permission[];
|
||||
isPending: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type OrganizationProject = {
|
||||
id: string;
|
||||
owner: User;
|
||||
deployments: Deployment[];
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
description: string;
|
||||
template: string;
|
||||
framework: string;
|
||||
webhooks: string[];
|
||||
members: ProjectMember[];
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type Organization = {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
projects: OrganizationProject[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
members: OrganizationMember[];
|
||||
};
|
||||
type Project = {
|
||||
id: string;
|
||||
owner: User;
|
||||
deployments: Deployment[];
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
description: string;
|
||||
template: string;
|
||||
framework: string;
|
||||
webhooks: string[];
|
||||
members: ProjectMember[];
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
organization: Organization;
|
||||
icon: string;
|
||||
subDomain: string;
|
||||
};
|
||||
type GetProjectMembersResponse = {
|
||||
projectMembers: ProjectMember[];
|
||||
};
|
||||
type AddProjectMemberResponse = {
|
||||
addProjectMember: boolean;
|
||||
};
|
||||
type RemoveProjectMemberResponse = {
|
||||
removeProjectMember: boolean;
|
||||
};
|
||||
type UpdateProjectMemberResponse = {
|
||||
updateProjectMember: boolean;
|
||||
};
|
||||
type GetDeploymentsResponse = {
|
||||
deployments: Deployment[];
|
||||
};
|
||||
type GetEnvironmentVariablesResponse = {
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
};
|
||||
type GetOrganizationsResponse = {
|
||||
organizations: Organization[];
|
||||
};
|
||||
type GetUserResponse = {
|
||||
user: User;
|
||||
};
|
||||
type GetProjectResponse = {
|
||||
project: Project | null;
|
||||
};
|
||||
type GetProjectsInOrganizationResponse = {
|
||||
projectsInOrganization: Project[];
|
||||
};
|
||||
type GetDomainsResponse = {
|
||||
domains: Domain[];
|
||||
};
|
||||
type SearchProjectsResponse = {
|
||||
searchProjects: Project[];
|
||||
};
|
||||
type AddEnvironmentVariablesResponse = {
|
||||
addEnvironmentVariables: boolean;
|
||||
};
|
||||
type AddEnvironmentVariableInput = {
|
||||
environments: string[];
|
||||
key: string;
|
||||
value: string;
|
||||
};
|
||||
type UpdateEnvironmentVariableInput = {
|
||||
key: string;
|
||||
value: string;
|
||||
};
|
||||
type UpdateProjectMemberInput = {
|
||||
permissions: Permission[];
|
||||
};
|
||||
type AddProjectMemberInput = {
|
||||
email: string;
|
||||
permissions: Permission[];
|
||||
};
|
||||
type UpdateEnvironmentVariableResponse = {
|
||||
updateEnvironmentVariable: boolean;
|
||||
};
|
||||
type RemoveEnvironmentVariableResponse = {
|
||||
removeEnvironmentVariable: boolean;
|
||||
};
|
||||
type UpdateDeploymentToProdResponse = {
|
||||
updateDeploymentToProd: boolean;
|
||||
};
|
||||
type AddProjectFromTemplateResponse = {
|
||||
addProjectFromTemplate: Project;
|
||||
};
|
||||
type AddProjectResponse = {
|
||||
addProject: Project;
|
||||
};
|
||||
type UpdateProjectResponse = {
|
||||
updateProject: boolean;
|
||||
};
|
||||
type UpdateDomainResponse = {
|
||||
updateDomain: boolean;
|
||||
};
|
||||
type DeleteProjectResponse = {
|
||||
deleteProject: boolean;
|
||||
};
|
||||
type DeleteDomainResponse = {
|
||||
deleteDomain: boolean;
|
||||
};
|
||||
type AddProjectFromTemplateInput = {
|
||||
templateOwner: string;
|
||||
templateRepo: string;
|
||||
owner: string;
|
||||
name: string;
|
||||
isPrivate: boolean;
|
||||
};
|
||||
type AddProjectInput = {
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
template?: string;
|
||||
};
|
||||
type UpdateProjectInput = {
|
||||
name?: string;
|
||||
description?: string;
|
||||
prodBranch?: string;
|
||||
webhooks?: string[];
|
||||
organizationId?: string;
|
||||
};
|
||||
type UpdateDomainInput = {
|
||||
name?: string;
|
||||
branch?: string;
|
||||
redirectToId?: string | null;
|
||||
};
|
||||
type RedeployToProdResponse = {
|
||||
redeployToProd: boolean;
|
||||
};
|
||||
type RollbackDeploymentResponse = {
|
||||
rollbackDeployment: boolean;
|
||||
};
|
||||
type DeleteDeploymentResponse = {
|
||||
deleteDeployment: boolean;
|
||||
};
|
||||
type AddDomainInput = {
|
||||
name: string;
|
||||
};
|
||||
type FilterDomainInput = {
|
||||
branch?: string;
|
||||
status?: DomainStatus;
|
||||
};
|
||||
type AddDomainResponse = {
|
||||
addDomain: true;
|
||||
};
|
||||
type AuthenticateGitHubResponse = {
|
||||
authenticateGitHub: {
|
||||
token: string;
|
||||
};
|
||||
};
|
||||
type UnauthenticateGitHubResponse = {
|
||||
unauthenticateGitHub: boolean;
|
||||
};
|
||||
|
||||
interface GraphQLConfig {
|
||||
gqlEndpoint: string;
|
||||
}
|
||||
declare class GQLClient {
|
||||
private client;
|
||||
constructor(config: GraphQLConfig);
|
||||
getUser(): Promise<GetUserResponse>;
|
||||
getProject(projectId: string): Promise<GetProjectResponse>;
|
||||
getProjectsInOrganization(organizationSlug: string): Promise<GetProjectsInOrganizationResponse>;
|
||||
getOrganizations(): Promise<GetOrganizationsResponse>;
|
||||
getDeployments(projectId: string): Promise<GetDeploymentsResponse>;
|
||||
getEnvironmentVariables(projectId: string): Promise<GetEnvironmentVariablesResponse>;
|
||||
getProjectMembers(projectId: string): Promise<GetProjectMembersResponse>;
|
||||
addProjectMember(projectId: string, data: AddProjectMemberInput): Promise<AddProjectMemberResponse>;
|
||||
updateProjectMember(projectMemberId: string, data: UpdateProjectMemberInput): Promise<UpdateProjectMemberResponse>;
|
||||
removeProjectMember(projectMemberId: string): Promise<RemoveProjectMemberResponse>;
|
||||
searchProjects(searchText: string): Promise<SearchProjectsResponse>;
|
||||
addEnvironmentVariables(projectId: string, data: AddEnvironmentVariableInput[]): Promise<AddEnvironmentVariablesResponse>;
|
||||
updateEnvironmentVariable(environmentVariableId: string, data: UpdateEnvironmentVariableInput): Promise<UpdateEnvironmentVariableResponse>;
|
||||
removeEnvironmentVariable(environmentVariableId: string): Promise<RemoveEnvironmentVariableResponse>;
|
||||
updateDeploymentToProd(deploymentId: string): Promise<UpdateDeploymentToProdResponse>;
|
||||
addProjectFromTemplate(organizationSlug: string, data: AddProjectFromTemplateInput): Promise<AddProjectFromTemplateResponse>;
|
||||
addProject(organizationSlug: string, data: AddProjectInput): Promise<AddProjectResponse>;
|
||||
updateProject(projectId: string, data: UpdateProjectInput): Promise<UpdateProjectResponse>;
|
||||
updateDomain(domainId: string, data: UpdateDomainInput): Promise<UpdateDomainResponse>;
|
||||
redeployToProd(deploymentId: string): Promise<RedeployToProdResponse>;
|
||||
deleteProject(projectId: string): Promise<DeleteProjectResponse>;
|
||||
deleteDomain(domainId: string): Promise<DeleteDomainResponse>;
|
||||
rollbackDeployment(projectId: string, deploymentId: string): Promise<RollbackDeploymentResponse>;
|
||||
deleteDeployment(deploymentId: string): Promise<DeleteDeploymentResponse>;
|
||||
addDomain(projectId: string, data: AddDomainInput): Promise<AddDomainResponse>;
|
||||
getDomains(projectId: string, filter?: FilterDomainInput): Promise<GetDomainsResponse>;
|
||||
authenticateGitHub(code: string): Promise<AuthenticateGitHubResponse>;
|
||||
unauthenticateGithub(): Promise<UnauthenticateGitHubResponse>;
|
||||
}
|
||||
|
||||
export { type AddDomainInput, type AddDomainResponse, type AddEnvironmentVariableInput, type AddEnvironmentVariablesResponse, type AddProjectFromTemplateInput, type AddProjectFromTemplateResponse, type AddProjectInput, type AddProjectMemberInput, type AddProjectMemberResponse, type AddProjectResponse, type AuthenticateGitHubResponse, type DeleteDeploymentResponse, type DeleteDomainResponse, type DeleteProjectResponse, type Deployment, DeploymentStatus, type Domain, DomainStatus, Environment, type EnvironmentVariable, type FilterDomainInput, GQLClient, type GetDeploymentsResponse, type GetDomainsResponse, type GetEnvironmentVariablesResponse, type GetOrganizationsResponse, type GetProjectMembersResponse, type GetProjectResponse, type GetProjectsInOrganizationResponse, type GetUserResponse, type GraphQLConfig, type Organization, type OrganizationMember, type OrganizationProject, Permission, type Project, type ProjectMember, type RedeployToProdResponse, type RemoveEnvironmentVariableResponse, type RemoveProjectMemberResponse, Role, type RollbackDeploymentResponse, type SearchProjectsResponse, type UnauthenticateGitHubResponse, type UpdateDeploymentToProdResponse, type UpdateDomainInput, type UpdateDomainResponse, type UpdateEnvironmentVariableInput, type UpdateEnvironmentVariableResponse, type UpdateProjectInput, type UpdateProjectMemberInput, type UpdateProjectMemberResponse, type UpdateProjectResponse, type User };
|
||||
Vendored
-295
@@ -1,295 +0,0 @@
|
||||
declare enum Role {
|
||||
Owner = "Owner",
|
||||
Maintainer = "Maintainer",
|
||||
Reader = "Reader"
|
||||
}
|
||||
declare enum Permission {
|
||||
View = "View",
|
||||
Edit = "Edit"
|
||||
}
|
||||
declare enum Environment {
|
||||
Production = "Production",
|
||||
Preview = "Preview",
|
||||
Development = "Development"
|
||||
}
|
||||
declare enum DeploymentStatus {
|
||||
Building = "Building",
|
||||
Ready = "Ready",
|
||||
Error = "Error",
|
||||
Deleting = "Deleting"
|
||||
}
|
||||
declare enum DomainStatus {
|
||||
Live = "Live",
|
||||
Pending = "Pending"
|
||||
}
|
||||
type EnvironmentVariable = {
|
||||
id: string;
|
||||
environment: Environment;
|
||||
key: string;
|
||||
value: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type Domain = {
|
||||
id: string;
|
||||
branch: string;
|
||||
name: string;
|
||||
status: DomainStatus;
|
||||
redirectTo: Domain | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type User = {
|
||||
id: string;
|
||||
name: string | null;
|
||||
email: string;
|
||||
isVerified: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
gitHubToken: string | null;
|
||||
};
|
||||
type Deployment = {
|
||||
id: string;
|
||||
domain: Domain;
|
||||
branch: string;
|
||||
commitHash: string;
|
||||
commitMessage: string;
|
||||
url?: string;
|
||||
environment: Environment;
|
||||
isCurrent: boolean;
|
||||
status: DeploymentStatus;
|
||||
createdBy: User;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type OrganizationMember = {
|
||||
id: string;
|
||||
member: User;
|
||||
role: Role;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type ProjectMember = {
|
||||
id: string;
|
||||
member: User;
|
||||
permissions: Permission[];
|
||||
isPending: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type OrganizationProject = {
|
||||
id: string;
|
||||
owner: User;
|
||||
deployments: Deployment[];
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
description: string;
|
||||
template: string;
|
||||
framework: string;
|
||||
webhooks: string[];
|
||||
members: ProjectMember[];
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
type Organization = {
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
projects: OrganizationProject[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
members: OrganizationMember[];
|
||||
};
|
||||
type Project = {
|
||||
id: string;
|
||||
owner: User;
|
||||
deployments: Deployment[];
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
description: string;
|
||||
template: string;
|
||||
framework: string;
|
||||
webhooks: string[];
|
||||
members: ProjectMember[];
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
organization: Organization;
|
||||
icon: string;
|
||||
subDomain: string;
|
||||
};
|
||||
type GetProjectMembersResponse = {
|
||||
projectMembers: ProjectMember[];
|
||||
};
|
||||
type AddProjectMemberResponse = {
|
||||
addProjectMember: boolean;
|
||||
};
|
||||
type RemoveProjectMemberResponse = {
|
||||
removeProjectMember: boolean;
|
||||
};
|
||||
type UpdateProjectMemberResponse = {
|
||||
updateProjectMember: boolean;
|
||||
};
|
||||
type GetDeploymentsResponse = {
|
||||
deployments: Deployment[];
|
||||
};
|
||||
type GetEnvironmentVariablesResponse = {
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
};
|
||||
type GetOrganizationsResponse = {
|
||||
organizations: Organization[];
|
||||
};
|
||||
type GetUserResponse = {
|
||||
user: User;
|
||||
};
|
||||
type GetProjectResponse = {
|
||||
project: Project | null;
|
||||
};
|
||||
type GetProjectsInOrganizationResponse = {
|
||||
projectsInOrganization: Project[];
|
||||
};
|
||||
type GetDomainsResponse = {
|
||||
domains: Domain[];
|
||||
};
|
||||
type SearchProjectsResponse = {
|
||||
searchProjects: Project[];
|
||||
};
|
||||
type AddEnvironmentVariablesResponse = {
|
||||
addEnvironmentVariables: boolean;
|
||||
};
|
||||
type AddEnvironmentVariableInput = {
|
||||
environments: string[];
|
||||
key: string;
|
||||
value: string;
|
||||
};
|
||||
type UpdateEnvironmentVariableInput = {
|
||||
key: string;
|
||||
value: string;
|
||||
};
|
||||
type UpdateProjectMemberInput = {
|
||||
permissions: Permission[];
|
||||
};
|
||||
type AddProjectMemberInput = {
|
||||
email: string;
|
||||
permissions: Permission[];
|
||||
};
|
||||
type UpdateEnvironmentVariableResponse = {
|
||||
updateEnvironmentVariable: boolean;
|
||||
};
|
||||
type RemoveEnvironmentVariableResponse = {
|
||||
removeEnvironmentVariable: boolean;
|
||||
};
|
||||
type UpdateDeploymentToProdResponse = {
|
||||
updateDeploymentToProd: boolean;
|
||||
};
|
||||
type AddProjectFromTemplateResponse = {
|
||||
addProjectFromTemplate: Project;
|
||||
};
|
||||
type AddProjectResponse = {
|
||||
addProject: Project;
|
||||
};
|
||||
type UpdateProjectResponse = {
|
||||
updateProject: boolean;
|
||||
};
|
||||
type UpdateDomainResponse = {
|
||||
updateDomain: boolean;
|
||||
};
|
||||
type DeleteProjectResponse = {
|
||||
deleteProject: boolean;
|
||||
};
|
||||
type DeleteDomainResponse = {
|
||||
deleteDomain: boolean;
|
||||
};
|
||||
type AddProjectFromTemplateInput = {
|
||||
templateOwner: string;
|
||||
templateRepo: string;
|
||||
owner: string;
|
||||
name: string;
|
||||
isPrivate: boolean;
|
||||
};
|
||||
type AddProjectInput = {
|
||||
name: string;
|
||||
repository: string;
|
||||
prodBranch: string;
|
||||
template?: string;
|
||||
};
|
||||
type UpdateProjectInput = {
|
||||
name?: string;
|
||||
description?: string;
|
||||
prodBranch?: string;
|
||||
webhooks?: string[];
|
||||
organizationId?: string;
|
||||
};
|
||||
type UpdateDomainInput = {
|
||||
name?: string;
|
||||
branch?: string;
|
||||
redirectToId?: string | null;
|
||||
};
|
||||
type RedeployToProdResponse = {
|
||||
redeployToProd: boolean;
|
||||
};
|
||||
type RollbackDeploymentResponse = {
|
||||
rollbackDeployment: boolean;
|
||||
};
|
||||
type DeleteDeploymentResponse = {
|
||||
deleteDeployment: boolean;
|
||||
};
|
||||
type AddDomainInput = {
|
||||
name: string;
|
||||
};
|
||||
type FilterDomainInput = {
|
||||
branch?: string;
|
||||
status?: DomainStatus;
|
||||
};
|
||||
type AddDomainResponse = {
|
||||
addDomain: true;
|
||||
};
|
||||
type AuthenticateGitHubResponse = {
|
||||
authenticateGitHub: {
|
||||
token: string;
|
||||
};
|
||||
};
|
||||
type UnauthenticateGitHubResponse = {
|
||||
unauthenticateGitHub: boolean;
|
||||
};
|
||||
|
||||
interface GraphQLConfig {
|
||||
gqlEndpoint: string;
|
||||
}
|
||||
declare class GQLClient {
|
||||
private client;
|
||||
constructor(config: GraphQLConfig);
|
||||
getUser(): Promise<GetUserResponse>;
|
||||
getProject(projectId: string): Promise<GetProjectResponse>;
|
||||
getProjectsInOrganization(organizationSlug: string): Promise<GetProjectsInOrganizationResponse>;
|
||||
getOrganizations(): Promise<GetOrganizationsResponse>;
|
||||
getDeployments(projectId: string): Promise<GetDeploymentsResponse>;
|
||||
getEnvironmentVariables(projectId: string): Promise<GetEnvironmentVariablesResponse>;
|
||||
getProjectMembers(projectId: string): Promise<GetProjectMembersResponse>;
|
||||
addProjectMember(projectId: string, data: AddProjectMemberInput): Promise<AddProjectMemberResponse>;
|
||||
updateProjectMember(projectMemberId: string, data: UpdateProjectMemberInput): Promise<UpdateProjectMemberResponse>;
|
||||
removeProjectMember(projectMemberId: string): Promise<RemoveProjectMemberResponse>;
|
||||
searchProjects(searchText: string): Promise<SearchProjectsResponse>;
|
||||
addEnvironmentVariables(projectId: string, data: AddEnvironmentVariableInput[]): Promise<AddEnvironmentVariablesResponse>;
|
||||
updateEnvironmentVariable(environmentVariableId: string, data: UpdateEnvironmentVariableInput): Promise<UpdateEnvironmentVariableResponse>;
|
||||
removeEnvironmentVariable(environmentVariableId: string): Promise<RemoveEnvironmentVariableResponse>;
|
||||
updateDeploymentToProd(deploymentId: string): Promise<UpdateDeploymentToProdResponse>;
|
||||
addProjectFromTemplate(organizationSlug: string, data: AddProjectFromTemplateInput): Promise<AddProjectFromTemplateResponse>;
|
||||
addProject(organizationSlug: string, data: AddProjectInput): Promise<AddProjectResponse>;
|
||||
updateProject(projectId: string, data: UpdateProjectInput): Promise<UpdateProjectResponse>;
|
||||
updateDomain(domainId: string, data: UpdateDomainInput): Promise<UpdateDomainResponse>;
|
||||
redeployToProd(deploymentId: string): Promise<RedeployToProdResponse>;
|
||||
deleteProject(projectId: string): Promise<DeleteProjectResponse>;
|
||||
deleteDomain(domainId: string): Promise<DeleteDomainResponse>;
|
||||
rollbackDeployment(projectId: string, deploymentId: string): Promise<RollbackDeploymentResponse>;
|
||||
deleteDeployment(deploymentId: string): Promise<DeleteDeploymentResponse>;
|
||||
addDomain(projectId: string, data: AddDomainInput): Promise<AddDomainResponse>;
|
||||
getDomains(projectId: string, filter?: FilterDomainInput): Promise<GetDomainsResponse>;
|
||||
authenticateGitHub(code: string): Promise<AuthenticateGitHubResponse>;
|
||||
unauthenticateGithub(): Promise<UnauthenticateGitHubResponse>;
|
||||
}
|
||||
|
||||
export { type AddDomainInput, type AddDomainResponse, type AddEnvironmentVariableInput, type AddEnvironmentVariablesResponse, type AddProjectFromTemplateInput, type AddProjectFromTemplateResponse, type AddProjectInput, type AddProjectMemberInput, type AddProjectMemberResponse, type AddProjectResponse, type AuthenticateGitHubResponse, type DeleteDeploymentResponse, type DeleteDomainResponse, type DeleteProjectResponse, type Deployment, DeploymentStatus, type Domain, DomainStatus, Environment, type EnvironmentVariable, type FilterDomainInput, GQLClient, type GetDeploymentsResponse, type GetDomainsResponse, type GetEnvironmentVariablesResponse, type GetOrganizationsResponse, type GetProjectMembersResponse, type GetProjectResponse, type GetProjectsInOrganizationResponse, type GetUserResponse, type GraphQLConfig, type Organization, type OrganizationMember, type OrganizationProject, Permission, type Project, type ProjectMember, type RedeployToProdResponse, type RemoveEnvironmentVariableResponse, type RemoveProjectMemberResponse, Role, type RollbackDeploymentResponse, type SearchProjectsResponse, type UnauthenticateGitHubResponse, type UpdateDeploymentToProdResponse, type UpdateDomainInput, type UpdateDomainResponse, type UpdateEnvironmentVariableInput, type UpdateEnvironmentVariableResponse, type UpdateProjectInput, type UpdateProjectMemberInput, type UpdateProjectMemberResponse, type UpdateProjectResponse, type User };
|
||||
Vendored
-748
@@ -1,748 +0,0 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var __async = (__this, __arguments, generator) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
var fulfilled = (value) => {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var rejected = (value) => {
|
||||
try {
|
||||
step(generator.throw(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||||
step((generator = generator.apply(__this, __arguments)).next());
|
||||
});
|
||||
};
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
DeploymentStatus: () => DeploymentStatus,
|
||||
DomainStatus: () => DomainStatus,
|
||||
Environment: () => Environment,
|
||||
GQLClient: () => GQLClient,
|
||||
Permission: () => Permission,
|
||||
Role: () => Role
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// src/client.ts
|
||||
var import_client3 = require("@apollo/client");
|
||||
|
||||
// src/queries.ts
|
||||
var import_client = require("@apollo/client");
|
||||
var getUser = import_client.gql`
|
||||
query {
|
||||
user {
|
||||
id
|
||||
name
|
||||
email
|
||||
createdAt
|
||||
updatedAt
|
||||
gitHubToken
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProject = import_client.gql`
|
||||
query ($projectId: String!) {
|
||||
project(projectId: $projectId) {
|
||||
createdAt
|
||||
description
|
||||
id
|
||||
name
|
||||
template
|
||||
updatedAt
|
||||
prodBranch
|
||||
framework
|
||||
repository
|
||||
webhooks
|
||||
icon
|
||||
subDomain
|
||||
organization {
|
||||
id
|
||||
name
|
||||
}
|
||||
owner {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
deployments {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
createdAt
|
||||
environment
|
||||
domain {
|
||||
status
|
||||
branch
|
||||
createdAt
|
||||
updatedAt
|
||||
id
|
||||
name
|
||||
}
|
||||
createdBy {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProjectsInOrganization = import_client.gql`
|
||||
query ($organizationSlug: String!) {
|
||||
projectsInOrganization(organizationSlug: $organizationSlug) {
|
||||
id
|
||||
name
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
prodBranch
|
||||
webhooks
|
||||
repository
|
||||
updatedAt
|
||||
icon
|
||||
subDomain
|
||||
deployments {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
commitMessage
|
||||
createdAt
|
||||
environment
|
||||
domain {
|
||||
status
|
||||
branch
|
||||
createdAt
|
||||
updatedAt
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getOrganizations = import_client.gql`
|
||||
query {
|
||||
organizations {
|
||||
id
|
||||
name
|
||||
slug
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getDeployments = import_client.gql`
|
||||
query ($projectId: String!) {
|
||||
deployments(projectId: $projectId) {
|
||||
id
|
||||
domain{
|
||||
branch
|
||||
createdAt
|
||||
id
|
||||
name
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
branch
|
||||
commitHash
|
||||
commitMessage
|
||||
url
|
||||
environment
|
||||
isCurrent
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getEnvironmentVariables = import_client.gql`
|
||||
query ($projectId: String!) {
|
||||
environmentVariables(projectId: $projectId) {
|
||||
createdAt
|
||||
environment
|
||||
id
|
||||
key
|
||||
updatedAt
|
||||
value
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProjectMembers = import_client.gql`
|
||||
query ($projectId: String!) {
|
||||
projectMembers(projectId: $projectId) {
|
||||
id
|
||||
member {
|
||||
id
|
||||
name
|
||||
email
|
||||
isVerified
|
||||
}
|
||||
isPending
|
||||
createdAt
|
||||
updatedAt
|
||||
permissions
|
||||
}
|
||||
}
|
||||
`;
|
||||
var searchProjects = import_client.gql`
|
||||
query ($searchText: String!) {
|
||||
searchProjects(searchText: $searchText) {
|
||||
id
|
||||
name
|
||||
prodBranch
|
||||
repository
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
prodBranch
|
||||
webhooks
|
||||
updatedAt
|
||||
template
|
||||
repository
|
||||
organization {
|
||||
id
|
||||
name
|
||||
slug
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getDomains = import_client.gql`
|
||||
query ($projectId: String!, $filter: FilterDomainsInput) {
|
||||
domains(projectId: $projectId, filter: $filter) {
|
||||
branch
|
||||
createdAt
|
||||
redirectTo {
|
||||
id
|
||||
name
|
||||
branch
|
||||
status
|
||||
}
|
||||
id
|
||||
name
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// src/mutations.ts
|
||||
var import_client2 = require("@apollo/client");
|
||||
var removeProjectMember = import_client2.gql`
|
||||
mutation ($projectMemberId: String!) {
|
||||
removeProjectMember(projectMemberId: $projectMemberId)
|
||||
}
|
||||
`;
|
||||
var updateProjectMember = import_client2.gql`
|
||||
mutation ($projectMemberId: String!, $data: UpdateProjectMemberInput) {
|
||||
updateProjectMember(projectMemberId: $projectMemberId, data: $data)
|
||||
}
|
||||
`;
|
||||
var addProjectMember = import_client2.gql`
|
||||
mutation ($projectId: String!, $data: AddProjectMemberInput) {
|
||||
addProjectMember(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var addEnvironmentVariables = import_client2.gql`
|
||||
mutation ($projectId: String!, $data: [AddEnvironmentVariableInput!]) {
|
||||
addEnvironmentVariables(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var updateEnvironmentVariable = import_client2.gql`
|
||||
mutation (
|
||||
$environmentVariableId: String!
|
||||
$data: UpdateEnvironmentVariableInput!
|
||||
) {
|
||||
updateEnvironmentVariable(
|
||||
environmentVariableId: $environmentVariableId
|
||||
data: $data
|
||||
)
|
||||
}
|
||||
`;
|
||||
var removeEnvironmentVariable = import_client2.gql`
|
||||
mutation ($environmentVariableId: String!) {
|
||||
removeEnvironmentVariable(environmentVariableId: $environmentVariableId)
|
||||
}
|
||||
`;
|
||||
var updateDeploymentToProd = import_client2.gql`
|
||||
mutation ($deploymentId: String!) {
|
||||
updateDeploymentToProd(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var addProjectFromTemplate = import_client2.gql`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectFromTemplateInput) {
|
||||
addProjectFromTemplate(organizationSlug: $organizationSlug, data: $data) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
var addProject = import_client2.gql`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectInput) {
|
||||
addProject(organizationSlug: $organizationSlug, data: $data) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
var updateProjectMutation = import_client2.gql`
|
||||
mutation ($projectId: String!, $data: UpdateProjectInput) {
|
||||
updateProject(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var updateDomainMutation = import_client2.gql`
|
||||
mutation ($domainId: String!, $data: UpdateDomainInput!) {
|
||||
updateDomain(domainId: $domainId, data: $data)
|
||||
}
|
||||
`;
|
||||
var redeployToProd = import_client2.gql`
|
||||
mutation ($deploymentId: String!) {
|
||||
redeployToProd(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var deleteProject = import_client2.gql`
|
||||
mutation ($projectId: String!) {
|
||||
deleteProject(projectId: $projectId)
|
||||
}
|
||||
`;
|
||||
var deleteDomain = import_client2.gql`
|
||||
mutation ($domainId: String!) {
|
||||
deleteDomain(domainId: $domainId)
|
||||
}
|
||||
`;
|
||||
var rollbackDeployment = import_client2.gql`
|
||||
mutation ($projectId: String!, $deploymentId: String!) {
|
||||
rollbackDeployment(projectId: $projectId, deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var deleteDeployment = import_client2.gql`
|
||||
mutation ($deploymentId: String!) {
|
||||
deleteDeployment(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var addDomain = import_client2.gql`
|
||||
mutation ($projectId: String!, $data: AddDomainInput!) {
|
||||
addDomain(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var authenticateGitHub = import_client2.gql`
|
||||
mutation ($code: String!) {
|
||||
authenticateGitHub(code: $code) {
|
||||
token
|
||||
}
|
||||
}
|
||||
`;
|
||||
var unauthenticateGitHub = import_client2.gql`
|
||||
mutation {
|
||||
unauthenticateGitHub
|
||||
}
|
||||
`;
|
||||
|
||||
// src/client.ts
|
||||
var defaultOptions = {
|
||||
watchQuery: {
|
||||
fetchPolicy: "no-cache",
|
||||
errorPolicy: "ignore"
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: "no-cache",
|
||||
errorPolicy: "all"
|
||||
}
|
||||
};
|
||||
var GQLClient = class {
|
||||
constructor(config) {
|
||||
this.client = new import_client3.ApolloClient({
|
||||
uri: config.gqlEndpoint,
|
||||
cache: new import_client3.InMemoryCache(),
|
||||
defaultOptions,
|
||||
credentials: "include"
|
||||
});
|
||||
}
|
||||
getUser() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getUser
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProject(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getProject,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProjectsInOrganization(organizationSlug) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getProjectsInOrganization,
|
||||
variables: {
|
||||
organizationSlug
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getOrganizations() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getOrganizations
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getDeployments(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getDeployments,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getEnvironmentVariables(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getEnvironmentVariables,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProjectMembers(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.query({
|
||||
query: getProjectMembers,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
addProjectMember(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProjectMember,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateProjectMember(projectMemberId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateProjectMember,
|
||||
variables: {
|
||||
projectMemberId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
removeProjectMember(projectMemberId) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: removeProjectMember,
|
||||
variables: {
|
||||
projectMemberId
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
searchProjects(searchText) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: searchProjects,
|
||||
variables: {
|
||||
searchText
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addEnvironmentVariables(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addEnvironmentVariables,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateEnvironmentVariable(environmentVariableId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateEnvironmentVariable,
|
||||
variables: {
|
||||
environmentVariableId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
removeEnvironmentVariable(environmentVariableId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: removeEnvironmentVariable,
|
||||
variables: {
|
||||
environmentVariableId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
updateDeploymentToProd(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: updateDeploymentToProd,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addProjectFromTemplate(organizationSlug, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProjectFromTemplate,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
addProject(organizationSlug, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProject,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateProject(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateProjectMutation,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateDomain(domainId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateDomainMutation,
|
||||
variables: {
|
||||
domainId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
redeployToProd(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: redeployToProd,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteProject(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteProject,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteDomain(domainId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteDomain,
|
||||
variables: {
|
||||
domainId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
rollbackDeployment(projectId, deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: rollbackDeployment,
|
||||
variables: {
|
||||
projectId,
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteDeployment(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteDeployment,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addDomain(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addDomain,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
getDomains(projectId, filter) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getDomains,
|
||||
variables: {
|
||||
projectId,
|
||||
filter
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
authenticateGitHub(code) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: authenticateGitHub,
|
||||
variables: {
|
||||
code
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
unauthenticateGithub() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: unauthenticateGitHub
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// src/types.ts
|
||||
var Role = /* @__PURE__ */ ((Role2) => {
|
||||
Role2["Owner"] = "Owner";
|
||||
Role2["Maintainer"] = "Maintainer";
|
||||
Role2["Reader"] = "Reader";
|
||||
return Role2;
|
||||
})(Role || {});
|
||||
var Permission = /* @__PURE__ */ ((Permission2) => {
|
||||
Permission2["View"] = "View";
|
||||
Permission2["Edit"] = "Edit";
|
||||
return Permission2;
|
||||
})(Permission || {});
|
||||
var Environment = /* @__PURE__ */ ((Environment2) => {
|
||||
Environment2["Production"] = "Production";
|
||||
Environment2["Preview"] = "Preview";
|
||||
Environment2["Development"] = "Development";
|
||||
return Environment2;
|
||||
})(Environment || {});
|
||||
var DeploymentStatus = /* @__PURE__ */ ((DeploymentStatus2) => {
|
||||
DeploymentStatus2["Building"] = "Building";
|
||||
DeploymentStatus2["Ready"] = "Ready";
|
||||
DeploymentStatus2["Error"] = "Error";
|
||||
DeploymentStatus2["Deleting"] = "Deleting";
|
||||
return DeploymentStatus2;
|
||||
})(DeploymentStatus || {});
|
||||
var DomainStatus = /* @__PURE__ */ ((DomainStatus2) => {
|
||||
DomainStatus2["Live"] = "Live";
|
||||
DomainStatus2["Pending"] = "Pending";
|
||||
return DomainStatus2;
|
||||
})(DomainStatus || {});
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
DeploymentStatus,
|
||||
DomainStatus,
|
||||
Environment,
|
||||
GQLClient,
|
||||
Permission,
|
||||
Role
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
||||
-1
File diff suppressed because one or more lines are too long
Vendored
-720
@@ -1,720 +0,0 @@
|
||||
var __async = (__this, __arguments, generator) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
var fulfilled = (value) => {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var rejected = (value) => {
|
||||
try {
|
||||
step(generator.throw(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||||
step((generator = generator.apply(__this, __arguments)).next());
|
||||
});
|
||||
};
|
||||
|
||||
// src/client.ts
|
||||
import {
|
||||
ApolloClient,
|
||||
InMemoryCache
|
||||
} from "@apollo/client";
|
||||
|
||||
// src/queries.ts
|
||||
import { gql } from "@apollo/client";
|
||||
var getUser = gql`
|
||||
query {
|
||||
user {
|
||||
id
|
||||
name
|
||||
email
|
||||
createdAt
|
||||
updatedAt
|
||||
gitHubToken
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProject = gql`
|
||||
query ($projectId: String!) {
|
||||
project(projectId: $projectId) {
|
||||
createdAt
|
||||
description
|
||||
id
|
||||
name
|
||||
template
|
||||
updatedAt
|
||||
prodBranch
|
||||
framework
|
||||
repository
|
||||
webhooks
|
||||
icon
|
||||
subDomain
|
||||
organization {
|
||||
id
|
||||
name
|
||||
}
|
||||
owner {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
deployments {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
createdAt
|
||||
environment
|
||||
domain {
|
||||
status
|
||||
branch
|
||||
createdAt
|
||||
updatedAt
|
||||
id
|
||||
name
|
||||
}
|
||||
createdBy {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProjectsInOrganization = gql`
|
||||
query ($organizationSlug: String!) {
|
||||
projectsInOrganization(organizationSlug: $organizationSlug) {
|
||||
id
|
||||
name
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
prodBranch
|
||||
webhooks
|
||||
repository
|
||||
updatedAt
|
||||
icon
|
||||
subDomain
|
||||
deployments {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
commitMessage
|
||||
createdAt
|
||||
environment
|
||||
domain {
|
||||
status
|
||||
branch
|
||||
createdAt
|
||||
updatedAt
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getOrganizations = gql`
|
||||
query {
|
||||
organizations {
|
||||
id
|
||||
name
|
||||
slug
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getDeployments = gql`
|
||||
query ($projectId: String!) {
|
||||
deployments(projectId: $projectId) {
|
||||
id
|
||||
domain{
|
||||
branch
|
||||
createdAt
|
||||
id
|
||||
name
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
branch
|
||||
commitHash
|
||||
commitMessage
|
||||
url
|
||||
environment
|
||||
isCurrent
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
createdBy {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getEnvironmentVariables = gql`
|
||||
query ($projectId: String!) {
|
||||
environmentVariables(projectId: $projectId) {
|
||||
createdAt
|
||||
environment
|
||||
id
|
||||
key
|
||||
updatedAt
|
||||
value
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getProjectMembers = gql`
|
||||
query ($projectId: String!) {
|
||||
projectMembers(projectId: $projectId) {
|
||||
id
|
||||
member {
|
||||
id
|
||||
name
|
||||
email
|
||||
isVerified
|
||||
}
|
||||
isPending
|
||||
createdAt
|
||||
updatedAt
|
||||
permissions
|
||||
}
|
||||
}
|
||||
`;
|
||||
var searchProjects = gql`
|
||||
query ($searchText: String!) {
|
||||
searchProjects(searchText: $searchText) {
|
||||
id
|
||||
name
|
||||
prodBranch
|
||||
repository
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
prodBranch
|
||||
webhooks
|
||||
updatedAt
|
||||
template
|
||||
repository
|
||||
organization {
|
||||
id
|
||||
name
|
||||
slug
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
var getDomains = gql`
|
||||
query ($projectId: String!, $filter: FilterDomainsInput) {
|
||||
domains(projectId: $projectId, filter: $filter) {
|
||||
branch
|
||||
createdAt
|
||||
redirectTo {
|
||||
id
|
||||
name
|
||||
branch
|
||||
status
|
||||
}
|
||||
id
|
||||
name
|
||||
status
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// src/mutations.ts
|
||||
import { gql as gql2 } from "@apollo/client";
|
||||
var removeProjectMember = gql2`
|
||||
mutation ($projectMemberId: String!) {
|
||||
removeProjectMember(projectMemberId: $projectMemberId)
|
||||
}
|
||||
`;
|
||||
var updateProjectMember = gql2`
|
||||
mutation ($projectMemberId: String!, $data: UpdateProjectMemberInput) {
|
||||
updateProjectMember(projectMemberId: $projectMemberId, data: $data)
|
||||
}
|
||||
`;
|
||||
var addProjectMember = gql2`
|
||||
mutation ($projectId: String!, $data: AddProjectMemberInput) {
|
||||
addProjectMember(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var addEnvironmentVariables = gql2`
|
||||
mutation ($projectId: String!, $data: [AddEnvironmentVariableInput!]) {
|
||||
addEnvironmentVariables(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var updateEnvironmentVariable = gql2`
|
||||
mutation (
|
||||
$environmentVariableId: String!
|
||||
$data: UpdateEnvironmentVariableInput!
|
||||
) {
|
||||
updateEnvironmentVariable(
|
||||
environmentVariableId: $environmentVariableId
|
||||
data: $data
|
||||
)
|
||||
}
|
||||
`;
|
||||
var removeEnvironmentVariable = gql2`
|
||||
mutation ($environmentVariableId: String!) {
|
||||
removeEnvironmentVariable(environmentVariableId: $environmentVariableId)
|
||||
}
|
||||
`;
|
||||
var updateDeploymentToProd = gql2`
|
||||
mutation ($deploymentId: String!) {
|
||||
updateDeploymentToProd(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var addProjectFromTemplate = gql2`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectFromTemplateInput) {
|
||||
addProjectFromTemplate(organizationSlug: $organizationSlug, data: $data) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
var addProject = gql2`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectInput) {
|
||||
addProject(organizationSlug: $organizationSlug, data: $data) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
var updateProjectMutation = gql2`
|
||||
mutation ($projectId: String!, $data: UpdateProjectInput) {
|
||||
updateProject(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var updateDomainMutation = gql2`
|
||||
mutation ($domainId: String!, $data: UpdateDomainInput!) {
|
||||
updateDomain(domainId: $domainId, data: $data)
|
||||
}
|
||||
`;
|
||||
var redeployToProd = gql2`
|
||||
mutation ($deploymentId: String!) {
|
||||
redeployToProd(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var deleteProject = gql2`
|
||||
mutation ($projectId: String!) {
|
||||
deleteProject(projectId: $projectId)
|
||||
}
|
||||
`;
|
||||
var deleteDomain = gql2`
|
||||
mutation ($domainId: String!) {
|
||||
deleteDomain(domainId: $domainId)
|
||||
}
|
||||
`;
|
||||
var rollbackDeployment = gql2`
|
||||
mutation ($projectId: String!, $deploymentId: String!) {
|
||||
rollbackDeployment(projectId: $projectId, deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var deleteDeployment = gql2`
|
||||
mutation ($deploymentId: String!) {
|
||||
deleteDeployment(deploymentId: $deploymentId)
|
||||
}
|
||||
`;
|
||||
var addDomain = gql2`
|
||||
mutation ($projectId: String!, $data: AddDomainInput!) {
|
||||
addDomain(projectId: $projectId, data: $data)
|
||||
}
|
||||
`;
|
||||
var authenticateGitHub = gql2`
|
||||
mutation ($code: String!) {
|
||||
authenticateGitHub(code: $code) {
|
||||
token
|
||||
}
|
||||
}
|
||||
`;
|
||||
var unauthenticateGitHub = gql2`
|
||||
mutation {
|
||||
unauthenticateGitHub
|
||||
}
|
||||
`;
|
||||
|
||||
// src/client.ts
|
||||
var defaultOptions = {
|
||||
watchQuery: {
|
||||
fetchPolicy: "no-cache",
|
||||
errorPolicy: "ignore"
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: "no-cache",
|
||||
errorPolicy: "all"
|
||||
}
|
||||
};
|
||||
var GQLClient = class {
|
||||
constructor(config) {
|
||||
this.client = new ApolloClient({
|
||||
uri: config.gqlEndpoint,
|
||||
cache: new InMemoryCache(),
|
||||
defaultOptions,
|
||||
credentials: "include"
|
||||
});
|
||||
}
|
||||
getUser() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getUser
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProject(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getProject,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProjectsInOrganization(organizationSlug) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getProjectsInOrganization,
|
||||
variables: {
|
||||
organizationSlug
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getOrganizations() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getOrganizations
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getDeployments(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getDeployments,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getEnvironmentVariables(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getEnvironmentVariables,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
getProjectMembers(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.query({
|
||||
query: getProjectMembers,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
addProjectMember(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProjectMember,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateProjectMember(projectMemberId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateProjectMember,
|
||||
variables: {
|
||||
projectMemberId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
removeProjectMember(projectMemberId) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: removeProjectMember,
|
||||
variables: {
|
||||
projectMemberId
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
searchProjects(searchText) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: searchProjects,
|
||||
variables: {
|
||||
searchText
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addEnvironmentVariables(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addEnvironmentVariables,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateEnvironmentVariable(environmentVariableId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateEnvironmentVariable,
|
||||
variables: {
|
||||
environmentVariableId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
removeEnvironmentVariable(environmentVariableId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: removeEnvironmentVariable,
|
||||
variables: {
|
||||
environmentVariableId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
updateDeploymentToProd(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: updateDeploymentToProd,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addProjectFromTemplate(organizationSlug, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProjectFromTemplate,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
addProject(organizationSlug, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addProject,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateProject(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateProjectMutation,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
updateDomain(domainId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: updateDomainMutation,
|
||||
variables: {
|
||||
domainId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
redeployToProd(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: redeployToProd,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteProject(projectId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteProject,
|
||||
variables: {
|
||||
projectId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteDomain(domainId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteDomain,
|
||||
variables: {
|
||||
domainId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
rollbackDeployment(projectId, deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: rollbackDeployment,
|
||||
variables: {
|
||||
projectId,
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
deleteDeployment(deploymentId) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: deleteDeployment,
|
||||
variables: {
|
||||
deploymentId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
addDomain(projectId, data) {
|
||||
return __async(this, null, function* () {
|
||||
const result = yield this.client.mutate({
|
||||
mutation: addDomain,
|
||||
variables: {
|
||||
projectId,
|
||||
data
|
||||
}
|
||||
});
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
getDomains(projectId, filter) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.query({
|
||||
query: getDomains,
|
||||
variables: {
|
||||
projectId,
|
||||
filter
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
authenticateGitHub(code) {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: authenticateGitHub,
|
||||
variables: {
|
||||
code
|
||||
}
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
unauthenticateGithub() {
|
||||
return __async(this, null, function* () {
|
||||
const { data } = yield this.client.mutate({
|
||||
mutation: unauthenticateGitHub
|
||||
});
|
||||
return data;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// src/types.ts
|
||||
var Role = /* @__PURE__ */ ((Role2) => {
|
||||
Role2["Owner"] = "Owner";
|
||||
Role2["Maintainer"] = "Maintainer";
|
||||
Role2["Reader"] = "Reader";
|
||||
return Role2;
|
||||
})(Role || {});
|
||||
var Permission = /* @__PURE__ */ ((Permission2) => {
|
||||
Permission2["View"] = "View";
|
||||
Permission2["Edit"] = "Edit";
|
||||
return Permission2;
|
||||
})(Permission || {});
|
||||
var Environment = /* @__PURE__ */ ((Environment2) => {
|
||||
Environment2["Production"] = "Production";
|
||||
Environment2["Preview"] = "Preview";
|
||||
Environment2["Development"] = "Development";
|
||||
return Environment2;
|
||||
})(Environment || {});
|
||||
var DeploymentStatus = /* @__PURE__ */ ((DeploymentStatus2) => {
|
||||
DeploymentStatus2["Building"] = "Building";
|
||||
DeploymentStatus2["Ready"] = "Ready";
|
||||
DeploymentStatus2["Error"] = "Error";
|
||||
DeploymentStatus2["Deleting"] = "Deleting";
|
||||
return DeploymentStatus2;
|
||||
})(DeploymentStatus || {});
|
||||
var DomainStatus = /* @__PURE__ */ ((DomainStatus2) => {
|
||||
DomainStatus2["Live"] = "Live";
|
||||
DomainStatus2["Pending"] = "Pending";
|
||||
return DomainStatus2;
|
||||
})(DomainStatus || {});
|
||||
export {
|
||||
DeploymentStatus,
|
||||
DomainStatus,
|
||||
Environment,
|
||||
GQLClient,
|
||||
Permission,
|
||||
Role
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
-1
File diff suppressed because one or more lines are too long
@@ -16,4 +16,4 @@
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.8.9"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,13 +230,17 @@ export class GQLClient {
|
||||
|
||||
async addProjectFromTemplate(
|
||||
organizationSlug: string,
|
||||
data: types.AddProjectFromTemplateInput
|
||||
data: types.AddProjectFromTemplateInput,
|
||||
lrn?: string,
|
||||
auctionParams?: types.AuctionParams,
|
||||
): Promise<types.AddProjectFromTemplateResponse> {
|
||||
const result = await this.client.mutate({
|
||||
mutation: mutations.addProjectFromTemplate,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data,
|
||||
lrn,
|
||||
auctionParams
|
||||
},
|
||||
});
|
||||
|
||||
@@ -245,13 +249,17 @@ export class GQLClient {
|
||||
|
||||
async addProject(
|
||||
organizationSlug: string,
|
||||
data: types.AddProjectInput
|
||||
data: types.AddProjectInput,
|
||||
lrn?: string,
|
||||
auctionParams?: types.AuctionParams,
|
||||
): Promise<types.AddProjectResponse> {
|
||||
const result = await this.client.mutate({
|
||||
mutation: mutations.addProject,
|
||||
variables: {
|
||||
organizationSlug,
|
||||
data,
|
||||
lrn,
|
||||
auctionParams
|
||||
},
|
||||
});
|
||||
|
||||
@@ -401,4 +409,15 @@ export class GQLClient {
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
async getAuctionData(auctionId: string): Promise<types.Auction> {
|
||||
const { data } = await this.client.query({
|
||||
query: queries.getAuctionData,
|
||||
variables: {
|
||||
auctionId,
|
||||
},
|
||||
});
|
||||
|
||||
return data.getAuctionData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,16 +49,16 @@ export const updateDeploymentToProd = gql`
|
||||
`;
|
||||
|
||||
export const addProjectFromTemplate = gql`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectFromTemplateInput) {
|
||||
addProjectFromTemplate(organizationSlug: $organizationSlug, data: $data) {
|
||||
mutation ($organizationSlug: String!, $data: AddProjectFromTemplateInput, $lrn: String, $auctionParams: AuctionParams) {
|
||||
addProjectFromTemplate(organizationSlug: $organizationSlug, data: $data, lrn: $lrn, auctionParams: $auctionParams) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const addProject = gql`
|
||||
mutation ($organizationSlug: String!, $data: AddProjectInput) {
|
||||
addProject(organizationSlug: $organizationSlug, data: $data) {
|
||||
mutation ($organizationSlug: String!, $data: AddProjectInput!, $lrn: String, $auctionParams: AuctionParams) {
|
||||
addProject(organizationSlug: $organizationSlug, data: $data, lrn: $lrn, auctionParams: $auctionParams) {
|
||||
id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,13 @@ query ($projectId: String!) {
|
||||
template
|
||||
updatedAt
|
||||
prodBranch
|
||||
auctionId
|
||||
deployerLrns
|
||||
framework
|
||||
repository
|
||||
webhooks
|
||||
icon
|
||||
subDomain
|
||||
baseDomains
|
||||
organization {
|
||||
id
|
||||
name
|
||||
@@ -41,6 +43,7 @@ query ($projectId: String!) {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
baseDomain
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
@@ -71,16 +74,19 @@ query ($organizationSlug: String!) {
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
auctionId
|
||||
deployerLrns
|
||||
prodBranch
|
||||
webhooks
|
||||
repository
|
||||
updatedAt
|
||||
icon
|
||||
subDomain
|
||||
baseDomains
|
||||
deployments {
|
||||
id
|
||||
branch
|
||||
isCurrent
|
||||
baseDomain
|
||||
status
|
||||
updatedAt
|
||||
commitHash
|
||||
@@ -128,8 +134,10 @@ query ($projectId: String!) {
|
||||
commitHash
|
||||
commitMessage
|
||||
url
|
||||
deployerLrn
|
||||
environment
|
||||
isCurrent
|
||||
baseDomain
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
@@ -183,6 +191,8 @@ query ($searchText: String!) {
|
||||
createdAt
|
||||
description
|
||||
framework
|
||||
auctionId
|
||||
deployerLrns
|
||||
prodBranch
|
||||
webhooks
|
||||
updatedAt
|
||||
@@ -217,3 +227,63 @@ query ($projectId: String!, $filter: FilterDomainsInput) {
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const getAuctionData = gql`
|
||||
query ($auctionId: String!) {
|
||||
getAuctionData(auctionId: $auctionId){
|
||||
id
|
||||
kind
|
||||
status
|
||||
ownerAddress
|
||||
createTime
|
||||
commitsEndTime
|
||||
revealsEndTime
|
||||
commitFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
revealFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
minimumBid {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
winnerAddresses
|
||||
winnerBids {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
winnerPrice {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
maxPrice {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
numProviders
|
||||
fundsReleased
|
||||
bids {
|
||||
bidderAddress
|
||||
status
|
||||
commitHash
|
||||
commitTime
|
||||
revealTime
|
||||
commitFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
revealFee {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
bidAmount {
|
||||
type
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -25,6 +25,45 @@ export enum DeploymentStatus {
|
||||
Deleting = "Deleting",
|
||||
}
|
||||
|
||||
export enum AuctionStatus {
|
||||
AuctionStatusCommitPhase = "commit",
|
||||
AuctionStatusRevealPhase = "reveal",
|
||||
AuctionStatusExpired = "expired",
|
||||
AuctionStatusCompleted = "completed",
|
||||
}
|
||||
|
||||
export type Bid = {
|
||||
auctionId: string;
|
||||
bidderAddress: string;
|
||||
status: string;
|
||||
commitHash: string;
|
||||
commitTime?: Date;
|
||||
commitFee?: string;
|
||||
revealTime?: Date;
|
||||
revealFee?: string;
|
||||
bidAmount?: string;
|
||||
}
|
||||
|
||||
export type Auction = {
|
||||
id: string;
|
||||
kind: string;
|
||||
status: string;
|
||||
ownerAddress: string;
|
||||
createTime?: Date;
|
||||
commitsEndTime?: Date;
|
||||
revealsEndTime?: Date;
|
||||
commitFee?: string;
|
||||
revealFee?: string;
|
||||
minimumBid?: string;
|
||||
winnerAddresses: string[];
|
||||
winnerBids?: string[];
|
||||
winnerPrice?: string;
|
||||
maxPrice?: string;
|
||||
numProviders: number;
|
||||
fundsReleased: boolean;
|
||||
bids: Bid[];
|
||||
}
|
||||
|
||||
export enum DomainStatus {
|
||||
Live = "Live",
|
||||
Pending = "Pending",
|
||||
@@ -66,8 +105,10 @@ export type Deployment = {
|
||||
commitHash: string;
|
||||
commitMessage: string;
|
||||
url?: string;
|
||||
deployerLrn: string;
|
||||
environment: Environment;
|
||||
isCurrent: boolean;
|
||||
baseDomain?: string;
|
||||
status: DeploymentStatus;
|
||||
createdBy: User;
|
||||
createdAt: string;
|
||||
@@ -128,6 +169,8 @@ export type Project = {
|
||||
description: string;
|
||||
template: string;
|
||||
framework: string;
|
||||
deployerLrns: string[];
|
||||
auctionId: string;
|
||||
webhooks: string[];
|
||||
members: ProjectMember[];
|
||||
environmentVariables: EnvironmentVariable[];
|
||||
@@ -135,7 +178,7 @@ export type Project = {
|
||||
updatedAt: string;
|
||||
organization: Organization;
|
||||
icon: string;
|
||||
subDomain: string;
|
||||
baseDomains?: string[] | null;
|
||||
};
|
||||
|
||||
export type GetProjectMembersResponse = {
|
||||
@@ -309,3 +352,8 @@ export type AuthenticateGitHubResponse = {
|
||||
export type UnauthenticateGitHubResponse = {
|
||||
unauthenticateGitHub: boolean;
|
||||
};
|
||||
|
||||
export type AuctionParams = {
|
||||
maxPrice: string;
|
||||
numProviders: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user