@nangohq/types 0.71.13 → 0.72.0

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.
@@ -60,7 +60,7 @@ export type PostSignup = ApiEndpoint<{
60
60
  foundUs?: string | undefined;
61
61
  acquisition?: SignupAcquisition | undefined;
62
62
  };
63
- Error: ApiError<'email_already_verified'> | ApiError<'error_creating_user'> | ApiError<'user_already_exists'> | ApiError<'error_creating_account'> | ApiError<'not_found'> | ApiError<'email_not_verified'>;
63
+ Error: ApiError<'email_already_verified'> | ApiError<'error_creating_user'> | ApiError<'user_already_exists'> | ApiError<'error_creating_account'> | ApiError<'not_found'> | ApiError<'email_not_verified'> | ApiError<'disposable_email'>;
64
64
  Success: {
65
65
  data: {
66
66
  uuid: string;
@@ -0,0 +1,8 @@
1
+ /** Optional ad matching context on the existing new-account event. Never a group property. */
2
+ export interface SignupAdvertising {
3
+ advertising_consent_method: 'explicit' | 'implied';
4
+ advertising_consent_timestamp: string;
5
+ advertising_oppref_click_timestamp?: string;
6
+ advertising_fbc?: string;
7
+ advertising_oppref?: string;
8
+ }
@@ -28,7 +28,7 @@ export type PostPublicTriggerAction = ApiEndpoint<{
28
28
  Path: '/action/trigger';
29
29
  Body: {
30
30
  action_name: string;
31
- input: unknown;
31
+ input?: unknown;
32
32
  };
33
33
  Headers: {
34
34
  'provider-config-key': string;
@@ -38,15 +38,15 @@ export type PostPublicTriggerAction = ApiEndpoint<{
38
38
  };
39
39
  Success: any;
40
40
  }>;
41
- export type PostInternalTriggerFunction = ApiEndpoint<{
41
+ export type PostInternalInvokeFunction = ApiEndpoint<{
42
42
  Audit: {
43
43
  kind: 'no-audit';
44
- reason: 'non-auditable';
44
+ reason: 'data-plane operation';
45
45
  };
46
46
  Method: 'POST';
47
- Path: '/api/v1/trigger/function';
47
+ Path: '/api/v1/functions/invoke';
48
48
  Body: {
49
- type: 'action' | 'sync';
49
+ type: 'action' | 'sync' | 'tool';
50
50
  function_name: string;
51
51
  provider_config_key: string;
52
52
  connection_id: string;
@@ -1,4 +1,5 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
+ import type { PostAgentSessionsBody } from './api.js';
2
3
  export interface AgentPlaygroundUsage {
3
4
  inputTokens: number;
4
5
  outputTokens: number;
@@ -8,16 +9,34 @@ export interface AgentPlaygroundIntegrationSetup {
8
9
  integrationId?: string;
9
10
  outcome: 'created' | 'existing' | 'missing_credentials' | 'not_created';
10
11
  }
12
+ export type AgentPlaygroundSessionChange = 'integrations_changed' | 'connections_changed';
13
+ export interface AgentPlaygroundSessionCreated {
14
+ request: PostAgentSessionsBody;
15
+ reason?: AgentPlaygroundSessionChange | 'expired';
16
+ }
11
17
  export interface AgentPlaygroundMessageMetadata {
12
18
  sessionId?: string;
13
- sessionExpiresAt?: string;
14
19
  hidden?: boolean;
15
20
  connectedIntegrations?: string[];
16
21
  starterProvider?: string;
17
22
  integrationSetup?: AgentPlaygroundIntegrationSetup;
23
+ sessionCreated?: AgentPlaygroundSessionCreated;
18
24
  usage?: AgentPlaygroundUsage;
25
+ replyOutcome?: AgentPlaygroundReplyOutcome;
26
+ }
27
+ export type AgentPlaygroundReplyOutcome = {
28
+ kind: 'stopped';
29
+ } | {
30
+ kind: 'failed';
31
+ error: string;
32
+ };
33
+ export type AgentPlaygroundErrorCode = 'feature_disabled' | 'session_creation_failed' | 'model_error' | 'model_unavailable' | 'too_many_request';
34
+ export interface AgentPlaygroundModelUnavailableError {
35
+ error: {
36
+ code: 'model_unavailable';
37
+ retryable: boolean;
38
+ };
19
39
  }
20
- export type AgentPlaygroundErrorCode = 'feature_disabled' | 'session_creation_failed' | 'model_error' | 'too_many_request';
21
40
  export type PostAgentPlaygroundChat = ApiEndpoint<{
22
41
  Audit: {
23
42
  kind: 'no-audit';
@@ -30,6 +49,7 @@ export type PostAgentPlaygroundChat = ApiEndpoint<{
30
49
  };
31
50
  Body: {
32
51
  sessionId?: string | undefined;
52
+ chatId?: string | undefined;
33
53
  messages: unknown[];
34
54
  timeZone?: string | undefined;
35
55
  };
@@ -15,6 +15,16 @@ export interface AgentSessionMetaTools {
15
15
  readonly nangoProxy: boolean;
16
16
  readonly nangoCreateConnection: AgentSessionCreateConnectionConfig;
17
17
  }
18
+ /** Nango's own tools, as opposed to the integration tools an account deploys. */
19
+ export type AgentSessionMetaTool = 'nango_execute' | 'nango_proxy' | 'nango_tool_search' | 'nango_create_connection';
20
+ /** One ranked tool, as the search returned it. Confidence runs from 0, nothing matched, to 1. */
21
+ export interface AgentSessionToolSearchHit {
22
+ tool_name: string;
23
+ /** The name the agent was given for it, which collisions make impossible to derive afterwards. */
24
+ tool_slug: string;
25
+ integration_id: string;
26
+ confidence: number;
27
+ }
18
28
  export type AgentSessionEndedReason = 'terminated' | 'expired';
19
29
  export interface AgentSession {
20
30
  readonly id: string;