@nangohq/types 0.71.10 → 0.71.12
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.
- package/dist/agent/api.d.ts +22 -2
- package/dist/agent/playground.api.d.ts +29 -0
- package/dist/agent/session.d.ts +10 -0
- package/dist/api-keys/scopes.d.ts +1 -1
- package/dist/api.endpoints.d.ts +4 -3
- package/dist/audit-trail/event.d.ts +2 -1
- package/dist/audit-trail/metadata.d.ts +3 -0
- package/dist/cli/api.d.ts +10 -3
- package/dist/function/db.d.ts +2 -0
- package/dist/functions/api.d.ts +69 -8
- package/dist/functions/domain.d.ts +15 -3
- package/dist/index.d.ts +1 -0
- package/dist/integration/api.d.ts +25 -0
- package/dist/integration/db.d.ts +2 -1
- package/dist/meta/api.d.ts +8 -0
- package/dist/mfa/api.d.ts +1 -3
- package/dist/providers/provider.d.ts +1 -1
- package/dist/webhooks/api.d.ts +4 -0
- package/package.json +2 -2
package/dist/agent/api.d.ts
CHANGED
|
@@ -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?:
|
|
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[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
export interface AgentPlaygroundUsage {
|
|
3
|
+
inputTokens: number;
|
|
4
|
+
outputTokens: number;
|
|
5
|
+
}
|
|
6
|
+
export interface AgentPlaygroundMessageMetadata {
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
usage?: AgentPlaygroundUsage;
|
|
10
|
+
}
|
|
11
|
+
export type AgentPlaygroundErrorCode = 'feature_disabled' | 'session_creation_failed' | 'model_error';
|
|
12
|
+
export type PostAgentPlaygroundChat = ApiEndpoint<{
|
|
13
|
+
Audit: {
|
|
14
|
+
kind: 'no-audit';
|
|
15
|
+
reason: 'TODO: audit coverage pending';
|
|
16
|
+
};
|
|
17
|
+
Method: 'POST';
|
|
18
|
+
Path: '/api/v1/agent-playground/chat';
|
|
19
|
+
Querystring: {
|
|
20
|
+
env: string;
|
|
21
|
+
};
|
|
22
|
+
Body: {
|
|
23
|
+
sessionId?: string | undefined;
|
|
24
|
+
messages: unknown[];
|
|
25
|
+
timeZone?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
Success: Record<string, unknown>;
|
|
28
|
+
Error: ApiError<AgentPlaygroundErrorCode>;
|
|
29
|
+
}>;
|
package/dist/agent/session.d.ts
CHANGED
|
@@ -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.endpoints.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { GetAsyncActionResult, GetPublicV1, PostInternalTriggerFunction, Po
|
|
|
3
3
|
import type { PostImpersonate } from './admin/http.api.js';
|
|
4
4
|
import type { DeleteAgentSession, PostAgentSessions } from './agent/api.js';
|
|
5
5
|
import type { GetAgentSessionMcp, PostAgentSessionMcp } from './agent/mcp.api.js';
|
|
6
|
+
import type { PostAgentPlaygroundChat } from './agent/playground.api.js';
|
|
6
7
|
import type { EndpointMethod } from './api.js';
|
|
7
8
|
import type { GetAuditTrail, GetAuditTrailExport } from './audit-trail/api.js';
|
|
8
9
|
import type { PostPublicApiKeyAuthorization, PostPublicAwsSigV4Authorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
|
|
@@ -17,7 +18,7 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, DeletePublicApiKey,
|
|
|
17
18
|
import type { PatchWebhook } from './environment/api/webhook.js';
|
|
18
19
|
import type { PostEnvironmentVariables } from './environment/variable/api.js';
|
|
19
20
|
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';
|
|
21
|
+
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
22
|
import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
|
|
22
23
|
import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
|
|
23
24
|
import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
|
|
@@ -35,8 +36,8 @@ import type { GetConnectionSyncs, GetPublicSyncStatus, PostPublicSyncPause, Post
|
|
|
35
36
|
import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
|
|
36
37
|
import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
|
|
37
38
|
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;
|
|
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;
|
|
39
|
+
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;
|
|
40
|
+
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 | PostAgentPlaygroundChat;
|
|
40
41
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
41
42
|
/**
|
|
42
43
|
* Automatically narrow endpoints type with Method + Path
|
|
@@ -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
|
}
|
package/dist/cli/api.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ApiEndpoint } from '../api.js';
|
|
2
|
-
export type
|
|
2
|
+
export type CliTelemetryCommand = 'init' | 'create' | 'compile' | 'dev' | 'dryrun' | 'generate:docs' | 'generate:tests' | 'clone' | 'migrate-to-zero-yaml' | 'deploy' | 'pull';
|
|
3
|
+
/** Released CLIs still send these, so the endpoint keeps accepting them. */
|
|
4
|
+
export type LegacyCliTelemetryEvent = 'cli:init' | 'cli:create' | 'cli:compile' | 'cli:dev' | 'cli:dryrun' | 'cli:generate:docs' | 'cli:generate:tests' | 'cli:clone' | 'cli:migrate_to_zero_yaml' | 'cli:deploy' | 'cli:pull';
|
|
3
5
|
export type PostCliTelemetry = ApiEndpoint<{
|
|
4
6
|
Audit: {
|
|
5
7
|
kind: 'no-audit';
|
|
@@ -9,8 +11,13 @@ export type PostCliTelemetry = ApiEndpoint<{
|
|
|
9
11
|
Path: '/cli/telemetry';
|
|
10
12
|
Body: {
|
|
11
13
|
deviceId: string;
|
|
12
|
-
event: CliTelemetryEvent;
|
|
13
14
|
ephemeral?: boolean;
|
|
14
|
-
}
|
|
15
|
+
} & ({
|
|
16
|
+
command: CliTelemetryCommand;
|
|
17
|
+
event?: never;
|
|
18
|
+
} | {
|
|
19
|
+
event: LegacyCliTelemetryEvent;
|
|
20
|
+
command?: never;
|
|
21
|
+
});
|
|
15
22
|
Success: never;
|
|
16
23
|
}>;
|
package/dist/function/db.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/functions/api.d.ts
CHANGED
|
@@ -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<{
|
|
@@ -230,11 +288,12 @@ export type PostFunctionInvocation = ApiEndpoint<{
|
|
|
230
288
|
reason: 'non-auditable';
|
|
231
289
|
};
|
|
232
290
|
Method: 'POST';
|
|
233
|
-
Path: '/functions/invocations';
|
|
291
|
+
Path: '/connections/:connectionId/functions/:functionUuid/invocations';
|
|
292
|
+
Params: {
|
|
293
|
+
connectionId: string;
|
|
294
|
+
functionUuid: string;
|
|
295
|
+
};
|
|
234
296
|
Body: {
|
|
235
|
-
connection_id: string;
|
|
236
|
-
integration_id: string;
|
|
237
|
-
name: string;
|
|
238
297
|
input?: unknown | undefined;
|
|
239
298
|
invocation_type: FunctionInvocationType;
|
|
240
299
|
options?: Record<string, unknown> | undefined;
|
|
@@ -248,11 +307,13 @@ export type GetFunctionInvocation = ApiEndpoint<{
|
|
|
248
307
|
reason: 'non-auditable';
|
|
249
308
|
};
|
|
250
309
|
Method: 'GET';
|
|
251
|
-
Path: '/functions/invocations/:id';
|
|
310
|
+
Path: '/connections/:connectionId/functions/:functionUuid/invocations/:id';
|
|
252
311
|
Params: {
|
|
312
|
+
connectionId: string;
|
|
313
|
+
functionUuid: string;
|
|
253
314
|
id: string;
|
|
254
315
|
};
|
|
255
|
-
Error: ApiError<'invalid_uri_params' | 'not_found' | 'function_failed' | 'server_error'>;
|
|
316
|
+
Error: ApiError<'invalid_uri_params' | 'not_found' | 'function_not_found' | 'connection_not_found' | 'function_failed' | 'server_error'>;
|
|
256
317
|
Success: FunctionInvocationSuccess;
|
|
257
318
|
}>;
|
|
258
319
|
export interface FunctionListFilters {
|
|
@@ -325,7 +386,7 @@ export type DeleteIntegrationFunction = ApiEndpoint<{
|
|
|
325
386
|
providerConfigKey: string;
|
|
326
387
|
functionName: string;
|
|
327
388
|
};
|
|
328
|
-
Error: ApiError<'function_managed_by_deploy'>;
|
|
389
|
+
Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
|
|
329
390
|
Success: FunctionDeletionSuccess;
|
|
330
391
|
}>;
|
|
331
392
|
export type GetProviderTemplates = ApiEndpoint<{
|
|
@@ -384,7 +445,7 @@ export type DeletePublicIntegrationFunction = ApiEndpoint<{
|
|
|
384
445
|
uniqueKey: string;
|
|
385
446
|
name: string;
|
|
386
447
|
};
|
|
387
|
-
Error: ApiError<'function_managed_by_deploy'>;
|
|
448
|
+
Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
|
|
388
449
|
Success: FunctionDeletionSuccess;
|
|
389
450
|
}>;
|
|
390
451
|
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
|
-
|
|
39
|
-
export
|
|
40
|
-
|
|
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
|
@@ -15,6 +15,7 @@ export type * from './action/api.js';
|
|
|
15
15
|
export type * from './agent/api.js';
|
|
16
16
|
export type * from './agent/connections.js';
|
|
17
17
|
export type * from './agent/mcp.api.js';
|
|
18
|
+
export type * from './agent/playground.api.js';
|
|
18
19
|
export type * from './agent/session.js';
|
|
19
20
|
export type * from './agent/toolSearch.js';
|
|
20
21
|
export type * from './agent/toolset.js';
|
|
@@ -32,6 +32,20 @@ export interface ApiPublicIntegrationInclude {
|
|
|
32
32
|
app_id: string | null;
|
|
33
33
|
app_link: string | null;
|
|
34
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;
|
|
35
49
|
} | null;
|
|
36
50
|
}
|
|
37
51
|
export type GetPublicListIntegrations = ApiEndpoint<{
|
|
@@ -311,6 +325,7 @@ export type PatchIntegration = ApiEndpoint<{
|
|
|
311
325
|
webhookSecret?: string | undefined;
|
|
312
326
|
displayName?: string | undefined;
|
|
313
327
|
forward_webhooks?: boolean | undefined;
|
|
328
|
+
allow_unverified_webhooks?: boolean | undefined;
|
|
314
329
|
integrationConfig?: Record<string, string> | undefined;
|
|
315
330
|
} | IntegrationAuthBody;
|
|
316
331
|
Success: {
|
|
@@ -372,4 +387,14 @@ export type ApiPublicIntegrationCredentials = {
|
|
|
372
387
|
app_id: string;
|
|
373
388
|
app_link: string;
|
|
374
389
|
private_key: string;
|
|
390
|
+
} | {
|
|
391
|
+
type: Extract<AuthModeType, 'MCP_OAUTH2_GENERIC'>;
|
|
392
|
+
client_name?: string | undefined;
|
|
393
|
+
client_uri?: string | undefined;
|
|
394
|
+
client_logo_uri?: string | undefined;
|
|
395
|
+
} | {
|
|
396
|
+
type: Extract<AuthModeType, 'MCP_OAUTH2'>;
|
|
397
|
+
client_id?: string | undefined;
|
|
398
|
+
client_secret?: string | undefined;
|
|
399
|
+
scopes?: string | undefined;
|
|
375
400
|
};
|
package/dist/integration/db.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ export interface IntegrationConfig extends TimestampsAndDeleted {
|
|
|
16
16
|
missing_fields: string[];
|
|
17
17
|
display_name: string | null;
|
|
18
18
|
forward_webhooks: boolean;
|
|
19
|
+
allow_unverified_webhooks: boolean;
|
|
19
20
|
shared_credentials_id: number | null;
|
|
20
21
|
}
|
|
21
22
|
export type DBIntegrationDecrypted = IntegrationConfig;
|
|
22
23
|
export type DBIntegrationCrypted = Tagged<IntegrationConfig, 'IntegrationCrypted'>;
|
|
23
|
-
export type DBCreateIntegration = SetOptional<NullablePartial<Omit<IntegrationConfig, 'created_at' | 'updated_at'>>, 'missing_fields'>;
|
|
24
|
+
export type DBCreateIntegration = SetOptional<NullablePartial<Omit<IntegrationConfig, 'created_at' | 'updated_at'>>, 'missing_fields' | 'allow_unverified_webhooks'>;
|
package/dist/meta/api.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
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
|
+
is_internal?: boolean;
|
|
9
|
+
};
|
|
4
10
|
export type GetMeta = ApiEndpoint<{
|
|
5
11
|
Audit: {
|
|
6
12
|
kind: 'no-audit';
|
|
@@ -20,6 +26,8 @@ export type GetMeta = ApiEndpoint<{
|
|
|
20
26
|
debugMode: boolean;
|
|
21
27
|
gettingStartedClosed: boolean;
|
|
22
28
|
auditTrail: boolean;
|
|
29
|
+
accountGroup: AccountGroupProperties;
|
|
30
|
+
agentPlayground: boolean;
|
|
23
31
|
};
|
|
24
32
|
};
|
|
25
33
|
}>;
|
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;
|
package/dist/webhooks/api.d.ts
CHANGED
|
@@ -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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nangohq/types",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.12",
|
|
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.
|
|
15
|
+
"axios": "1.20.0",
|
|
16
16
|
"json-schema": "0.4.0",
|
|
17
17
|
"type-fest": "4.41.0"
|
|
18
18
|
},
|