@nangohq/types 0.71.12 → 0.71.14

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ export type AnalyticsSurface = 'web' | 'cli' | 'server';
2
+ export interface AnalyticsCategories {
3
+ auth: 'Signing up, logging in and account access';
4
+ audit: "The account's audit trail: who did what in the account. Not function logs";
5
+ onboarding: 'Getting Started';
6
+ connections: 'Creating and managing connections';
7
+ playground: 'The dashboard Playground';
8
+ functions: 'Writing, deploying and running syncs and actions, including from the CLI';
9
+ billing: 'Plans, usage and payment';
10
+ agents: 'Agent sessions and the tools agents call through them';
11
+ integrations: 'Creating and configuring integrations';
12
+ environments: 'Environments and their settings';
13
+ team: 'The people in an account and their roles';
14
+ logs: 'Searching and reading operation logs';
15
+ }
16
+ export interface AnalyticsObjects {
17
+ account: 'A Nango account';
18
+ user: 'A person in an account';
19
+ connection: "An end user's authorised link to an integration";
20
+ integration: 'A provider configured in an environment. Never `provider`';
21
+ deploy: 'Pushing functions to an environment';
22
+ command: 'A CLI command, such as `compile` or `deploy`';
23
+ function: 'A sync or an action';
24
+ run: 'One execution of a function';
25
+ api_key: 'An account or environment key';
26
+ environment: 'Dev, prod or a custom environment';
27
+ plan: "The account's pricing plan";
28
+ session: 'An agent session';
29
+ tool_call: 'One call an agent makes to a tool in its session';
30
+ proxy_request: "One request an agent sends to an integration's API through the proxy";
31
+ tool_search: 'One search an agent runs for tools in its session';
32
+ usage: "The Usage page's metrics and charts";
33
+ playground: 'The dashboard Playground panel';
34
+ agent_turn: 'One message and its reply in an Agent Playground chat';
35
+ approval: 'A tool call in an Agent Playground chat that waits for the user to approve or deny it';
36
+ two_factor: "A user's two-factor authentication";
37
+ recovery_codes: "A user's two-factor recovery codes";
38
+ password: "A user's password";
39
+ join_request: 'A request to join an existing account';
40
+ export: 'A file of records produced for download, such as the audit trail';
41
+ sync_command: "A run, full resync, pause, resume or cancel sent to a connection's sync";
42
+ operation: 'One entry in the logs, such as a sync run or an auth attempt';
43
+ filter: 'A search or filter on a dashboard list';
44
+ }
45
+ export interface AnalyticsUiElements {
46
+ button: 'A dashboard button, such as `create_button`';
47
+ link: 'A dashboard link, such as `invoice_link`';
48
+ tab: 'A dashboard tab';
49
+ modal: 'A dashboard modal';
50
+ page: 'A dashboard page, such as `create_page`';
51
+ }
52
+ export interface AnalyticsActions {
53
+ click: 'A UI element was clicked';
54
+ submit: 'A form or request was sent';
55
+ create: 'A new thing was created, or a creation attempt finished. Include `is_success` when failures are tracked';
56
+ view: 'A page or item was seen';
57
+ add: 'Something was added to an existing thing';
58
+ invite: 'Someone was invited';
59
+ update: 'Something changed';
60
+ delete: 'Something was destroyed';
61
+ remove: 'Something was taken out of an existing thing, not destroyed';
62
+ start: 'Something with a lifetime began, such as a session. Pairs with `end`';
63
+ end: 'Something with a lifetime stopped. Pairs with `start`';
64
+ complete: 'An operation that produces no new thing finished, such as a run or a tool call. Always carries `is_success`';
65
+ cancel: 'Someone stopped a process';
66
+ generate: 'Something was produced automatically';
67
+ send: 'Something was sent to someone';
68
+ }
69
+ export type AnalyticsCategory = keyof AnalyticsCategories;
70
+ export type AnalyticsObject = keyof AnalyticsObjects | `${string}_${keyof AnalyticsUiElements}`;
71
+ export type AnalyticsAction = keyof AnalyticsActions;
72
+ export type AnalyticsEventName = `${AnalyticsCategory}:${AnalyticsObject}_${AnalyticsAction}`;
@@ -4,7 +4,7 @@ export declare const API_KEY_SCOPES: readonly ["environment:integrations:list",
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'>;
7
- export declare const ACCOUNT_API_KEY_SCOPES: readonly ["account:environments:list", "account:environments:create", "account:environments:delete", "account:environments:set_production", "account:environments:api_keys:list", "account:environments:api_keys:read", "account:environments:api_keys:create", "account:environments:api_keys:delete"];
7
+ export declare const ACCOUNT_API_KEY_SCOPES: readonly ["account:environments:list", "account:environments:read", "account:environments:read_secret", "account:environments:create", "account:environments:delete", "account:environments:set_production", "account:environments:api_keys:list", "account:environments:api_keys:read", "account:environments:api_keys:create", "account:environments:api_keys:update", "account:environments:api_keys:delete"];
8
8
  export type ConcreteAccountApiKeyScope = (typeof ACCOUNT_API_KEY_SCOPES)[number];
9
9
  export type AccountApiKeyScope = ConcreteAccountApiKeyScope | WildcardsFor<'account'>;
10
10
  export type CustomerKeyScope = ApiKeyScope | AccountApiKeyScope;
@@ -1,5 +1,5 @@
1
1
  import type { ConfirmEmail, CreateAccountApiKey, DeleteAccountApiKey, GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, GetManagedEmailVerification, GetOnboardingAccountDiscovery, ListAccountApiKeys, PostForgotPassword, PostLogout, PostManagedEmailVerification, PostManagedSignup, PostOnboardingRequestInvite, PostSignin, PostSignup, PutResetPassword } from './account/api.js';
2
- import type { GetAsyncActionResult, GetPublicV1, PostInternalTriggerFunction, PostPublicTriggerAction } from './action/api.js';
2
+ import type { GetAsyncActionResult, GetPublicV1, PostInternalInvokeFunction, PostPublicTriggerAction } from './action/api.js';
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';
@@ -14,15 +14,16 @@ import type { DeleteConnection, DeletePublicConnection, GetConnection, GetConnec
14
14
  import type { PostConnectionMetadata, SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
15
15
  import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
16
16
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
17
- import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, DeletePublicApiKey, DeletePublicEnvironment, GetEnvironment, GetEnvironments, GetPublicApiKey, GetPublicApiKeys, GetPublicEnvironments, ListApiKeys, PatchApiKey, PatchEnvironment, PostEnvironment, PostPublicApiKey, PostPublicEnvironment, PostPublicRotateWebhookSigningKey, PostRotateWebhookSigningKey } from './environment/api/index.js';
17
+ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, DeletePublicApiKey, DeletePublicEnvironment, GetEnvironment, GetEnvironments, GetPublicApiKey, GetPublicApiKeys, GetPublicEnvironment, GetPublicEnvironments, ListApiKeys, PatchApiKey, PatchEnvironment, PatchPublicApiKey, PostEnvironment, PostPublicApiKey, PostPublicEnvironment, PostPublicRotateWebhookSigningKey, PostRotateWebhookSigningKey } from './environment/api/index.js';
18
18
  import type { PatchWebhook } from './environment/api/webhook.js';
19
19
  import type { PostEnvironmentVariables } from './environment/variable/api.js';
20
20
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.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
+ import type { DeleteFunctionVariant, DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunction, GetFunctionDeployment, GetFunctionDryrun, GetFunctionInvocation, GetFunctions, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PatchConnectionFunction, PatchFunction, PatchFunctionVariant, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentBundle, PostFunctionDeploymentBundlePreview, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult, PostFunctionInvocation, PostFunctionVariant, PostToolCall } from './functions/api.js';
22
22
  import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
23
23
  import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
24
24
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
25
25
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
26
+ import type { GetConnectionToolsMcp, PostConnectionToolsMcp } from './mcp/api.js';
26
27
  import type { GetMeta } from './meta/api.js';
27
28
  import type { DeleteMFA, GetMFAStatus, PostMFAActivation, PostMFAEnrollment, PostMFALoginVerification, PostMFARecoveryCodes } from './mfa/api.js';
28
29
  import type { GetPlainHmac } from './plain/api.js';
@@ -36,8 +37,8 @@ import type { GetConnectionSyncs, GetPublicSyncStatus, PostPublicSyncPause, Post
36
37
  import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
37
38
  import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
38
39
  import type { PostPublicWebhook } from './webhooks/http.api.js';
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
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostAgentSessions | DeleteAgentSession | PostAgentSessionMcp | GetAgentSessionMcp | PostConnectionToolsMcp | GetConnectionToolsMcp | 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 | PostFunctionVariant | PatchFunctionVariant | PatchConnectionFunction | DeleteFunctionVariant | GetFunctionInvocation | PostFunctionDeploymentBundle | PostFunctionDeploymentBundlePreview | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | PostToolCall | DeletePublicIntegrationFunction | GetPublicProviderTemplates | PostPublicRotateWebhookSigningKey | AllPublicProxy | PostPublicEnvironment | DeletePublicEnvironment | GetPublicEnvironment | GetPublicEnvironments | GetPublicApiKey | GetPublicApiKeys | PostPublicApiKey | PatchPublicApiKey | DeletePublicApiKey;
41
+ 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 | PostInternalInvokeFunction | GetMFAStatus | PostMFAEnrollment | PostMFAActivation | PostMFARecoveryCodes | PostMFALoginVerification | DeleteMFA | GetPlainHmac | PostAgentPlaygroundChat;
41
42
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
42
43
  /**
43
44
  * 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, FunctionUpdatedMetadata, 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, FunctionVariantMetadata, FunctionVariantSettingsMetadata, 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';
@@ -28,6 +28,9 @@ interface AuditEventTable {
28
28
  upgraded: FunctionUpgradedMetadata;
29
29
  updated: FunctionUpdatedMetadata;
30
30
  deleted: FunctionDeletedMetadata;
31
+ variant_created: FunctionVariantMetadata;
32
+ variant_deleted: FunctionVariantMetadata;
33
+ variant_updated: FunctionVariantSettingsMetadata;
31
34
  };
32
35
  integration: {
33
36
  created: IntegrationProviderMetadata;
@@ -54,6 +54,14 @@ export interface SyncFrequencyChangedMetadata extends SyncBaseMetadata {
54
54
  export interface SyncVariantMetadata extends SyncBaseMetadata {
55
55
  variant?: string;
56
56
  }
57
+ export interface FunctionVariantMetadata {
58
+ connectionId?: string;
59
+ variant?: string;
60
+ }
61
+ export interface FunctionVariantSettingsMetadata extends FunctionVariantMetadata {
62
+ enabled?: boolean;
63
+ frequency?: string | null;
64
+ }
57
65
  export interface SyncTriggeredMetadata extends SyncBaseMetadata {
58
66
  reset?: boolean;
59
67
  emptyCache?: boolean;
@@ -24,7 +24,9 @@ export interface BillingClient {
24
24
  pendingChangeId: string;
25
25
  amountInCents: number | null;
26
26
  }>>;
27
- downgrade: (opts: PlanChangeRequest) => Promise<Result<void>>;
27
+ downgrade: (opts: PlanChangeRequest) => Promise<Result<{
28
+ changeAt: Date | null;
29
+ }>>;
28
30
  startGrowthAddon: (opts: {
29
31
  subscriptionId: string;
30
32
  }) => Promise<Result<{
@@ -34,6 +34,38 @@ export type GetPublicEnvironments = ApiEndpoint<{
34
34
  data: Pick<DBEnvironment, 'id' | 'uuid' | 'name' | 'is_production'>[];
35
35
  };
36
36
  }>;
37
+ export type GetPublicEnvironment = ApiEndpoint<{
38
+ Audit: {
39
+ kind: 'no-audit';
40
+ reason: 'non-auditable';
41
+ };
42
+ Method: 'GET';
43
+ Path: '/environments/:environmentUuid';
44
+ Params: {
45
+ environmentUuid: string;
46
+ };
47
+ Querystring: {
48
+ with_secrets?: 'true' | 'false' | undefined;
49
+ };
50
+ Success: {
51
+ data: {
52
+ id: number;
53
+ uuid: string;
54
+ name: string;
55
+ is_production: boolean;
56
+ callback_url: string;
57
+ slack_notifications: boolean;
58
+ otlp_endpoint: string | null;
59
+ otlp_headers?: {
60
+ name: string;
61
+ value: string;
62
+ }[];
63
+ webhooks: ApiWebhooks & {
64
+ signing_key?: string;
65
+ };
66
+ };
67
+ };
68
+ }>;
37
69
  export type PostEnvironment = ApiEndpoint<{
38
70
  Audit: AuditPolicy<'environment', 'created', 'account'>;
39
71
  Method: 'POST';
@@ -62,9 +94,34 @@ export type PostPublicEnvironment = ApiEndpoint<{
62
94
  name: string;
63
95
  value: string;
64
96
  }[] | undefined;
97
+ webhooks?: {
98
+ primary_url?: string | undefined;
99
+ secondary_url?: string | undefined;
100
+ on_sync_completion_always?: boolean | undefined;
101
+ on_auth_creation?: boolean | undefined;
102
+ on_auth_refresh_error?: boolean | undefined;
103
+ on_sync_error?: boolean | undefined;
104
+ on_async_action_completion?: boolean | undefined;
105
+ on_connection_deletion?: boolean | undefined;
106
+ } | undefined;
65
107
  };
66
108
  Success: {
67
- data: Pick<DBEnvironment, 'id' | 'uuid' | 'name'>;
109
+ data: {
110
+ id: number;
111
+ uuid: string;
112
+ name: string;
113
+ is_production: boolean;
114
+ callback_url: string;
115
+ slack_notifications: boolean;
116
+ otlp_endpoint: string | null;
117
+ otlp_headers: {
118
+ name: string;
119
+ value: string;
120
+ }[];
121
+ webhooks: ApiWebhooks & {
122
+ signing_key: string;
123
+ };
124
+ };
68
125
  };
69
126
  Error: ApiError<'conflict' | 'resource_capped' | 'invalid_is_prod_flag'>;
70
127
  }>;
@@ -211,6 +268,7 @@ export type PostPublicApiKey = ApiEndpoint<{
211
268
  };
212
269
  Body: {
213
270
  display_name: string;
271
+ scopes?: ApiKeyScope[];
214
272
  };
215
273
  Success: {
216
274
  data: {
@@ -271,6 +329,30 @@ export type GetPublicApiKey = ApiEndpoint<{
271
329
  };
272
330
  };
273
331
  }>;
332
+ export type PatchPublicApiKey = ApiEndpoint<{
333
+ Audit: AuditPolicy<'api_key', 'updated', 'environment'>;
334
+ Method: 'PATCH';
335
+ Path: '/environments/:environmentUuid/api-keys/:keyUuid';
336
+ Params: {
337
+ environmentUuid: string;
338
+ keyUuid: string;
339
+ };
340
+ Body: {
341
+ display_name?: string;
342
+ scopes?: ApiKeyScope[];
343
+ };
344
+ Success: {
345
+ data: {
346
+ id: number;
347
+ uuid: string;
348
+ display_name: string;
349
+ scopes: ApiKeyScope[];
350
+ last_used_at: string | null;
351
+ created_at: string;
352
+ };
353
+ };
354
+ Error: ApiError<'conflict' | 'not_found'>;
355
+ }>;
274
356
  export type DeletePublicApiKey = ApiEndpoint<{
275
357
  Audit: AuditPolicy<'api_key', 'deleted', 'environment'>;
276
358
  Method: 'DELETE';
@@ -80,7 +80,7 @@ export type PatchFlowDisable = ApiEndpoint<{
80
80
  scriptName: string;
81
81
  type: ScriptTypeLiteral;
82
82
  };
83
- Error: ApiError<'unknown_provider'>;
83
+ Error: ApiError<'unknown_provider'> | ApiError<'unknown_sync_config'>;
84
84
  Success: {
85
85
  data: {
86
86
  success: boolean;
@@ -1,4 +1,5 @@
1
1
  import type { OnEventType } from '../scripts/on-events/api.js';
2
+ export type FunctionTags = Record<string, string | string[]>;
2
3
  export interface FunctionCapabilities {
3
4
  usesRecords: boolean;
4
5
  usesOutbound: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { TimestampsAndDeletedAt } from '../db.js';
2
2
  import type { FunctionSource } from '../syncConfigs/db.js';
3
- import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from './config.js';
3
+ import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTags, FunctionTriggerDefinition } from './config.js';
4
4
  import type { JSONSchema7 } from 'json-schema';
5
5
  export interface DBFunctionConfig extends TimestampsAndDeletedAt {
6
6
  id: number;
@@ -15,6 +15,7 @@ export interface DBFunctionConfigVersion extends TimestampsAndDeletedAt {
15
15
  id: number;
16
16
  function_config_id: number;
17
17
  description: string;
18
+ tags: FunctionTags;
18
19
  file_location: string;
19
20
  version: string;
20
21
  source: FunctionSource;
@@ -0,0 +1,5 @@
1
+ import type { FunctionTags } from './config.js';
2
+ export type ToolTags = {
3
+ required_scopes?: string[];
4
+ instructions?: string;
5
+ } & FunctionTags;
@@ -1,8 +1,8 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  import type { AuditPolicy } from '../audit-trail/event.js';
3
- import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from '../function/config.js';
3
+ import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTags, FunctionTriggerDefinition } from '../function/config.js';
4
4
  import type { FunctionSource } from '../syncConfigs/db.js';
5
- import type { FunctionType, ListedNangoFunction, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
5
+ import type { FunctionListType, FunctionType, ListedNangoFunction, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
6
6
  import type { JSONSchema7 } from 'json-schema';
7
7
  export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
8
8
  export type FunctionErrorCode = 'invalid_request' | 'server_error' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'dryrun_not_found' | 'deployment_not_found' | 'function_disabled' | 'execution_environment_unavailable' | 'timeout' | 'validation_error';
@@ -229,9 +229,12 @@ export interface GetFunctionResponse {
229
229
  provider: string;
230
230
  name: string;
231
231
  description: string;
232
+ tags: FunctionTags;
232
233
  state: 'enabled' | 'disabled';
233
234
  source: FunctionSource;
234
235
  trigger: FunctionTriggerDefinition;
236
+ input_json_schema: JSONSchema7 | null;
237
+ output_json_schema: JSONSchema7 | null;
235
238
  created_at: string;
236
239
  updated_at: string;
237
240
  }
@@ -301,6 +304,75 @@ export type PostFunctionInvocation = ApiEndpoint<{
301
304
  Error: ApiError<FunctionInvocationErrorCode>;
302
305
  Success: FunctionInvocationSuccess;
303
306
  }>;
307
+ export type FunctionVariantErrorCode = 'invalid_variant' | 'function_not_found' | 'connection_not_found' | 'function_disabled' | 'function_variant_not_found' | 'invalid_frequency' | 'resource_capped' | 'server_error';
308
+ export type FunctionVariantSuccess = {
309
+ function: {
310
+ uuid: string;
311
+ name: string;
312
+ };
313
+ variant: string;
314
+ frequency: string;
315
+ state: 'enabled' | 'disabled';
316
+ };
317
+ export type PostFunctionVariant = ApiEndpoint<{
318
+ Audit: AuditPolicy<'function', 'variant_created', 'environment'>;
319
+ Method: 'POST';
320
+ Path: '/connections/:connectionId/functions/:functionUuid/variants';
321
+ Params: {
322
+ connectionId: string;
323
+ functionUuid: string;
324
+ };
325
+ Body: {
326
+ variant: string;
327
+ };
328
+ Error: ApiError<FunctionVariantErrorCode>;
329
+ Success: FunctionVariantSuccess;
330
+ }>;
331
+ export type DeleteFunctionVariant = ApiEndpoint<{
332
+ Audit: AuditPolicy<'function', 'variant_deleted', 'environment'>;
333
+ Method: 'DELETE';
334
+ Path: '/connections/:connectionId/functions/:functionUuid/variants/:variant';
335
+ Params: {
336
+ connectionId: string;
337
+ functionUuid: string;
338
+ variant: string;
339
+ };
340
+ Error: ApiError<FunctionVariantErrorCode>;
341
+ Success: {
342
+ success: boolean;
343
+ };
344
+ }>;
345
+ export type PatchConnectionFunction = ApiEndpoint<{
346
+ Audit: AuditPolicy<'function', 'variant_updated', 'environment'>;
347
+ Method: 'PATCH';
348
+ Path: '/connections/:connectionId/functions/:functionUuid';
349
+ Params: {
350
+ connectionId: string;
351
+ functionUuid: string;
352
+ };
353
+ Body: PatchFunctionVariant['Body'];
354
+ Error: ApiError<FunctionVariantErrorCode>;
355
+ Success: FunctionVariantSuccess;
356
+ }>;
357
+ export type PatchFunctionVariant = ApiEndpoint<{
358
+ Audit: AuditPolicy<'function', 'variant_updated', 'environment'>;
359
+ Method: 'PATCH';
360
+ Path: '/connections/:connectionId/functions/:functionUuid/variants/:variant';
361
+ Params: {
362
+ connectionId: string;
363
+ functionUuid: string;
364
+ variant: string;
365
+ };
366
+ Body: {
367
+ enabled: boolean;
368
+ frequency?: string | null;
369
+ } | {
370
+ enabled?: boolean;
371
+ frequency: string | null;
372
+ };
373
+ Error: ApiError<FunctionVariantErrorCode>;
374
+ Success: FunctionVariantSuccess;
375
+ }>;
304
376
  export type GetFunctionInvocation = ApiEndpoint<{
305
377
  Audit: {
306
378
  kind: 'no-audit';
@@ -317,7 +389,7 @@ export type GetFunctionInvocation = ApiEndpoint<{
317
389
  Success: FunctionInvocationSuccess;
318
390
  }>;
319
391
  export interface FunctionListFilters {
320
- type?: FunctionType;
392
+ type?: FunctionListType;
321
393
  search?: string;
322
394
  page?: number;
323
395
  limit?: number;
@@ -365,7 +437,7 @@ export type GetIntegrationFunction = ApiEndpoint<{
365
437
  Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
366
438
  Querystring: {
367
439
  env: string;
368
- type?: FunctionType;
440
+ type?: FunctionListType;
369
441
  };
370
442
  Params: {
371
443
  providerConfigKey: string;
@@ -425,7 +497,7 @@ export type GetPublicIntegrationFunction = ApiEndpoint<{
425
497
  Method: 'GET';
426
498
  Path: '/integrations/:uniqueKey/functions/:name';
427
499
  Querystring: {
428
- type?: FunctionType;
500
+ type?: FunctionListType;
429
501
  };
430
502
  Params: {
431
503
  uniqueKey: string;
@@ -448,6 +520,26 @@ export type DeletePublicIntegrationFunction = ApiEndpoint<{
448
520
  Error: ApiError<'function_managed_by_deploy' | 'invalid_request'>;
449
521
  Success: FunctionDeletionSuccess;
450
522
  }>;
523
+ export type PostToolCall = ApiEndpoint<{
524
+ Audit: {
525
+ kind: 'no-audit';
526
+ reason: 'data-plane operation';
527
+ };
528
+ Method: 'POST';
529
+ Path: '/connections/:connectionId/tools/:name/calls';
530
+ Params: {
531
+ connectionId: string;
532
+ name: string;
533
+ };
534
+ Headers: {
535
+ 'provider-config-key'?: string | undefined;
536
+ };
537
+ Body: {
538
+ input?: unknown | undefined;
539
+ };
540
+ Error: ApiError<FunctionInvocationErrorCode | 'ambiguous_connection'>;
541
+ Success: FunctionInvocationSuccess;
542
+ }>;
451
543
  export type GetPublicProviderTemplates = ApiEndpoint<{
452
544
  Audit: {
453
545
  kind: 'no-audit';
@@ -481,6 +573,7 @@ export interface FunctionDeploymentArtifact {
481
573
  name: string;
482
574
  integrationId: string;
483
575
  description: string;
576
+ tags?: FunctionTags | undefined;
484
577
  trigger: FunctionTriggerDefinition;
485
578
  requires: FunctionRequires;
486
579
  capabilities: FunctionCapabilities;
@@ -1,9 +1,12 @@
1
+ import type { FunctionTags } from '../function/config.js';
2
+ import type { ToolTags } from '../function/tool.js';
1
3
  import type { OnEventType } from '../scripts/on-events/api.js';
2
4
  import type { FunctionSource } from '../syncConfigs/db.js';
3
5
  import type { JSONSchema7 } from 'json-schema';
4
6
  /** `tools-catalog` is list/API only — never a DB `FunctionSource`. */
5
7
  export type FunctionListSource = FunctionSource | 'tools-catalog';
6
8
  export type FunctionType = 'action' | 'sync' | 'on-event';
9
+ export type FunctionListType = FunctionType | 'tool';
7
10
  interface NangoFunctionBase {
8
11
  name: string;
9
12
  description?: string;
@@ -40,7 +43,7 @@ export interface FunctionAvailability {
40
43
  }
41
44
  /** A row in a function list. Catalog actions have no deployed row. */
42
45
  export interface ListedFunctionAvailability {
43
- /** Sync-config id. `null` when the function is served from the catalog (no deployed row). */
46
+ /** Sync-config id. `null` when the function is served from the catalog (no deployed row) or is a tool (identified by `uuid`). */
44
47
  id: number | null;
45
48
  enabled: boolean;
46
49
  /** ISO-8601 timestamp. `null` when the function was never deployed. */
@@ -50,7 +53,19 @@ export interface ListedFunctionAvailability {
50
53
  export type ListedNangoSyncFunction = NangoSyncFunction & ListedFunctionAvailability;
51
54
  export type ListedNangoActionFunction = NangoActionFunction & ListedFunctionAvailability;
52
55
  export type ListedNangoOnEventFunction = NangoOnEventFunction & ListedFunctionAvailability;
53
- export type ListedNangoFunction = ListedNangoSyncFunction | ListedNangoActionFunction | ListedNangoOnEventFunction;
56
+ export type ListedNangoToolFunction = NangoFunctionBase & ListedFunctionAvailability & {
57
+ type: 'tool';
58
+ uuid: string;
59
+ integration_id: string;
60
+ provider: string;
61
+ description: string;
62
+ input_json_schema: JSONSchema7 | null;
63
+ output_json_schema: JSONSchema7 | null;
64
+ meta: Pick<ToolTags, 'instructions' | 'required_scopes'> & {
65
+ tags: FunctionTags;
66
+ };
67
+ };
68
+ export type ListedNangoFunction = ListedNangoSyncFunction | ListedNangoActionFunction | ListedNangoOnEventFunction | ListedNangoToolFunction;
54
69
  export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
55
70
  deployed?: FunctionAvailability;
56
71
  };
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export type * from './api.endpoints.js';
4
4
  export type * from './audit-trail/api.js';
5
5
  export type * from './audit-trail/event.js';
6
6
  export type * from './audit-trail/metadata.js';
7
+ export type * from './analytics/catalogue.js';
8
+ export type * from './analytics/taxonomy.js';
7
9
  export type * from './gettingStarted/db.js';
8
10
  export type * from './gettingStarted/dto.js';
9
11
  export type * from './gettingStarted/api.js';
@@ -21,6 +23,7 @@ export type * from './agent/toolSearch.js';
21
23
  export type * from './agent/toolset.js';
22
24
  export type * from './admin/http.api.js';
23
25
  export type * from './account/api.js';
26
+ export type * from './account/acquisition.js';
24
27
  export type * from './account/context.js';
25
28
  export type * from './user/api.js';
26
29
  export type * from './user/db.js';
@@ -97,6 +100,7 @@ export type * from './utils.js';
97
100
  export type * from './web/env.js';
98
101
  export type * from './fleet/api.js';
99
102
  export type * from './fleet/index.js';
103
+ export type * from './internal-auth.js';
100
104
  export type * from './persist/api.js';
101
105
  export type * from './jobs/api.js';
102
106
  export type * from './checkpoint/types.js';
@@ -108,7 +112,9 @@ export type * from './mfa/db.js';
108
112
  export type * from './function/config.js';
109
113
  export type * from './function/db.js';
110
114
  export type * from './function/trigger.js';
115
+ export type * from './function/tool.js';
111
116
  export type * from './functions/api.js';
112
117
  export type * from './functions/domain.js';
113
118
  export type * from './lambda/index.js';
114
119
  export type * from './pubsub/events.js';
120
+ export type { SignupAdvertising } from './account/signupAdvertising.js';
@@ -6,7 +6,7 @@ import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
6
6
  import type { Provider } from '../providers/provider.js';
7
7
  import type { IntegrationConfig } from './db.js';
8
8
  import type { Merge } from 'type-fest';
9
- export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name' | 'forward_webhooks'>, ApiTimestamps> & {
9
+ export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name' | 'forward_webhooks' | 'missing_fields'>, ApiTimestamps> & {
10
10
  logo: string;
11
11
  } & ApiPublicIntegrationInclude;
12
12
  export interface ApiPublicIntegrationInclude {
@@ -371,22 +371,22 @@ export type GetIntegrationFlows = ApiEndpoint<{
371
371
  }>;
372
372
  export type ApiPublicIntegrationCredentials = {
373
373
  type: Extract<AuthModeType, 'OAUTH1' | 'OAUTH2' | 'TBA'>;
374
- client_id: string;
375
- client_secret: string;
374
+ client_id?: string | undefined;
375
+ client_secret?: string | undefined;
376
376
  scopes?: string | undefined;
377
377
  webhook_secret?: string | undefined;
378
378
  } | {
379
379
  type: Extract<AuthModeType, 'APP'>;
380
- app_id: string;
381
- app_link: string;
382
- private_key: string;
380
+ app_id?: string | undefined;
381
+ app_link?: string | undefined;
382
+ private_key?: string | undefined;
383
383
  } | {
384
384
  type: Extract<AuthModeType, 'CUSTOM'>;
385
- client_id: string;
386
- client_secret: string;
387
- app_id: string;
388
- app_link: string;
389
- private_key: string;
385
+ client_id?: string | undefined;
386
+ client_secret?: string | undefined;
387
+ app_id?: string | undefined;
388
+ app_link?: string | undefined;
389
+ private_key?: string | undefined;
390
390
  } | {
391
391
  type: Extract<AuthModeType, 'MCP_OAUTH2_GENERIC'>;
392
392
  client_name?: string | undefined;
@@ -0,0 +1,5 @@
1
+ export interface InternalAuthPublicKey {
2
+ kid: string;
3
+ /** base64url of the raw 32-byte Ed25519 public key. */
4
+ publicKey: string;
5
+ }