@nangohq/types 0.71.9 → 0.71.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -207,6 +207,7 @@ export type PostManagedSignup = ApiEndpoint<{
207
207
  Body: {
208
208
  provider: 'GoogleOAuth';
209
209
  token?: string | undefined;
210
+ returnTo?: string | undefined;
210
211
  };
211
212
  Success: {
212
213
  data: {
@@ -2,7 +2,7 @@ import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  import type { AuditPolicy } from '../audit-trail/event.js';
3
3
  import type { Tags } from '../db.js';
4
4
  import type { AgentSessionUnknownPinnedConnectionsPayload } from './connections.js';
5
- import type { AgentSessionEndedReason } from './session.js';
5
+ import type { AgentSessionCreateConnectionConfig, AgentSessionEndedReason } from './session.js';
6
6
  import type { AgentSessionToolsNotInToolsetPayload, AgentSessionUnknownIntegrationsPayload, AgentSessionUnknownToolsPayload, AgentSessionUnsupportedFunctionTypesPayload } from './toolset.js';
7
7
  export interface AgentSessionToolListInput {
8
8
  tools: string[];
@@ -11,6 +11,25 @@ export type AgentSessionIntegrationPolicyInput = '*' | {
11
11
  allow?: AgentSessionToolListInput | '*' | undefined;
12
12
  deny?: AgentSessionToolListInput | undefined;
13
13
  };
14
+ export type AgentSessionMetaToolInput = boolean | {
15
+ enabled: boolean;
16
+ tags?: Tags | undefined;
17
+ };
18
+ export interface AgentSessionMetaToolsInput {
19
+ nango_tool_search?: boolean | {
20
+ enabled: boolean;
21
+ } | undefined;
22
+ nango_execute?: boolean | {
23
+ enabled: boolean;
24
+ } | undefined;
25
+ nango_proxy?: boolean | {
26
+ enabled: boolean;
27
+ } | undefined;
28
+ nango_create_connection?: boolean | {
29
+ enabled: boolean;
30
+ tags?: Tags | undefined;
31
+ } | undefined;
32
+ }
14
33
  export interface PostAgentSessionsBody {
15
34
  tenant: {
16
35
  connections: {
@@ -25,7 +44,7 @@ export interface PostAgentSessionsBody {
25
44
  };
26
45
  toolset?: '*' | Record<string, AgentSessionIntegrationPolicyInput> | undefined;
27
46
  pinned_tools?: Record<string, string[]> | undefined;
28
- meta_tools?: Record<string, boolean> | undefined;
47
+ meta_tools?: AgentSessionMetaToolsInput | undefined;
29
48
  expires_in?: string | undefined;
30
49
  }
31
50
  export interface AgentSessionToolsetSummary {
@@ -37,6 +56,7 @@ export interface AgentSessionMetaToolsSummary {
37
56
  nango_tool_search: boolean;
38
57
  nango_execute: boolean;
39
58
  nango_proxy: boolean;
59
+ nango_create_connection: AgentSessionCreateConnectionConfig;
40
60
  }
41
61
  export interface AgentSessionUnknownMetaToolsPayload {
42
62
  meta_tools: string[];
@@ -1,9 +1,19 @@
1
+ import type { Tags } from '../db.js';
1
2
  import type { AgentSessionResolvedConnections } from './connections.js';
2
3
  import type { AgentSessionCompiledToolset } from './toolset.js';
4
+ /**
5
+ * `tags` are stamped on the connection the agent has created, on top of the reserved tag that binds
6
+ * it to the session, so it also matches the selectors a later session for the same tenant will use.
7
+ */
8
+ export interface AgentSessionCreateConnectionConfig {
9
+ readonly enabled: boolean;
10
+ readonly tags: Tags;
11
+ }
3
12
  export interface AgentSessionMetaTools {
4
13
  readonly nangoToolSearch: boolean;
5
14
  readonly nangoExecute: boolean;
6
15
  readonly nangoProxy: boolean;
16
+ readonly nangoCreateConnection: AgentSessionCreateConnectionConfig;
7
17
  }
8
18
  export type AgentSessionEndedReason = 'terminated' | 'expired';
9
19
  export interface AgentSession {
@@ -1,6 +1,6 @@
1
1
  /** Every wildcard in a namespace: `environment:*`, `environment:connections:*`, … */
2
2
  export type WildcardsFor<Namespace extends string> = `${Namespace}:*` | `${Namespace}:${string}:*`;
3
- export declare const API_KEY_SCOPES: readonly ["environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connect_sessions:write", "environment:agent_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:functions:list", "environment:functions:read", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:invocations", "environment:deploy", "environment:records:read", "environment:records:write", "environment:logs:read", "environment:actions:execute", "environment:proxy", "environment:variables:read", "environment:webhook_signing_key:rotate", "environment:mcp"];
3
+ export declare const API_KEY_SCOPES: readonly ["environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connect_sessions:write", "environment:agent_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:functions:list", "environment:functions:read", "environment:functions:update", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:invocations", "environment:deploy", "environment:records:read", "environment:records:write", "environment:logs:read", "environment:actions:execute", "environment:proxy", "environment:variables:read", "environment:webhook_signing_key:rotate", "environment:mcp"];
4
4
  export type ConcreteApiKeyScope = (typeof API_KEY_SCOPES)[number];
5
5
  /** A scope, or a wildcard over scopes. Which wildcards resolve to something is checked at runtime. */
6
6
  export type ApiKeyScope = ConcreteApiKeyScope | WildcardsFor<'environment'>;
package/dist/api.d.ts CHANGED
@@ -14,7 +14,7 @@ export interface ValidationError {
14
14
  path: (string | number)[];
15
15
  }
16
16
  export type ResDefaultErrors = ApiError<'invalid_content_type'> | ApiError<'not_found'> | ApiError<'disabled_resource'> | ApiError<'conflict'> | ApiError<'plan_limit'> | ApiError<'forbidden'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_headers', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'> | ApiError<'invalid_cli_version'> | ApiError<'invalid_permissions'> | ApiError<'invalid_connect_session_token_format'> | ApiError<'request_too_large'>;
17
- export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
17
+ export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'PROPFIND' | 'REPORT';
18
18
  /**
19
19
  * API Request/Response type
20
20
  */
@@ -17,7 +17,7 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, DeletePublicApiKey,
17
17
  import type { PatchWebhook } from './environment/api/webhook.js';
18
18
  import type { PostEnvironmentVariables } from './environment/variable/api.js';
19
19
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
20
- import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetFunctionInvocation, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult, PostFunctionInvocation } from './functions/api.js';
20
+ import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunction, GetFunctionDeployment, GetFunctionDryrun, GetFunctionInvocation, GetFunctions, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PatchFunction, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult, PostFunctionInvocation } from './functions/api.js';
21
21
  import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
22
22
  import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
23
23
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
@@ -35,7 +35,7 @@ import type { GetConnectionSyncs, GetPublicSyncStatus, PostPublicSyncPause, Post
35
35
  import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
36
36
  import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
37
37
  import type { PostPublicWebhook } from './webhooks/http.api.js';
38
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostAgentSessions | DeleteAgentSession | PostAgentSessionMcp | GetAgentSessionMcp | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | DeleteConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicClientMetadata | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PostCliTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | PostFunctionInvocation | GetFunctionInvocation | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | PostPublicRotateWebhookSigningKey | AllPublicProxy | PostPublicEnvironment | DeletePublicEnvironment | GetPublicEnvironments | GetPublicApiKey | GetPublicApiKeys | PostPublicApiKey | DeletePublicApiKey;
38
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostAgentSessions | DeleteAgentSession | PostAgentSessionMcp | GetAgentSessionMcp | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | DeleteConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicClientMetadata | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PostCliTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | GetFunction | GetFunctions | PatchFunction | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | PostFunctionInvocation | GetFunctionInvocation | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | PostPublicRotateWebhookSigningKey | AllPublicProxy | PostPublicEnvironment | DeletePublicEnvironment | GetPublicEnvironments | GetPublicApiKey | GetPublicApiKeys | PostPublicApiKey | DeletePublicApiKey;
39
39
  export type PrivateApiEndpoints = GetAuditTrail | GetAuditTrailExport | ListAccountApiKeys | CreateAccountApiKey | DeleteAccountApiKey | ConfirmEmail | PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetOverdueInvoices | GetBillingUsage | GetBillingUsageTopDimensionValues | GetUpcomingInvoice | GetBillingPeriodCosts | GetProjectedCosts | GetSpendAlert | PutSpendAlert | DeleteSpendAlert | GetUser | PatchUser | PutUserPassword | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | GetFunctionCode | DeleteIntegrationFunction | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | PatchConnection | PostConnectionMetadata | GetConnectionRecordModels | GetConnectionRecords | GetConnectionSyncs | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | GetOnboardingAccountDiscovery | PostOnboardingRequestInvite | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | PostRotateWebhookSigningKey | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetMFAStatus | PostMFAEnrollment | PostMFAActivation | PostMFARecoveryCodes | PostMFALoginVerification | DeleteMFA | GetPlainHmac;
40
40
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
41
41
  /**
@@ -1,4 +1,4 @@
1
- import type { AgentSessionCreatedMetadata, ApiKeyUpdatedMetadata, AppAuthLoginMetadata, AuditTrailFiltersMetadata, AuditTrailQueriedMetadata, BillingPaymentMethodRemovedMetadata, BillingPlanChangedMetadata, BillingSpendAlertChangedMetadata, ConnectionMetadata, ConnectionUpdatedMetadata, EnvironmentCreatedMetadata, EnvironmentUpdatedMetadata, EnvironmentVariablesChangedMetadata, EnvironmentWebhookMetadata, FunctionDeletedMetadata, FunctionDeployedMetadata, FunctionUpgradedMetadata, IntegrationProviderMetadata, IntegrationUpdatedMetadata, MemberInvitedMetadata, MemberRoleChangedMetadata, MfaVerifiedMetadata, SyncBaseMetadata, SyncFrequencyChangedMetadata, SyncTriggeredMetadata, SyncVariantMetadata, TeamUpdatedMetadata, UserUpdatedMetadata } from './metadata.js';
1
+ import type { AgentSessionCreatedMetadata, ApiKeyUpdatedMetadata, AppAuthLoginMetadata, AuditTrailFiltersMetadata, AuditTrailQueriedMetadata, BillingPaymentMethodRemovedMetadata, BillingPlanChangedMetadata, BillingSpendAlertChangedMetadata, ConnectionMetadata, ConnectionUpdatedMetadata, EnvironmentCreatedMetadata, EnvironmentUpdatedMetadata, EnvironmentVariablesChangedMetadata, EnvironmentWebhookMetadata, FunctionDeletedMetadata, FunctionDeployedMetadata, FunctionUpdatedMetadata, FunctionUpgradedMetadata, IntegrationProviderMetadata, IntegrationUpdatedMetadata, MemberInvitedMetadata, MemberRoleChangedMetadata, MfaVerifiedMetadata, SyncBaseMetadata, SyncFrequencyChangedMetadata, SyncTriggeredMetadata, SyncVariantMetadata, TeamUpdatedMetadata, UserUpdatedMetadata } from './metadata.js';
2
2
  export type AuditTrailVersion = '2026-07-16';
3
3
  export type AuditActorType = 'user' | 'api_key' | 'public_key' | 'connect_session' | 'anonymous' | 'unknown';
4
4
  export type AuditOutcome = 'success' | 'failure' | 'denied';
@@ -26,6 +26,7 @@ interface AuditEventTable {
26
26
  function: {
27
27
  deployed: FunctionDeployedMetadata;
28
28
  upgraded: FunctionUpgradedMetadata;
29
+ updated: FunctionUpdatedMetadata;
29
30
  deleted: FunctionDeletedMetadata;
30
31
  };
31
32
  integration: {
@@ -34,6 +34,9 @@ export interface FunctionDeployedMetadata {
34
34
  export interface FunctionUpgradedMetadata {
35
35
  upgradeVersion?: string;
36
36
  }
37
+ export interface FunctionUpdatedMetadata {
38
+ state?: string;
39
+ }
37
40
  export interface FunctionDeletedMetadata {
38
41
  type?: string;
39
42
  }
@@ -4,6 +4,7 @@ import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTr
4
4
  import type { JSONSchema7 } from 'json-schema';
5
5
  export interface DBFunctionConfig extends TimestampsAndDeletedAt {
6
6
  id: number;
7
+ uuid: string;
7
8
  nango_config_id: number;
8
9
  environment_id: number;
9
10
  name: string;
@@ -34,6 +35,7 @@ export interface DBFunctionInstance extends TimestampsAndDeletedAt {
34
35
  function_config_id: number;
35
36
  name: string;
36
37
  variant: string;
38
+ enabled: boolean;
37
39
  last_run_at: Date | null;
38
40
  frequency: string | null;
39
41
  }
@@ -1,6 +1,7 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  import type { AuditPolicy } from '../audit-trail/event.js';
3
3
  import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from '../function/config.js';
4
+ import type { FunctionSource } from '../syncConfigs/db.js';
4
5
  import type { FunctionType, ListedNangoFunction, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
5
6
  import type { JSONSchema7 } from 'json-schema';
6
7
  export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
@@ -222,6 +223,63 @@ export type PostFunctionDeploymentResult = ApiEndpoint<{
222
223
  };
223
224
  }>;
224
225
  export type FunctionInvocationType = 'wait' | 'no_wait';
226
+ export interface GetFunctionResponse {
227
+ uuid: string;
228
+ integration_id: string;
229
+ provider: string;
230
+ name: string;
231
+ description: string;
232
+ state: 'enabled' | 'disabled';
233
+ source: FunctionSource;
234
+ trigger: FunctionTriggerDefinition;
235
+ created_at: string;
236
+ updated_at: string;
237
+ }
238
+ export type GetFunction = ApiEndpoint<{
239
+ Audit: {
240
+ kind: 'no-audit';
241
+ reason: 'non-auditable';
242
+ };
243
+ Method: 'GET';
244
+ Path: '/functions/:uuid';
245
+ Params: {
246
+ uuid: string;
247
+ };
248
+ Success: GetFunctionResponse;
249
+ }>;
250
+ export type PatchFunction = ApiEndpoint<{
251
+ Audit: AuditPolicy<'function', 'updated', 'environment'>;
252
+ Method: 'PATCH';
253
+ Path: '/functions/:uuid';
254
+ Params: {
255
+ uuid: string;
256
+ };
257
+ Body: {
258
+ state: 'enabled' | 'disabled';
259
+ };
260
+ Success: GetFunctionResponse;
261
+ }>;
262
+ export interface GetFunctionsQuery {
263
+ integration?: string | undefined;
264
+ provider?: string | undefined;
265
+ state?: 'enabled' | 'disabled' | undefined;
266
+ 'trigger.kind'?: FunctionTriggerDefinition['kind'] | undefined;
267
+ cursor?: string | undefined;
268
+ limit?: number | undefined;
269
+ }
270
+ export type GetFunctions = ApiEndpoint<{
271
+ Audit: {
272
+ kind: 'no-audit';
273
+ reason: 'non-auditable';
274
+ };
275
+ Method: 'GET';
276
+ Path: '/functions';
277
+ Querystring: GetFunctionsQuery;
278
+ Success: {
279
+ data: GetFunctionResponse[];
280
+ next_cursor: string | null;
281
+ };
282
+ }>;
225
283
  export type FunctionInvocationErrorCode = 'function_failed' | 'server_error' | 'connection_not_found' | 'function_not_found' | 'function_disabled' | 'validation_error' | 'invalid_invocation';
226
284
  type FunctionInvocationSuccess = any;
227
285
  export type PostFunctionInvocation = ApiEndpoint<{
@@ -325,7 +383,7 @@ export type DeleteIntegrationFunction = ApiEndpoint<{
325
383
  providerConfigKey: string;
326
384
  functionName: string;
327
385
  };
328
- Error: ApiError<'function_managed_by_deploy'>;
386
+ Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
329
387
  Success: FunctionDeletionSuccess;
330
388
  }>;
331
389
  export type GetProviderTemplates = ApiEndpoint<{
@@ -384,7 +442,7 @@ export type DeletePublicIntegrationFunction = ApiEndpoint<{
384
442
  uniqueKey: string;
385
443
  name: string;
386
444
  };
387
- Error: ApiError<'function_managed_by_deploy'>;
445
+ Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
388
446
  Success: FunctionDeletionSuccess;
389
447
  }>;
390
448
  export type GetPublicProviderTemplates = ApiEndpoint<{
@@ -1,6 +1,8 @@
1
1
  import type { OnEventType } from '../scripts/on-events/api.js';
2
2
  import type { FunctionSource } from '../syncConfigs/db.js';
3
3
  import type { JSONSchema7 } from 'json-schema';
4
+ /** `tools-catalog` is list/API only — never a DB `FunctionSource`. */
5
+ export type FunctionListSource = FunctionSource | 'tools-catalog';
4
6
  export type FunctionType = 'action' | 'sync' | 'on-event';
5
7
  interface NangoFunctionBase {
6
8
  name: string;
@@ -28,6 +30,7 @@ export interface NangoOnEventFunction extends NangoFunctionBase {
28
30
  event: OnEventType;
29
31
  }
30
32
  export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
33
+ /** A deployed sync-config row. `id` and `last_deployed` are always present. */
31
34
  export interface FunctionAvailability {
32
35
  id: number;
33
36
  enabled: boolean;
@@ -35,9 +38,18 @@ export interface FunctionAvailability {
35
38
  last_deployed: string;
36
39
  source: FunctionSource;
37
40
  }
38
- export type ListedNangoSyncFunction = NangoSyncFunction & FunctionAvailability;
39
- export type ListedNangoActionFunction = NangoActionFunction & FunctionAvailability;
40
- export type ListedNangoOnEventFunction = NangoOnEventFunction & FunctionAvailability;
41
+ /** A row in a function list. Catalog actions have no deployed row. */
42
+ export interface ListedFunctionAvailability {
43
+ /** Sync-config id. `null` when the function is served from the catalog (no deployed row). */
44
+ id: number | null;
45
+ enabled: boolean;
46
+ /** ISO-8601 timestamp. `null` when the function was never deployed. */
47
+ last_deployed: string | null;
48
+ source: FunctionListSource;
49
+ }
50
+ export type ListedNangoSyncFunction = NangoSyncFunction & ListedFunctionAvailability;
51
+ export type ListedNangoActionFunction = NangoActionFunction & ListedFunctionAvailability;
52
+ export type ListedNangoOnEventFunction = NangoOnEventFunction & ListedFunctionAvailability;
41
53
  export type ListedNangoFunction = ListedNangoSyncFunction | ListedNangoActionFunction | ListedNangoOnEventFunction;
42
54
  export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
43
55
  deployed?: FunctionAvailability;
package/dist/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export type * from './integration/db.js';
60
60
  export type * from './providers/provider.js';
61
61
  export type * from './auth/api.js';
62
62
  export type * from './oauthSessions/db.js';
63
+ export type * from './oauth-server/api.js';
63
64
  export type * from './auth/http.api.js';
64
65
  export type * from './deploy/api.js';
65
66
  export type * from './deploy/index.js';
@@ -13,6 +13,7 @@ export interface ApiPublicIntegrationInclude {
13
13
  webhook_url?: string | null;
14
14
  credentials_label?: Record<string, string> | undefined;
15
15
  preconfigured_credentials?: string[] | undefined;
16
+ preconfigured_connection_config?: string[] | undefined;
16
17
  credentials?: {
17
18
  type: AuthModes['OAuth2'] | AuthModes['OAuth1'] | AuthModes['TBA'];
18
19
  client_id: string | null;
@@ -31,6 +32,20 @@ export interface ApiPublicIntegrationInclude {
31
32
  app_id: string | null;
32
33
  app_link: string | null;
33
34
  private_key: string | null;
35
+ } | {
36
+ type: AuthModes['MCP_OAUTH2_GENERIC'];
37
+ client_name: string | null;
38
+ client_uri: string | null;
39
+ client_logo_uri: string | null;
40
+ } | {
41
+ type: 'INTEGRATION_CONFIG';
42
+ auth_mode: AuthModeType;
43
+ integration_config: Record<string, string>;
44
+ } | {
45
+ type: AuthModes['MCP_OAUTH2'];
46
+ client_id: string | null;
47
+ client_secret: string | null;
48
+ scopes: string | null;
34
49
  } | null;
35
50
  }
36
51
  export type GetPublicListIntegrations = ApiEndpoint<{
@@ -371,4 +386,14 @@ export type ApiPublicIntegrationCredentials = {
371
386
  app_id: string;
372
387
  app_link: string;
373
388
  private_key: string;
389
+ } | {
390
+ type: Extract<AuthModeType, 'MCP_OAUTH2_GENERIC'>;
391
+ client_name?: string | undefined;
392
+ client_uri?: string | undefined;
393
+ client_logo_uri?: string | undefined;
394
+ } | {
395
+ type: Extract<AuthModeType, 'MCP_OAUTH2'>;
396
+ client_id?: string | undefined;
397
+ client_secret?: string | undefined;
398
+ scopes?: string | undefined;
374
399
  };
@@ -1,6 +1,11 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  import type { DBEnvironment } from '../environment/db.js';
3
3
  export type ApiEnvironmentSummary = Pick<DBEnvironment, 'id' | 'account_id' | 'name' | 'is_production'>;
4
+ export type AccountGroupProperties = {
5
+ name?: string;
6
+ plan?: string;
7
+ created_date?: string;
8
+ };
4
9
  export type GetMeta = ApiEndpoint<{
5
10
  Audit: {
6
11
  kind: 'no-audit';
@@ -20,6 +25,7 @@ export type GetMeta = ApiEndpoint<{
20
25
  debugMode: boolean;
21
26
  gettingStartedClosed: boolean;
22
27
  auditTrail: boolean;
28
+ accountGroup: AccountGroupProperties;
23
29
  };
24
30
  };
25
31
  }>;
package/dist/mfa/api.d.ts CHANGED
@@ -59,9 +59,7 @@ export type DeleteMFA = ApiEndpoint<{
59
59
  Audit: AuditPolicy<'mfa', 'disabled', 'account'>;
60
60
  Method: 'DELETE';
61
61
  Path: '/api/v1/account/mfa';
62
- Body: {
63
- code: string;
64
- };
62
+ Body: MFACredential;
65
63
  Error: ApiError<'invalid_mfa_code'> | ApiError<'mfa_not_enabled'>;
66
64
  Success: {
67
65
  success: true;
@@ -1,7 +1,7 @@
1
1
  import type { OnEventType } from '../scripts/on-events/api.js';
2
2
  import type { Feature } from '../syncConfigs/db.js';
3
3
  import type { JSONSchema7 } from 'json-schema';
4
- export type HTTP_METHOD = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
4
+ export type HTTP_METHOD = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'PROPFIND' | 'REPORT';
5
5
  /** @deprecated **/
6
6
  export type SyncTypeLiteral = 'incremental' | 'full';
7
7
  export type ScriptFileType = 'actions' | 'syncs' | 'on-events' | 'functions' | 'webhooks' | 'post-connection-scripts';
@@ -0,0 +1,126 @@
1
+ import type { ApiError, ValidationError } from '../api.js';
2
+ export type OAuthConsentErrorCode = 'interaction_expired' | 'interaction_completed' | 'interaction_invalid' | 'login_required' | 'invalid_origin' | 'user_suspended' | 'account_unavailable';
3
+ export interface OAuthConsentResource {
4
+ hostname: string;
5
+ scopes: string[];
6
+ }
7
+ export interface OAuthConsentInteraction {
8
+ client: {
9
+ name: string;
10
+ hostname: string;
11
+ };
12
+ redirectUri: string;
13
+ account: {
14
+ name: string;
15
+ };
16
+ resource: OAuthConsentResource;
17
+ }
18
+ export interface GetOAuthConsentInteraction {
19
+ Audit: {
20
+ kind: 'no-audit';
21
+ reason: 'read-only interaction lookup';
22
+ };
23
+ Params: {
24
+ uid: string;
25
+ };
26
+ Reply: {
27
+ status: 200;
28
+ body: {
29
+ data: OAuthConsentInteraction;
30
+ };
31
+ } | {
32
+ status: 202;
33
+ body: {
34
+ data: {
35
+ resumeUrl: string;
36
+ };
37
+ };
38
+ } | {
39
+ status: 204;
40
+ body: never;
41
+ } | {
42
+ status: 401;
43
+ body: ApiError<'login_required'>;
44
+ } | {
45
+ status: 403;
46
+ body: ApiError<'user_suspended' | 'account_unavailable'>;
47
+ } | {
48
+ status: 404;
49
+ body: ApiError<'interaction_invalid'>;
50
+ } | {
51
+ status: 409;
52
+ body: ApiError<'interaction_completed'>;
53
+ } | {
54
+ status: 410;
55
+ body: ApiError<'interaction_expired'>;
56
+ };
57
+ }
58
+ export interface PostOAuthConsentLogin {
59
+ Audit: {
60
+ kind: 'no-audit';
61
+ reason: 'OAuth protocol state';
62
+ };
63
+ Params: {
64
+ uid: string;
65
+ };
66
+ Body: never;
67
+ Reply: {
68
+ status: 200;
69
+ body: {
70
+ data: {
71
+ resumeUrl: string;
72
+ };
73
+ };
74
+ } | {
75
+ status: 400;
76
+ body: ApiError<'invalid_body', ValidationError[]>;
77
+ } | {
78
+ status: 401;
79
+ body: ApiError<'login_required'>;
80
+ } | {
81
+ status: 403;
82
+ body: ApiError<'invalid_origin' | 'user_suspended' | 'account_unavailable'>;
83
+ } | {
84
+ status: 404;
85
+ body: ApiError<'interaction_invalid'>;
86
+ } | {
87
+ status: 409;
88
+ body: ApiError<'interaction_completed'>;
89
+ } | {
90
+ status: 410;
91
+ body: ApiError<'interaction_expired'>;
92
+ };
93
+ }
94
+ export interface PostOAuthConsentDecision {
95
+ Audit: {
96
+ kind: 'no-audit';
97
+ reason: 'TODO: audit coverage pending';
98
+ };
99
+ Params: {
100
+ uid: string;
101
+ };
102
+ Body: never;
103
+ Reply: {
104
+ status: 200;
105
+ body: {
106
+ data: {
107
+ resumeUrl: string;
108
+ };
109
+ };
110
+ } | {
111
+ status: 400;
112
+ body: ApiError<'invalid_body', ValidationError[]>;
113
+ } | {
114
+ status: 403;
115
+ body: ApiError<'invalid_origin' | 'interaction_invalid' | 'user_suspended' | 'account_unavailable'>;
116
+ } | {
117
+ status: 404;
118
+ body: ApiError<'interaction_invalid'>;
119
+ } | {
120
+ status: 409;
121
+ body: ApiError<'interaction_completed'>;
122
+ } | {
123
+ status: 410;
124
+ body: ApiError<'interaction_expired'>;
125
+ };
126
+ }
@@ -31,7 +31,7 @@ export interface SimplifiedJSONSchema {
31
31
  prefix?: string;
32
32
  suffix?: string;
33
33
  doc_section?: string;
34
- secret?: string;
34
+ secret?: boolean;
35
35
  automated: boolean;
36
36
  enum?: string[];
37
37
  warnings?: Record<string, string>;
@@ -46,7 +46,7 @@ export interface BaseProxyConfiguration {
46
46
  }
47
47
  export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
48
48
  decompress?: boolean | string;
49
- method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'get' | 'post' | 'patch' | 'put' | 'delete';
49
+ method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'PROPFIND' | 'REPORT' | 'get' | 'post' | 'patch' | 'put' | 'delete' | 'propfind' | 'report';
50
50
  paginate?: Partial<CursorPagination> | Partial<LinkPagination> | Partial<OffsetPagination>;
51
51
  }
52
52
  export type ConnectionForProxy = Pick<DBConnectionDecrypted, 'connection_id' | 'connection_config' | 'metadata'> & {
@@ -23,6 +23,7 @@ export interface NangoProps {
23
23
  lastSyncDate?: Date;
24
24
  syncId?: string | undefined;
25
25
  syncVariant?: string | undefined;
26
+ variant?: string | undefined;
26
27
  nangoConnectionId: number;
27
28
  syncJobId?: number | undefined;
28
29
  track_deletes?: boolean;
package/dist/web/env.d.ts CHANGED
@@ -3,6 +3,8 @@ export interface WindowEnv {
3
3
  apiUrl: string;
4
4
  /** Where the dashboard sends its own API requests. Equals `apiUrl` unless NANGO_DASHBOARD_API_URL is set. `/` means same-origin. */
5
5
  dashboardApiUrl: string;
6
+ /** OAuth authorization-server issuer used by the browser consent API. */
7
+ oauthServerUrl: string | undefined;
6
8
  publicUrl: string;
7
9
  connectUrl: string;
8
10
  gitHash: string | undefined;
@@ -71,6 +71,10 @@ export interface NangoForwardWebhookBody extends NangoWebhookBase {
71
71
  connectionId?: string;
72
72
  providerConfigKey: string;
73
73
  payload: unknown;
74
+ /**
75
+ * Only present when Nango could not verify the webhook came from the provider
76
+ */
77
+ unverified?: true;
74
78
  }
75
79
  export interface NangoAsyncActionWebhookBody extends NangoWebhookBase {
76
80
  type: 'async_action';
@@ -34,6 +34,7 @@ export interface LegacyDispatchMessage extends DispatchMessageBase {
34
34
  }
35
35
  export interface FunctionDispatchMessage extends DispatchMessageBase {
36
36
  kind: 'function';
37
+ functionConfigId: number;
37
38
  /** Deterministic key used to deduplicate queue redeliveries. */
38
39
  idempotencyKey: string;
39
40
  functionName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.71.9",
3
+ "version": "0.71.11",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/utils"
13
13
  },
14
14
  "dependencies": {
15
- "axios": "1.18.0",
15
+ "axios": "1.20.0",
16
16
  "json-schema": "0.4.0",
17
17
  "type-fest": "4.41.0"
18
18
  },