UNPKG

@finos/legend-server-sdlc

Version:
216 lines 16.9 kB
/** * Copyright (c) 2020-present, Goldman Sachs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { Project } from './models/project/Project.js'; import type { ImportReport } from './models/project/ImportReport.js'; import { type Workspace, WorkspaceType } from './models/workspace/Workspace.js'; import type { Revision, RevisionAlias } from './models/revision/Revision.js'; import type { Workflow, WorkflowStatus } from './models/workflow/Workflow.js'; import type { Review, ReviewState } from './models/review/Review.js'; import type { Version } from './models/version/Version.js'; import type { WorkspaceUpdateReport } from './models/workspace/WorkspaceUpdateReport.js'; import type { ProjectConfiguration } from './models/configuration/ProjectConfiguration.js'; import type { CreateVersionCommand } from './models/version/VersionCommands.js'; import type { ProjectStructureVersion } from './models/configuration/ProjectStructureVersion.js'; import type { User } from './models/User.js'; import { type PlainObject, type TraceData, type RequestHeaders, type Parameters, type RequestProcessConfig, type ResponseProcessConfig, AbstractServerClient, type HttpMethod } from '@finos/legend-shared'; import type { Entity } from '@finos/legend-storage'; import type { CreateProjectCommand, ImportProjectCommand, UpdateProjectCommand } from './models/project/ProjectCommands.js'; import type { UpdateProjectConfigurationCommand } from './models/configuration/ProjectConfigurationCommands.js'; import type { PerformEntitiesChangesCommand, UpdateEntitiesCommand } from './models/entity/EntityCommands.js'; import type { CommitReviewCommand, CreateReviewCommand } from './models/review/ReviewCommands.js'; import type { WorkflowJob } from './models/workflow/WorkflowJob.js'; import type { SDLCServerFeaturesConfiguration } from './models/server/SDLCServerFeaturesConfiguration.js'; import type { Platform } from './models/configuration/Platform.js'; import type { ProjectConfigurationStatusReport } from './models/project/ProjectConfigurationStatus.js'; import type { AuthorizableProjectAction, ProjectAccessRole } from './models/project/ProjectAccess.js'; import type { Patch } from './models/patch/Patch.js'; import type { Comparison } from './models/comparison/Comparison.js'; import type { ReviewApproval } from './models/review/ReviewApproval.js'; export interface ReviewSeachOptions { assignedToMe?: boolean | undefined; authoredByMe?: boolean | undefined; labels?: string[] | undefined; workspaceIdRegex?: string | undefined; workspaceTypes?: WorkspaceType[] | undefined; state?: ReviewState | undefined; since?: Date | undefined; until?: Date | undefined; limit?: number | undefined; } export interface ProjectReviewSeachOptions { state?: ReviewState | undefined; revisionIds?: string[] | undefined; workspaceIdRegex?: string | undefined; workspaceTypes?: WorkspaceType[] | undefined; since?: Date | undefined; until?: Date | undefined; limit?: number | undefined; } export interface SDLCServerClientConfig { env: string; serverUrl: string; baseHeaders?: RequestHeaders | undefined; client?: string | undefined; } export declare class SDLCServerClient extends AbstractServerClient { currentUser?: User; private _features; private _platformDependencyConfiguration?; private env; private client?; constructor(config: SDLCServerClientConfig); setCurrentUser: (value: User) => void; get clientName(): string | undefined; /** * NOTE: Should only be used for test */ _setFeatures(val: SDLCServerFeaturesConfiguration): void; get featuresConfigHasBeenFetched(): boolean; get features(): SDLCServerFeaturesConfiguration; get platforms(): Platform[] | undefined; request<T>(method: HttpMethod, url: string, data: unknown, options: RequestInit, headers?: RequestHeaders | undefined, parameters?: Parameters | undefined, requestProcessConfig?: RequestProcessConfig | undefined, responseProcessConfig?: ResponseProcessConfig | undefined, traceData?: TraceData | undefined): Promise<T>; private getTraceData; private _server; fetchServerFeaturesConfiguration: () => Promise<void>; fetchServerPlatforms: () => Promise<void>; static authorizeCallbackUrl: (authenticationServerUrl: string, callbackURI: string, client?: string) => string; private _auth; isAuthorized: () => Promise<boolean>; hasAcceptedTermsOfService: () => Promise<string[]>; /** * We expose this URL because it is needed for developer to authenticate using SDLC server during development. */ get currentUserUrl(): string; get usersUrl(): string; getCurrentUser: () => Promise<PlainObject<User>>; getUsers: (name: string) => Promise<PlainObject<User>[]>; private _projects; private _project; getProject: (projectId: string) => Promise<PlainObject<Project>>; getProjects: (user: boolean | undefined, search: string | undefined, tag: string[] | undefined, limit: number | undefined) => Promise<PlainObject<Project>[]>; createProject: (command: PlainObject<CreateProjectCommand>) => Promise<PlainObject<Project>>; importProject: (command: PlainObject<ImportProjectCommand>) => Promise<PlainObject<ImportReport>>; updateProject: (projectId: string, command: PlainObject<UpdateProjectCommand>) => Promise<void>; private _authorizedActionProject; getAutorizedActions: (projectId: string) => Promise<AuthorizableProjectAction[]>; private _acessRole; getAccessRole: (projectId: string) => Promise<PlainObject<ProjectAccessRole>>; private _patches; private _patch; private _releasePatch; getPatches: (projectId: string) => Promise<PlainObject<Patch>[]>; createPatch: (projectId: string, sourceVersion: string) => Promise<PlainObject<Workspace>>; getPatch: (projectId: string, patchReleaseVersionId: string) => Promise<PlainObject<Patch>>; releasePatch: (projectId: string, patchReleaseVersionId: string) => Promise<PlainObject<Version>>; private _workspaces; private _groupWorkspaces; private _workspaceByType; private _workspace; /** * This method makes it possible that we don't have to repeat the set of endpoints twice for: * 1. workspaceId === undefined (hence calling the project branch) * 2. and normal workspace branch */ private _adaptiveWorkspace; getWorkspaces: (projectId: string, patchReleaseVersionId?: string | undefined) => Promise<PlainObject<Workspace>[]>; getGroupWorkspaces: (projectId: string, patchReleaseVersionId?: string | undefined) => Promise<PlainObject<Workspace>[]>; getWorkspace: (projectId: string, patchReleaseVersionId: string | undefined, workspaceId: string, workspaceType: WorkspaceType) => Promise<PlainObject<Workspace>>; isWorkspaceOutdated: (projectId: string, workspace: Workspace) => Promise<boolean>; checkIfWorkspaceIsInConflictResolutionMode: (projectId: string, workspace: Workspace) => Promise<boolean>; createWorkspace: (projectId: string, patchReleaseVersionId: string | undefined, workspaceId: string, workspaceType: WorkspaceType) => Promise<PlainObject<Workspace>>; updateWorkspace: (projectId: string, workspace: Workspace) => Promise<PlainObject<WorkspaceUpdateReport>>; deleteWorkspace: (projectId: string, workspace: Workspace) => Promise<PlainObject<Workspace>>; private _revisions; private _revision; getRevisions: (projectId: string, workspace: Workspace | undefined, since: Date | undefined, until: Date | undefined) => Promise<PlainObject<Revision>[]>; getRevision: (projectId: string, workspace: Workspace | undefined, revisionId: string | RevisionAlias) => Promise<PlainObject<Revision>>; private _versions; private _version; getVersions: (projectId: string) => Promise<PlainObject<Version>[]>; getVersion: (projectId: string, versionId: string) => Promise<PlainObject<Version>>; createVersion: (projectId: string, command: PlainObject<CreateVersionCommand>) => Promise<PlainObject<Version>>; getLatestVersion: (projectId: string) => Promise<PlainObject<Version> | undefined>; private _configuration; getConfiguration: (projectId: string, workspace: Workspace | undefined) => Promise<PlainObject<ProjectConfiguration>>; getConfigurationByVersion: (projectId: string, versionId: string) => Promise<PlainObject<ProjectConfiguration>>; getConfigurationByRevision: (projectId: string, workspace: Workspace | undefined, revisionId: string) => Promise<PlainObject<ProjectConfiguration>>; updateConfiguration: (projectId: string, workspace: Workspace | undefined, command: PlainObject<UpdateProjectConfigurationCommand>) => Promise<PlainObject<Revision>>; getLatestProjectStructureVersion: () => Promise<PlainObject<ProjectStructureVersion>>; projectConfigurationStatus: (projectId: string) => Promise<PlainObject<ProjectConfigurationStatusReport>>; private _workflows; private _workflow; private _workflowJobs; private _workflowJob; getWorkflow: (projectId: string, workspace: Workspace | undefined, workflowId: string) => Promise<PlainObject<Workflow>>; getWorkflows: (projectId: string, workspace: Workspace | undefined, status: WorkflowStatus | undefined, revisionIds: string[] | undefined, limit: number | undefined) => Promise<PlainObject<Workflow>[]>; getWorkflowsByRevision: (projectId: string, workspace: Workspace | undefined, revisionId: string | RevisionAlias) => Promise<PlainObject<Workflow>[]>; getWorkflowJobs: (projectId: string, workspace: Workspace | undefined, workflowId: string, status: WorkflowStatus | undefined, revisionIds: string[] | undefined, limit: number | undefined) => Promise<PlainObject<WorkflowJob>[]>; getWorkflowJob: (projectId: string, workspace: Workspace | undefined, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; getWorkflowJobLogs: (projectId: string, workspace: Workspace | undefined, workflowJob: WorkflowJob) => Promise<string>; cancelWorkflowJob: (projectId: string, workspace: Workspace | undefined, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; retryWorkflowJob: (projectId: string, workspace: Workspace | undefined, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; runManualWorkflowJob: (projectId: string, workspace: Workspace | undefined, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; private _workflowsByVersion; private _workflowByVersion; private _workflowJobsByVersion; private _workflowJobByVersion; getWorkflowByVersion: (projectId: string, versionId: string, workflowId: string) => Promise<PlainObject<Workflow>>; getWorkflowsByVersion: (projectId: string, versionId: string, status: WorkflowStatus | undefined, revisionIds: string[] | undefined, limit: number | undefined) => Promise<PlainObject<Workflow>[]>; getWorkflowJobsByVersion: (projectId: string, versionId: string, workflowId: string, status: WorkflowStatus | undefined, revisionIds: string[] | undefined, limit: number | undefined) => Promise<PlainObject<WorkflowJob>[]>; getWorkflowJobByVersion: (projectId: string, versionId: string, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; getWorkflowJobLogsByVersion: (projectId: string, versionId: string, workflowJob: WorkflowJob) => Promise<string>; cancelWorkflowJobByVersion: (projectId: string, versionId: string, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; retryWorkflowJobByVersion: (projectId: string, versionId: string, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; runManualWorkflowJobByVersion: (projectId: string, versionId: string, workflowJob: WorkflowJob) => Promise<PlainObject<WorkflowJob>>; private _entities; getEntities: (projectId: string, workspace: Workspace | undefined) => Promise<PlainObject<Entity>[]>; getEntitiesByRevision: (projectId: string, workspace: Workspace | undefined, revisionId: string | RevisionAlias) => Promise<PlainObject<Entity>[]>; getEntitiesByVersion: (projectId: string, versionId: string) => Promise<PlainObject<Entity>[]>; updateEntities: (projectId: string, workspace: Workspace | undefined, command: PlainObject<UpdateEntitiesCommand>) => Promise<PlainObject<Revision> | undefined>; performEntityChanges: (projectId: string, workspace: Workspace | undefined, command: PerformEntitiesChangesCommand) => Promise<PlainObject<Revision> | undefined>; getWorkspaceEntity: (workspace: Workspace, entityPath: string) => Promise<PlainObject<Entity>>; private _reviews; private _allReviews; private _review; getReviews: (projectId: string, patchReleaseVersionId: string | undefined, options?: ProjectReviewSeachOptions | undefined) => Promise<PlainObject<Review>[]>; getAllReviews: (options?: ReviewSeachOptions | undefined) => Promise<PlainObject<Review>[]>; getReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<ReviewApproval>>; getReviewApprovals: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Review>>; createReview: (projectId: string, patchReleaseVersionId: string | undefined, command: PlainObject<CreateReviewCommand>) => Promise<PlainObject<Review>>; approveReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Review>>; rejectReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Review>>; closeReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Review>>; reopenReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Review>>; commitReview: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string, command: PlainObject<CommitReviewCommand>) => Promise<PlainObject<Review>>; private _reviewComparison; getReviewComparision: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<Comparison>>; getReviewFromConfiguration: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<ProjectConfiguration>>; getReviewToConfiguration: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<PlainObject<ProjectConfiguration>>; getReviewFromEntities: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<Entity>; getReviewFromEntity: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string, entityPath: string) => Promise<Entity>; getReviewToEntities: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string) => Promise<Entity[]>; getReviewToEntity: (projectId: string, patchReleaseVersionId: string | undefined, reviewId: string, entityPath: string) => Promise<Entity>; private _conflictResolution; getWorkspacesInConflictResolutionMode: (projectId: string, patchReleaseVersionId: string | undefined) => Promise<PlainObject<Workspace>[]>; abortConflictResolution: (projectId: string, workspace: Workspace | undefined) => Promise<void>; discardConflictResolutionChanges: (projectId: string, workspace: Workspace | undefined) => Promise<void>; acceptConflictResolution: (projectId: string, workspace: Workspace | undefined, command: PlainObject<PerformEntitiesChangesCommand>) => Promise<void>; isConflictResolutionOutdated: (projectId: string, workspace: Workspace | undefined) => Promise<boolean>; getConflictResolutionRevision: (projectId: string, workspace: Workspace | undefined, revisionId: string | RevisionAlias) => Promise<PlainObject<Revision>>; getEntitiesByRevisionFromWorkspaceInConflictResolutionMode: (projectId: string, workspace: Workspace | undefined, revisionId: string | RevisionAlias) => Promise<PlainObject<Entity>[]>; getConfigurationOfWorkspaceInConflictResolutionMode: (projectId: string, workspace: Workspace | undefined) => Promise<PlainObject<ProjectConfiguration>>; } //# sourceMappingURL=SDLCServerClient.d.ts.map