projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
190 lines (189 loc) • 7.38 kB
TypeScript
/***
* ProjectManager API for TypeScript
*
* (c) 2023-2025 ProjectManager.com, Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author ProjectManager.com <support@projectmanager.com>
* @copyright 2023-2025 ProjectManager.com, Inc.
* @version 134.0.125
* @link https://github.com/projectmgr/projectmanager-sdk-typescript
*/
import { ApiKeyClient } from "./index.js";
import { ChangesetClient } from "./index.js";
import { DashboardClient } from "./index.js";
import { DiscussionClient } from "./index.js";
import { FileClient } from "./index.js";
import { HolidayClient } from "./index.js";
import { HomeFileClient } from "./index.js";
import { IntegrationClient } from "./index.js";
import { IntegrationCategoryClient } from "./index.js";
import { IntegrationProviderClient } from "./index.js";
import { LicenseClient } from "./index.js";
import { MeClient } from "./index.js";
import { NotificationClient } from "./index.js";
import { NptClient } from "./index.js";
import { NptFilesClient } from "./index.js";
import { NptStatusClient } from "./index.js";
import { ProjectClient } from "./index.js";
import { ProjectChargeCodeClient } from "./index.js";
import { ProjectCustomerClient } from "./index.js";
import { ProjectFieldClient } from "./index.js";
import { ProjectFileClient } from "./index.js";
import { ProjectFolderClient } from "./index.js";
import { ProjectMembersClient } from "./index.js";
import { ProjectPriorityClient } from "./index.js";
import { ProjectStatusClient } from "./index.js";
import { ProjectTemplateClient } from "./index.js";
import { ProjectVersionClient } from "./index.js";
import { ResourceClient } from "./index.js";
import { ResourceSkillClient } from "./index.js";
import { ResourceTeamClient } from "./index.js";
import { RiskClient } from "./index.js";
import { RiskFileClient } from "./index.js";
import { TagClient } from "./index.js";
import { TaskClient } from "./index.js";
import { TaskAssigneeClient } from "./index.js";
import { TaskFieldClient } from "./index.js";
import { TaskFileClient } from "./index.js";
import { TaskMetadataClient } from "./index.js";
import { TaskStatusClient } from "./index.js";
import { TaskTagClient } from "./index.js";
import { TaskTodoClient } from "./index.js";
import { TeamsClient } from "./index.js";
import { TimesheetClient } from "./index.js";
import { UserRoleClient } from "./index.js";
import { WorkSpaceClient } from "./index.js";
import { AstroResult } from "./index.js";
import { Method } from "axios";
/**
* List of headers used by the API
*/
export type ApiHeaders = {
SdkName?: string;
SdkVersion?: string;
MachineName?: string;
ApplicationName?: string;
Authorization?: string;
ApiKey?: string;
};
/**
* Client object used to communicate with the API
*/
export declare class ProjectManagerClient {
private readonly serverUrl;
private readonly version;
private bearerToken;
private sdkName;
private appName;
private customHeaderFunc;
readonly ApiKey: ApiKeyClient;
readonly Changeset: ChangesetClient;
readonly Dashboard: DashboardClient;
readonly Discussion: DiscussionClient;
readonly File: FileClient;
readonly Holiday: HolidayClient;
readonly HomeFile: HomeFileClient;
readonly Integration: IntegrationClient;
readonly IntegrationCategory: IntegrationCategoryClient;
readonly IntegrationProvider: IntegrationProviderClient;
readonly License: LicenseClient;
readonly Me: MeClient;
readonly Notification: NotificationClient;
readonly Npt: NptClient;
readonly NptFiles: NptFilesClient;
readonly NptStatus: NptStatusClient;
readonly Project: ProjectClient;
readonly ProjectChargeCode: ProjectChargeCodeClient;
readonly ProjectCustomer: ProjectCustomerClient;
readonly ProjectField: ProjectFieldClient;
readonly ProjectFile: ProjectFileClient;
readonly ProjectFolder: ProjectFolderClient;
readonly ProjectMembers: ProjectMembersClient;
readonly ProjectPriority: ProjectPriorityClient;
readonly ProjectStatus: ProjectStatusClient;
readonly ProjectTemplate: ProjectTemplateClient;
readonly ProjectVersion: ProjectVersionClient;
readonly Resource: ResourceClient;
readonly ResourceSkill: ResourceSkillClient;
readonly ResourceTeam: ResourceTeamClient;
readonly Risk: RiskClient;
readonly RiskFile: RiskFileClient;
readonly Tag: TagClient;
readonly Task: TaskClient;
readonly TaskAssignee: TaskAssigneeClient;
readonly TaskField: TaskFieldClient;
readonly TaskFile: TaskFileClient;
readonly TaskMetadata: TaskMetadataClient;
readonly TaskStatus: TaskStatusClient;
readonly TaskTag: TaskTagClient;
readonly TaskTodo: TaskTodoClient;
readonly Teams: TeamsClient;
readonly Timesheet: TimesheetClient;
readonly UserRole: UserRoleClient;
readonly WorkSpace: WorkSpaceClient;
/**
* Internal constructor for the API client
*/
private constructor();
/**
* Construct a new API client to target the specific environment.
*
* Predefined environment names:
* * production - https://api.projectmanager.com
*
* @param env The name of the environment to use
* @returns The API client to use
*/
static withEnvironment(env: string): ProjectManagerClient;
/**
* Construct an unsafe client that uses a non-standard server; this can be necessary
* when using proxy servers or an API gateway. Please be careful when using this
* mode. You should prefer to use `withEnvironment()` instead wherever possible.
*
* @param unsafeUrl The custom environment URL to use for this client
* @returns The API client to use
*/
static withCustomEnvironment(unsafeUrl: string): ProjectManagerClient;
/**
* Configure this API client to use a JWT bearer token.
*
*
*
* @param token The JWT bearer token to use for this API session
*/
withBearerToken(token: string): ProjectManagerClient;
/**
* Configure a custom header function that will be called before all requests.
*
* This function can modify the request headers.
*
* @param func The async function to be called to modify headers before any request
* @returns The API client for function chaining
*/
withCustomHeaderFunc(func: (headers: unknown) => Promise<unknown>): ProjectManagerClient;
/**
* Configures this API client to use an application name
*
* @param appName The Application Name to use for this API session
*/
withApplicationName(appName: string): ProjectManagerClient;
/**
* Construct headers for a request
*/
private getHeaders;
/**
* Make a GET request using this client
*/
request<T>(method: Method, path: string, options: unknown, body: unknown): Promise<T>;
/**
* Upload a file to a REST endpoint and retrieve results as JSON
*/
fileUpload<T>(method: Method, path: string, options: unknown, filename: string): Promise<T>;
/**
* Make a GET request using this client and download the results as a blob
*/
requestBlob(method: Method, path: string, options: unknown, body: unknown): Promise<AstroResult<Blob>>;
}