Skip to content

Commit

Permalink
Move shared/utils/http.ts to utils package
Browse files Browse the repository at this point in the history
  • Loading branch information
nalanj committed Jan 16, 2025
1 parent 58c4ea0 commit 6803d48
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions packages/server/lib/controllers/proxy.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,8 @@ import querystring from 'querystring';
import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
import { backOff } from 'exponential-backoff';
import type { HTTP_METHOD, UserProvidedProxyConfiguration, InternalProxyConfiguration, ApplicationConstructedProxyConfiguration, File } from '@nangohq/shared';
import {
LogActionEnum,
errorManager,
ErrorSourceEnum,
proxyService,
connectionService,
configService,
featureFlags,
redactHeaders,
redactURL
} from '@nangohq/shared';
import { metrics, getLogger, axiosInstance as axios, getHeaders } from '@nangohq/utils';
import { LogActionEnum, errorManager, ErrorSourceEnum, proxyService, connectionService, configService, featureFlags } from '@nangohq/shared';
import { metrics, getLogger, axiosInstance as axios, getHeaders, redactHeaders, redactURL } from '@nangohq/utils';
import { flushLogsBuffer, logContextGetter } from '@nangohq/logs';
import { connectionRefreshFailed as connectionRefreshFailedHook, connectionRefreshSuccess as connectionRefreshSuccessHook } from '../hooks/hooks.js';
import type { LogContext } from '@nangohq/logs';
Expand Down
1 change: 0 additions & 1 deletion packages/shared/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export * from './clients/locking.js';
export * from './models/index.js';

export * from './utils/utils.js';
export * from './utils/http.js';
export * from './utils/error.js';
export * from './constants.js';

Expand Down
5 changes: 3 additions & 2 deletions packages/shared/lib/sdk/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import {
MAX_LOG_PAYLOAD,
stringifyAndTruncateValue,
stringifyObject,
truncateJson
truncateJson,
redactHeaders,
redactURL
} from '@nangohq/utils';
import type { ValidateDataError } from './dataValidation.js';
import { validateData } from './dataValidation.js';
import { NangoError } from '../utils/error.js';
import type { ApiEndUser, DBSyncConfig, DBTeam, GetPublicIntegration, MessageRowInsert, RunnerFlags } from '@nangohq/types';
import { getProvider } from '../services/providers.js';
import { redactHeaders, redactURL } from '../utils/http.js';

const logger = getLogger('SDK');

Expand Down
3 changes: 1 addition & 2 deletions packages/shared/lib/services/proxy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isAxiosError } from 'axios';
import type { AxiosError, AxiosResponse, AxiosRequestConfig, ParamsSerializerOptions } from 'axios';
import OAuth from 'oauth-1.0a';
import * as crypto from 'node:crypto';
import { axiosInstance as axios, SIGNATURE_METHOD } from '@nangohq/utils';
import { axiosInstance as axios, SIGNATURE_METHOD, redactHeaders, redactURL } from '@nangohq/utils';
import { backOff } from 'exponential-backoff';
import FormData from 'form-data';
import type { TbaCredentials, ApiKeyCredentials, BasicApiCredentials, TableauCredentials } from '../models/Auth.js';
Expand All @@ -13,7 +13,6 @@ import { interpolateIfNeeded, connectionCopyWithParsedConnectionConfig, mapProxy
import { NangoError } from '../utils/error.js';
import type { MessageRowInsert, RetryHeaderConfig } from '@nangohq/types';
import { getProvider } from './providers.js';
import { redactHeaders, redactURL } from '../utils/http.js';

interface Logs {
logs: MessageRowInsert[];
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/utils/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export * from './workflows.js';
export * from './axios.js';
export * from './auth.js';
export * from './once.js';
export * from './http.js';

0 comments on commit 6803d48

Please sign in to comment.