Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

16 changes: 9 additions & 7 deletions api/__tests__/devSecrets.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
jest.mock('../../http');
import { http } from '../../http';
import { http } from '../../http/index.js';
import { vi, type MockedFunction } from 'vitest';
import {
addAppSecret,
updateAppSecret,
deleteAppSecret,
fetchAppSecrets,
} from '../devSecrets';
} from '../devSecrets.js';

const httpPostMock = http.post as jest.MockedFunction<typeof http.post>;
const httpPatchMock = http.patch as jest.MockedFunction<typeof http.patch>;
const httpDeleteMock = http.delete as jest.MockedFunction<typeof http.delete>;
const httpGetMock = http.get as jest.MockedFunction<typeof http.get>;
vi.mock('../../http');

const httpPostMock = http.post as MockedFunction<typeof http.post>;
const httpPatchMock = http.patch as MockedFunction<typeof http.patch>;
const httpDeleteMock = http.delete as MockedFunction<typeof http.delete>;
const httpGetMock = http.get as MockedFunction<typeof http.get>;

describe('api/devSecrets', () => {
const accountId = 123;
Expand Down
4 changes: 2 additions & 2 deletions api/__tests__/fileMapper.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fileStreamResponse from './fixtures/fileStreamResponse.json';
import { createFileMapperNodeFromStreamResponse } from '../fileMapper';
import fileStreamResponse from './fixtures/fileStreamResponse.json' with { type: 'json' };
import { createFileMapperNodeFromStreamResponse } from '../fileMapper.js';

describe('api/fileMapper', () => {
describe('createFileMapperNodeFromStreamResponse()', () => {
Expand Down
13 changes: 7 additions & 6 deletions api/__tests__/projects.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
jest.mock('../../http');
jest.mock('fs');
vi.mock('../../http');
vi.mock('fs');
import { createReadStream } from 'fs';
import { http } from '../../http';
import { http } from '../../http/index.js';
import { vi, type MockedFunction } from 'vitest';
import {
cancelStagedBuild,
checkCloneStatus,
Expand Down Expand Up @@ -30,13 +31,13 @@ import {
queueBuild,
uploadFileToBuild,
uploadProject,
} from '../projects';
} from '../projects.js';

const createReadStreamMock = createReadStream as jest.MockedFunction<
const createReadStreamMock = createReadStream as MockedFunction<
typeof createReadStream
>;

const httpPostMock = http.post as jest.MockedFunction<typeof http.post>;
const httpPostMock = http.post as MockedFunction<typeof http.post>;

describe('api/projects', () => {
const accountId = 999999;
Expand Down
6 changes: 3 additions & 3 deletions api/appsDev.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { http } from '../http';
import { http } from '../http/index.js';
import {
PublicApp,
PublicAppInstallCounts,
PublicAppDeveloperTestAccountInstallData,
FetchPublicAppsForPortalResponse,
} from '../types/Apps';
import { HubSpotPromise } from '../types/Http';
} from '../types/Apps.js';
import { HubSpotPromise } from '../types/Http.js';

const APPS_DEV_API_PATH = 'apps-dev/external/public/v3';
const APPS_HUBLETS_API_PATH = 'apps-hublets/external/static-token/v3';
Expand Down
8 changes: 4 additions & 4 deletions api/crm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import path from 'path';
import fs from 'fs-extra';
import FormData from 'form-data';

import { http } from '../http';
import { getCwd } from '../lib/path';
import { HubSpotPromise } from '../types/Http';
import { ImportRequest, ImportResponse } from '../types/Crm';
import { http } from '../http/index.js';
import { getCwd } from '../lib/path.js';
import { HubSpotPromise } from '../types/Http.js';
import { ImportRequest, ImportResponse } from '../types/Crm.js';

const HUBSPOT_CRM_IMPORT_PATH = '/crm/v3/imports';

Expand Down
6 changes: 3 additions & 3 deletions api/customObjects.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { http } from '../http';
import { http } from '../http/index.js';
import {
FetchSchemasResponse,
Schema,
SchemaDefinition,
ObjectDefinition,
CreateObjectsResponse,
} from '../types/Schemas';
import { HubSpotPromise } from '../types/Http';
} from '../types/Schemas.js';
import { HubSpotPromise } from '../types/Http.js';

const CUSTOM_OBJECTS_API_PATH = 'crm/v3/objects';
const SCHEMA_API_PATH = 'crm-object-schemas/v3/schemas';
Expand Down
6 changes: 3 additions & 3 deletions api/designManager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { http } from '../http';
import { HubSpotPromise, QueryParams } from '../types/Http';
import { http } from '../http/index.js';
import { HubSpotPromise, QueryParams } from '../types/Http.js';
import {
FetchThemesResponse,
FetchBuiltinMappingResponse,
} from '../types/DesignManager';
} from '../types/DesignManager.js';

const DESIGN_MANAGER_API_PATH = 'designmanager/v1';

Expand Down
6 changes: 3 additions & 3 deletions api/devSecrets.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http } from '../http';
import { HubSpotPromise } from '../types/Http';
import { FetchDevSecretsResponse } from '../types/DevSecrets';
import { http } from '../http/index.js';
import { HubSpotPromise } from '../types/Http.js';
import { FetchDevSecretsResponse } from '../types/DevSecrets.js';

const DEV_SECRETS_API_PATH = 'dev-secrets/management/v3';

Expand Down
14 changes: 7 additions & 7 deletions api/developerTestAccounts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import { http } from '../http';
import { getAxiosConfig } from '../http/getAxiosConfig';
import { ENVIRONMENTS } from '../constants/environments';
import { http } from '../http/index.js';
import { getAxiosConfig } from '../http/getAxiosConfig.js';
import { ENVIRONMENTS } from '../constants/environments.js';
import {
DeveloperTestAccount,
CreateDeveloperTestAccountResponse,
Expand All @@ -11,10 +11,10 @@ import {
InstallOauthAppIntoDeveloperTestAccountResponse,
TestPortalStatusResponse,
GenerateDeveloperTestAccountPersonalAccessKeyResponse,
} from '../types/developerTestAccounts';
import { SANDBOX_TIMEOUT } from '../constants/api';
import { Environment } from '../types/Config';
import { HubSpotPromise } from '../types/Http';
} from '../types/developerTestAccounts.js';
import { SANDBOX_TIMEOUT } from '../constants/api.js';
import { Environment } from '../types/Config.js';
import { HubSpotPromise } from '../types/Http.js';

const TEST_ACCOUNTS_API_PATH = 'integrators/test-portals/v2';
const TEST_ACCOUNTS_API_PATH_V3 = 'integrators/test-portals/v3';
Expand Down
6 changes: 3 additions & 3 deletions api/fileManager.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import fs from 'fs';
import path from 'path';
import { http } from '../http';
import { FormData, HubSpotPromise } from '../types/Http';
import { http } from '../http/index.js';
import { FormData, HubSpotPromise } from '../types/Http.js';
import {
FetchStatResponse,
FetchFilesResponse,
FetchFolderResponse,
UploadResponse,
} from '../types/FileManager';
} from '../types/FileManager.js';

const FILE_MANAGER_V2_API_PATH = 'filemanager/api/v2';
const FILE_MANAGER_V3_API_PATH = 'filemanager/api/v3';
Expand Down
8 changes: 4 additions & 4 deletions api/fileMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import fs from 'fs';
import path from 'path';
import contentDisposition from 'content-disposition';
import { AxiosResponse } from 'axios';
import { http } from '../http';
import { getCwd } from '../lib/path';
import { FileMapperNode, FileMapperOptions, FileTree } from '../types/Files';
import { HubSpotPromise } from '../types/Http';
import { http } from '../http/index.js';
import { getCwd } from '../lib/path.js';
import { FileMapperNode, FileMapperOptions, FileTree } from '../types/Files.js';
import { HubSpotPromise } from '../types/Http.js';

export const FILE_MAPPER_API_PATH = 'content/filemapper/v1';

Expand Down
6 changes: 3 additions & 3 deletions api/fileTransport.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs';
import path from 'path';
import { getCwd } from '../lib/path';
import { http } from '../http';
import { HubSpotPromise } from '../types/Http';
import { getCwd } from '../lib/path.js';
import { http } from '../http/index.js';
import { HubSpotPromise } from '../types/Http.js';
const HUBFILES_API_PATH = '/file-transport/v1/hubfiles';

export function createSchemaFromHubFile(
Expand Down
6 changes: 3 additions & 3 deletions api/fireAlarm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http } from '../http';
import { FireAlarm } from '../types/FireAlarm';
import { HubSpotPromise } from '../types/Http';
import { http } from '../http/index.js';
import { FireAlarm } from '../types/FireAlarm.js';
import { HubSpotPromise } from '../types/Http.js';

const FIREALARM_API_AUTH_PATH = 'firealarm/v4/alarm';

Expand Down
6 changes: 3 additions & 3 deletions api/functions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { http } from '../http';
import { HubSpotPromise, QueryParams } from '../types/Http';
import { http } from '../http/index.js';
import { HubSpotPromise, QueryParams } from '../types/Http.js';
import {
GetBuildStatusResponse,
FunctionLog,
GetRoutesResponse,
GetFunctionLogsResponse,
} from '../types/Functions';
} from '../types/Functions.js';

const FUNCTION_API_PATH = 'cms/v3/functions';

Expand Down
13 changes: 8 additions & 5 deletions api/github.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import axios, { ResponseType } from 'axios';
import { getDefaultUserAgentHeader } from '../http/getAxiosConfig';
import { GithubReleaseData, GithubRepoFile, RepoPath } from '../types/Github';
import { HubSpotPromise } from '../types/Http';
import { isSpecifiedError } from '../errors';
import { getDefaultUserAgentHeader } from '../http/getAxiosConfig.js';
import {
GithubReleaseData,
GithubRepoFile,
RepoPath,
} from '../types/Github.js';
import { HubSpotPromise } from '../types/Http.js';
import { isSpecifiedError } from '../errors/index.js';

const GITHUB_REPOS_API = 'https://api.github.com/repos';
const GITHUB_RAW_CONTENT_API_PATH = 'https://raw.githubusercontent.com';

declare global {
// eslint-disable-next-line no-var
var githubToken: string;
}

Expand Down
6 changes: 3 additions & 3 deletions api/hubdb.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { http } from '../http';
import { HubSpotPromise, QueryParams } from '../types/Http';
import { http } from '../http/index.js';
import { HubSpotPromise, QueryParams } from '../types/Http.js';
import {
CreateRowsResponse,
FetchRowsResponse,
Row,
Schema,
Table,
FetchTablesResponse,
} from '../types/Hubdb';
} from '../types/Hubdb.js';

const HUBDB_API_PATH = 'cms/v3/hubdb';

Expand Down
6 changes: 3 additions & 3 deletions api/lighthouseScore.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { http } from '../http';
import { Data, HubSpotPromise, QueryParams } from '../types/Http';
import { http } from '../http/index.js';
import { Data, HubSpotPromise, QueryParams } from '../types/Http.js';
import {
GetLighthouseScoreResponse,
RequestLighthouseScoreResponse,
} from '../types/Lighthouse';
} from '../types/Lighthouse.js';

const LIGHTHOUSE_SCORE_API_BASE = 'quality-engine/v1/lighthouse';

Expand Down
14 changes: 7 additions & 7 deletions api/localDevAuth.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { getAxiosConfig } from '../http/getAxiosConfig';
import { http } from '../http';
import { ENVIRONMENTS } from '../constants/environments';
import { Environment } from '../types/Config';
import { getAxiosConfig } from '../http/getAxiosConfig.js';
import { http } from '../http/index.js';
import { ENVIRONMENTS } from '../constants/environments.js';
import { Environment } from '../types/Config.js';
import {
ScopeData,
AccessTokenResponse,
EnabledFeaturesResponse,
ScopeAuthorizationResponse,
} from '../types/Accounts';
} from '../types/Accounts.js';
import axios from 'axios';
import { PublicAppInstallationData } from '../types/Apps';
import { HubSpotPromise } from '../types/Http';
import { PublicAppInstallationData } from '../types/Apps.js';
import { HubSpotPromise } from '../types/Http.js';

const LOCALDEVAUTH_API_AUTH_PATH = 'localdevauth/v1/auth';

Expand Down
6 changes: 3 additions & 3 deletions api/marketplaceValidation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http } from '../http';
import { Data, HubSpotPromise, QueryParams } from '../types/Http';
import { GetValidationResultsResponse } from '../types/MarketplaceValidation';
import { http } from '../http/index.js';
import { Data, HubSpotPromise, QueryParams } from '../types/Http.js';
import { GetValidationResultsResponse } from '../types/MarketplaceValidation.js';

const VALIDATION_API_BASE = 'quality-engine/v1/validation';

Expand Down
14 changes: 7 additions & 7 deletions api/projects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { http } from '../http';
import { http } from '../http/index.js';
import fs from 'fs';
import { FormData, HubSpotPromise, QueryParams } from '../types/Http';
import { FormData, HubSpotPromise, QueryParams } from '../types/Http.js';
import {
Project,
FetchProjectResponse,
Expand All @@ -9,18 +9,18 @@ import {
FetchPlatformVersionResponse,
WarnLogsResponse,
UploadIRResponse,
} from '../types/Project';
import { Build, FetchProjectBuildsResponse } from '../types/Build';
} from '../types/Project.js';
import { Build, FetchProjectBuildsResponse } from '../types/Build.js';
import {
ComponentStructureResponse,
ProjectComponentsMetadata,
} from '../types/ComponentStructure';
import { Deploy, ProjectDeployResponse } from '../types/Deploy';
} from '../types/ComponentStructure.js';
import { Deploy, ProjectDeployResponse } from '../types/Deploy.js';
import {
MigrateAppResponse,
CloneAppResponse,
PollAppResponse,
} from '../types/Migration';
} from '../types/Migration.js';

const PROJECTS_API_PATH = 'dfs/v1/projects';
const DEVELOPER_FILE_SYSTEM_PATH = 'dfs/v1';
Expand Down
Loading