@nangohq/types 0.71.7 → 0.71.9

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.
@@ -1,4 +1,5 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
+ import type { AuditPolicy } from '../audit-trail/event.js';
2
3
  import type { Tags } from '../db.js';
3
4
  import type { AgentSessionUnknownPinnedConnectionsPayload } from './connections.js';
4
5
  import type { AgentSessionEndedReason } from './session.js';
@@ -69,10 +70,7 @@ export type AgentSessionCreationErrorCode = 'ambiguous_connections' | 'unknown_p
69
70
  export type AgentSessionCreationErrorPayload = AgentSessionAmbiguousConnectionsReply | AgentSessionUnknownPinnedConnectionsPayload | AgentSessionPinnedConnectionNotMatchedReply | AgentSessionUnknownIntegrationsPayload | AgentSessionUnknownToolsPayload | AgentSessionUnsupportedFunctionTypesPayload | AgentSessionToolsNotInToolsetPayload | AgentSessionUnknownMetaToolsPayload;
70
71
  export type PostAgentSessionsCreationError = ApiError<AgentSessionCreationErrorCode, undefined, AgentSessionCreationErrorPayload>;
71
72
  export type PostAgentSessions = ApiEndpoint<{
72
- Audit: {
73
- kind: 'no-audit';
74
- reason: 'TODO: audit coverage pending';
75
- };
73
+ Audit: AuditPolicy<'agent_session', 'created', 'environment'>;
76
74
  Method: 'POST';
77
75
  Path: '/sessions';
78
76
  Body: PostAgentSessionsBody;
@@ -94,10 +92,7 @@ export interface ApiTerminatedAgentSession {
94
92
  reason: AgentSessionEndedReason;
95
93
  }
96
94
  export type DeleteAgentSession = ApiEndpoint<{
97
- Audit: {
98
- kind: 'no-audit';
99
- reason: 'TODO: audit coverage pending';
100
- };
95
+ Audit: AuditPolicy<'agent_session', 'terminated', 'environment'>;
101
96
  Method: 'DELETE';
102
97
  Path: '/sessions/:sessionId';
103
98
  Params: {
@@ -18,6 +18,7 @@ export interface AgentSessionResolvedConnection {
18
18
  readonly configId: number;
19
19
  }
20
20
  export type AgentSessionResolvedConnections = Record<string, AgentSessionResolvedConnection>;
21
+ export type AgentSessionResolvedConnectionSummary = Omit<AgentSessionResolvedConnection, 'internalConnectionId' | 'configId'>;
21
22
  export type AgentSessionConnectionResolutionErrorCode = 'ambiguous_connections' | 'pinned_connection_not_matched' | 'unknown_pinned_connection';
22
23
  export interface AgentSessionConnectionCandidateReport {
23
24
  readonly connection_id: string;
@@ -18,6 +18,11 @@ export interface AgentSessionCompiledIntegration {
18
18
  readonly searchable: AgentSessionCompiledTool[];
19
19
  }
20
20
  export type AgentSessionCompiledToolset = Record<string, AgentSessionCompiledIntegration>;
21
+ export interface AgentSessionToolNames {
22
+ readonly provider: string;
23
+ readonly pinned: string[];
24
+ readonly searchable: string[];
25
+ }
21
26
  export type AgentSessionToolsetCompilationErrorCode = 'unknown_integration' | 'unknown_tool' | 'unsupported_function_type' | 'tool_not_in_toolset';
22
27
  export interface AgentSessionUnknownIntegrationsPayload {
23
28
  readonly integrations: string[];
@@ -1,4 +1,4 @@
1
- import type { 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, 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';
@@ -87,6 +87,10 @@ interface AuditEventTable {
87
87
  exported: AuditTrailFiltersMetadata;
88
88
  queried: AuditTrailQueriedMetadata;
89
89
  };
90
+ agent_session: {
91
+ created: AgentSessionCreatedMetadata;
92
+ terminated: never;
93
+ };
90
94
  }
91
95
  export type AuditResource = keyof AuditEventTable;
92
96
  export type AuditActionOf<R extends AuditResource> = R extends AuditResource ? keyof AuditEventTable[R] & string : never;
@@ -97,7 +101,7 @@ export type AuditEventKey = {
97
101
  /** The metadata an action may carry. `never` for the actions that carry none. */
98
102
  export type AuditMetadataFor<R extends AuditResource, A> = A extends keyof AuditEventTable[R] ? AuditEventTable[R][A] : never;
99
103
  export type AuditScope = 'account' | 'environment';
100
- export type AuditTargetType = 'connection' | 'sync' | 'function' | 'integration' | 'api_key' | 'member' | 'team' | 'user' | 'environment';
104
+ export type AuditTargetType = 'connection' | 'sync' | 'function' | 'integration' | 'api_key' | 'member' | 'team' | 'user' | 'environment' | 'agent_session';
101
105
  export interface AuditActor {
102
106
  type: AuditActorType;
103
107
  id: string;
@@ -97,3 +97,6 @@ export interface MfaVerifiedMetadata {
97
97
  export interface BillingSpendAlertChangedMetadata {
98
98
  thresholdInCents?: number;
99
99
  }
100
+ export interface AgentSessionCreatedMetadata {
101
+ expiresAt?: string;
102
+ }
@@ -1,7 +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 { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
4
+ import type { FunctionType, ListedNangoFunction, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
5
5
  import type { JSONSchema7 } from 'json-schema';
6
6
  export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
7
7
  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';
@@ -262,15 +262,15 @@ export interface FunctionListFilters {
262
262
  limit?: number;
263
263
  }
264
264
  export interface FunctionListSuccess {
265
- data: DeployedNangoFunction[];
265
+ data: ListedNangoFunction[];
266
266
  pagination: {
267
267
  total: number;
268
268
  page: number;
269
269
  limit: number;
270
270
  };
271
271
  }
272
- export interface DeployedFunctionSuccess {
273
- data: DeployedNangoFunction;
272
+ export interface ListedFunctionSuccess {
273
+ data: ListedNangoFunction;
274
274
  }
275
275
  export interface FunctionDeletionSuccess {
276
276
  data: {
@@ -310,7 +310,7 @@ export type GetIntegrationFunction = ApiEndpoint<{
310
310
  providerConfigKey: string;
311
311
  functionName: string;
312
312
  };
313
- Success: DeployedFunctionSuccess;
313
+ Success: ListedFunctionSuccess;
314
314
  }>;
315
315
  export type DeleteIntegrationFunction = ApiEndpoint<{
316
316
  Audit: AuditPolicy<'function', 'deleted', 'environment'>;
@@ -370,7 +370,7 @@ export type GetPublicIntegrationFunction = ApiEndpoint<{
370
370
  uniqueKey: string;
371
371
  name: string;
372
372
  };
373
- Success: DeployedFunctionSuccess;
373
+ Success: ListedFunctionSuccess;
374
374
  }>;
375
375
  export type DeletePublicIntegrationFunction = ApiEndpoint<{
376
376
  Audit: AuditPolicy<'function', 'deleted', 'environment'>;
@@ -28,18 +28,18 @@ export interface NangoOnEventFunction extends NangoFunctionBase {
28
28
  event: OnEventType;
29
29
  }
30
30
  export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
31
- export interface DeployedMeta {
31
+ export interface FunctionAvailability {
32
32
  id: number;
33
33
  enabled: boolean;
34
34
  /** ISO-8601 timestamp. */
35
35
  last_deployed: string;
36
36
  source: FunctionSource;
37
37
  }
38
- export type DeployedNangoSyncFunction = NangoSyncFunction & DeployedMeta;
39
- export type DeployedNangoActionFunction = NangoActionFunction & DeployedMeta;
40
- export type DeployedNangoOnEventFunction = NangoOnEventFunction & DeployedMeta;
41
- export type DeployedNangoFunction = DeployedNangoSyncFunction | DeployedNangoActionFunction | DeployedNangoOnEventFunction;
38
+ export type ListedNangoSyncFunction = NangoSyncFunction & FunctionAvailability;
39
+ export type ListedNangoActionFunction = NangoActionFunction & FunctionAvailability;
40
+ export type ListedNangoOnEventFunction = NangoOnEventFunction & FunctionAvailability;
41
+ export type ListedNangoFunction = ListedNangoSyncFunction | ListedNangoActionFunction | ListedNangoOnEventFunction;
42
42
  export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
43
- deployed?: DeployedMeta;
43
+ deployed?: FunctionAvailability;
44
44
  };
45
45
  export {};
@@ -239,6 +239,7 @@ export interface MCPOAuth2GenericAuthBody {
239
239
  clientName?: string | undefined;
240
240
  clientUri?: string | undefined;
241
241
  clientLogoUri?: string | undefined;
242
+ scopes?: string | undefined;
242
243
  }
243
244
  export interface InstallPluginAuthBody {
244
245
  authType: Extract<AuthModeType, 'INSTALL_PLUGIN'>;
@@ -24,6 +24,7 @@ export type SearchOperations = ApiEndpoint<{
24
24
  integrations?: SearchOperationsIntegration[] | undefined;
25
25
  connections?: SearchOperationsConnection[] | undefined;
26
26
  syncs?: SearchOperationsSync[] | undefined;
27
+ agentSessions?: SearchOperationsAgentSession[] | undefined;
27
28
  period?: SearchPeriod | undefined;
28
29
  cursor?: string | null | undefined;
29
30
  };
@@ -40,6 +41,7 @@ export type SearchOperationsType = 'all' | ConcatOperationListWithGroup;
40
41
  export type SearchOperationsIntegration = 'all' | string;
41
42
  export type SearchOperationsConnection = 'all' | string;
42
43
  export type SearchOperationsSync = 'all' | string;
44
+ export type SearchOperationsAgentSession = 'all' | string;
43
45
  export interface SearchPeriod {
44
46
  from: string;
45
47
  to: string;
@@ -102,7 +104,7 @@ export type SearchFilters = ApiEndpoint<{
102
104
  env: string;
103
105
  };
104
106
  Body: {
105
- category: 'integration' | 'syncConfig' | 'connection';
107
+ category: SearchFiltersCategory;
106
108
  search?: string | undefined;
107
109
  };
108
110
  Success: {
@@ -112,6 +114,7 @@ export type SearchFilters = ApiEndpoint<{
112
114
  }[];
113
115
  };
114
116
  }>;
117
+ export type SearchFiltersCategory = 'integration' | 'syncConfig' | 'connection' | 'agentSession';
115
118
  export type SearchFiltersData = SearchMessages['Success']['data'][0];
116
119
  export type PostInsights = ApiEndpoint<{
117
120
  Audit: {
@@ -58,7 +58,7 @@ export interface OperationDeploy {
58
58
  }
59
59
  export interface OperationAgentSession {
60
60
  type: 'agent_session';
61
- action: 'create' | 'terminate';
61
+ action: 'create' | 'terminate' | 'tool_search';
62
62
  }
63
63
  export type OperationList = OperationFunction | OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationOnEvents | OperationDeploy | OperationAuth | OperationAdmin | OperationAgentSession;
64
64
  /**
@@ -12,6 +12,7 @@ export interface DBPlan extends Timestamps {
12
12
  orb_future_plan_at: Date | null;
13
13
  orb_subscribed_at: Date | null;
14
14
  has_growth_features: boolean;
15
+ growth_features_starts_at: Date | null;
15
16
  growth_features_ends_at: Date | null;
16
17
  trial_start_at: Date | null;
17
18
  trial_end_at: Date | null;
@@ -61,6 +62,11 @@ export interface DBPlan extends Timestamps {
61
62
  * @default null
62
63
  */
63
64
  function_logs_max: number | null;
65
+ /** Limit the amount of billable data transfer (in bytes) that can be used in a month
66
+ * Set to null to remove limit
67
+ * @default null
68
+ */
69
+ data_transfer_max: number | null;
64
70
  /**
65
71
  * Limit the number of environments that can be created
66
72
  * @default 2
@@ -141,6 +141,7 @@ export interface ProviderMcpOAUTH2 extends Omit<BaseProvider, 'body_format'> {
141
141
  }
142
142
  export interface ProviderMcpOAuth2Generic extends Omit<BaseProvider, 'body_format'> {
143
143
  auth_mode: 'MCP_OAUTH2_GENERIC';
144
+ mcp_server_url?: string;
144
145
  }
145
146
  export interface ProviderJwt extends BaseProvider {
146
147
  auth_mode: 'JWT';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.71.7",
3
+ "version": "0.71.9",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",