@nangohq/node
Advanced tools
Comparing version 0.42.20 to 0.42.21
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosInterceptorManager } from 'axios'; | ||
import type { ApiKeyCredentials, AppCredentials, AppStoreCredentials, BasicApiCredentials, CustomCredentials, OAuth2ClientCredentials, TbaCredentials, TableauCredentials, UnauthCredentials, BillCredentials, GetPublicProviders, GetPublicProvider, GetPublicListIntegrationsLegacy, GetPublicIntegration, PostConnectSessions, JwtCredentials } from '@nangohq/types'; | ||
import type { Connection, ConnectionList, CreateConnectionOAuth1, CreateConnectionOAuth2, Integration, IntegrationWithCreds, ListRecordsRequestConfig, Metadata, MetadataChangeResponse, NangoProps, OAuth1Token, ProxyConfiguration, RecordMetadata, StandardNangoConfig, SyncStatusResponse, UpdateSyncFrequencyResponse } from './types.js'; | ||
import type { ApiKeyCredentials, AppCredentials, AppStoreCredentials, BasicApiCredentials, CustomCredentials, OAuth2ClientCredentials, TbaCredentials, TableauCredentials, UnauthCredentials, BillCredentials, GetPublicProviders, GetPublicProvider, GetPublicListIntegrationsLegacy, GetPublicIntegration, PostConnectSessions, JwtCredentials, TwoStepCredentials, GetPublicConnections } from '@nangohq/types'; | ||
import type { Connection, CreateConnectionOAuth1, CreateConnectionOAuth2, Integration, IntegrationWithCreds, ListRecordsRequestConfig, Metadata, MetadataChangeResponse, NangoProps, OAuth1Token, ProxyConfiguration, RecordMetadata, StandardNangoConfig, SyncStatusResponse, UpdateSyncFrequencyResponse } from './types.js'; | ||
export declare const stagingHost = "https://api-staging.nango.dev"; | ||
@@ -119,8 +119,7 @@ export declare const prodHost = "https://api.nango.dev"; | ||
* Returns a list of connections, optionally filtered by connection ID | ||
* @param connectionId - Optional. The ID of the connection to retrieve details of | ||
* @param connectionId - Optional. Will exactly match a given connectionId. Can return multiple connections with the same ID across integrations | ||
* @param search - Optional. Search connections. Will search in connection ID or end user profile. | ||
* @returns A promise that resolves with an array of connection objects | ||
*/ | ||
listConnections(connectionId?: string): Promise<{ | ||
connections: ConnectionList[]; | ||
}>; | ||
listConnections(connectionId?: string, search?: string): Promise<GetPublicConnections['Success']>; | ||
/** | ||
@@ -158,3 +157,3 @@ * Returns a connection object, which also contains access credentials and full credentials payload | ||
*/ | ||
getToken(providerConfigKey: string, connectionId: string, forceRefresh?: boolean): Promise<string | OAuth1Token | BasicApiCredentials | ApiKeyCredentials | AppCredentials | OAuth2ClientCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials>; | ||
getToken(providerConfigKey: string, connectionId: string, forceRefresh?: boolean): Promise<string | OAuth1Token | BasicApiCredentials | ApiKeyCredentials | AppCredentials | OAuth2ClientCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials>; | ||
/** | ||
@@ -364,8 +363,2 @@ * Get the full (fresh) credentials payload returned by the external API, | ||
/** | ||
* Retrieves details of all connections from the server or details of a specific connection if a connection ID is provided | ||
* @param connectionId - Optional. This is the unique connection identifier used to identify this connection | ||
* @returns A promise that resolves with the response containing connection details | ||
*/ | ||
private listConnectionDetails; | ||
/** | ||
* Enriches the headers with the Authorization token | ||
@@ -372,0 +365,0 @@ * @param headers - Optional. The headers to enrich |
@@ -168,7 +168,18 @@ import crypto from 'node:crypto'; | ||
* Returns a list of connections, optionally filtered by connection ID | ||
* @param connectionId - Optional. The ID of the connection to retrieve details of | ||
* @param connectionId - Optional. Will exactly match a given connectionId. Can return multiple connections with the same ID across integrations | ||
* @param search - Optional. Search connections. Will search in connection ID or end user profile. | ||
* @returns A promise that resolves with an array of connection objects | ||
*/ | ||
async listConnections(connectionId) { | ||
const response = await this.listConnectionDetails(connectionId); | ||
async listConnections(connectionId, search) { | ||
const url = new URL(`${this.serverUrl}/connection`); | ||
if (connectionId) { | ||
url.searchParams.append('connectionId', connectionId); | ||
} | ||
if (search) { | ||
url.searchParams.append('search', search); | ||
} | ||
const headers = { | ||
'Content-Type': 'application/json' | ||
}; | ||
const response = await this.http.get(url.href, { headers: this.enrichHeaders(headers) }); | ||
return response.data; | ||
@@ -703,17 +714,2 @@ } | ||
/** | ||
* Retrieves details of all connections from the server or details of a specific connection if a connection ID is provided | ||
* @param connectionId - Optional. This is the unique connection identifier used to identify this connection | ||
* @returns A promise that resolves with the response containing connection details | ||
*/ | ||
async listConnectionDetails(connectionId) { | ||
let url = `${this.serverUrl}/connection?`; | ||
if (connectionId) { | ||
url = url.concat(`connectionId=${connectionId}`); | ||
} | ||
const headers = { | ||
'Content-Type': 'application/json' | ||
}; | ||
return this.http.get(url, { headers: this.enrichHeaders(headers) }); | ||
} | ||
/** | ||
* Enriches the headers with the Authorization token | ||
@@ -720,0 +716,0 @@ * @param headers - Optional. The headers to enrich |
import type { ParamsSerializerOptions } from 'axios'; | ||
import type { NangoSyncWebhookBodySuccess, NangoSyncWebhookBodyError, NangoSyncWebhookBody, NangoAuthWebhookBodySuccess, NangoAuthWebhookBodyError, NangoAuthWebhookBody, NangoWebhookBody, AuthOperation, AuthOperationType, AuthModeType, AuthModes, HTTP_VERB, NangoSyncEndpoint, AllAuthCredentials, OAuth1Credentials, OAuth2Credentials, OAuth2ClientCredentials, BasicApiCredentials, ApiKeyCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, TbaCredentials, RecordMetadata, RecordLastAction, NangoRecord, ActiveLog } from '@nangohq/types'; | ||
import type { NangoSyncWebhookBodySuccess, NangoSyncWebhookBodyError, NangoSyncWebhookBody, NangoAuthWebhookBodySuccess, NangoAuthWebhookBodyError, NangoAuthWebhookBody, NangoWebhookBody, AuthOperation, AuthOperationType, AuthModeType, AuthModes, HTTP_METHOD, NangoSyncEndpointV2, AllAuthCredentials, OAuth1Credentials, OAuth2Credentials, OAuth2ClientCredentials, BasicApiCredentials, ApiKeyCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, TbaCredentials, RecordMetadata, RecordLastAction, NangoRecord, JwtCredentials, TwoStepCredentials, CredentialsCommon, TableauCredentials, BillCredentials, GetPublicProviders, GetPublicProvider, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, GetPublicIntegration, GetPublicConnections, PostConnectSessions } from '@nangohq/types'; | ||
export type { NangoSyncWebhookBodySuccess, NangoSyncWebhookBodyError, NangoSyncWebhookBody, NangoAuthWebhookBodySuccess, NangoAuthWebhookBodyError, NangoAuthWebhookBody, NangoWebhookBody }; | ||
export type { AuthOperation, AuthOperationType, AuthModeType, AuthModes, AllAuthCredentials, OAuth1Credentials, OAuth2Credentials, OAuth2ClientCredentials, BasicApiCredentials, ApiKeyCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, TbaCredentials }; | ||
export type { HTTP_VERB, NangoSyncEndpoint }; | ||
export type { AuthOperation, AuthOperationType, AuthModeType, AuthModes, AllAuthCredentials, OAuth1Credentials, OAuth2Credentials, OAuth2ClientCredentials, BasicApiCredentials, ApiKeyCredentials, AppCredentials, AppStoreCredentials, UnauthCredentials, CustomCredentials, CredentialsCommon, TableauCredentials, BillCredentials, TbaCredentials, JwtCredentials, TwoStepCredentials }; | ||
export type { HTTP_METHOD, NangoSyncEndpointV2 }; | ||
export type { RecordMetadata, RecordLastAction, NangoRecord }; | ||
export type { GetPublicProviders, GetPublicProvider, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, GetPublicIntegration, GetPublicConnections, PostConnectSessions }; | ||
export interface NangoProps { | ||
@@ -80,11 +81,2 @@ host?: string; | ||
} | ||
export interface ConnectionList { | ||
id: number; | ||
connection_id: string; | ||
provider_config_key: string; | ||
provider: string; | ||
created: string; | ||
metadata?: Metadata | null; | ||
errors: Pick<ActiveLog, 'log_id' | 'type'>[]; | ||
} | ||
export interface IntegrationWithCreds extends Integration { | ||
@@ -175,3 +167,3 @@ client_id: string; | ||
models: NangoSyncModel[]; | ||
endpoints: NangoSyncEndpoint[]; | ||
endpoints: NangoSyncEndpointV2[]; | ||
is_public?: boolean; | ||
@@ -178,0 +170,0 @@ pre_built?: boolean; |
@@ -1,1 +0,1 @@ | ||
export declare const NANGO_VERSION = "0.42.20"; | ||
export declare const NANGO_VERSION = "0.42.21"; |
@@ -1,2 +0,2 @@ | ||
export const NANGO_VERSION = '0.42.20'; | ||
export const NANGO_VERSION = '0.42.21'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@nangohq/node", | ||
"version": "0.42.20", | ||
"version": "0.42.21", | ||
"description": "Nango's Node client.", | ||
@@ -39,3 +39,3 @@ "type": "module", | ||
"devDependencies": { | ||
"@nangohq/types": "^0.42.20", | ||
"@nangohq/types": "^0.42.21", | ||
"tsup": "^8.2.4", | ||
@@ -42,0 +42,0 @@ "vitest": "1.6.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117639
2159