@nangohq/types 0.70.8 → 0.71.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.
@@ -1,3 +1,3 @@
1
- export declare const API_KEY_SCOPES: readonly ["environment:*", "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:integrations:*", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connections:*", "environment:connect_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:syncs:*", "environment:functions:list", "environment:functions:read", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:*", "environment:deploy", "environment:records:read", "environment:records:write", "environment:records:*", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
1
+ export declare const API_KEY_SCOPES: readonly ["environment:*", "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:integrations:*", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connections:*", "environment:connect_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:syncs:*", "environment:functions:list", "environment:functions:read", "environment:functions:delete", "environment:functions:compile", "environment:functions:dryrun", "environment:functions:*", "environment:deploy", "environment:records:read", "environment:records:write", "environment:records:*", "environment:logs:read", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
2
2
  export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
3
3
  export declare const ALL_SCOPES: string[];
@@ -3,10 +3,12 @@ import type { GetAsyncActionResult, GetPublicV1, PostInternalTriggerFunction, Po
3
3
  import type { PostImpersonate } from './admin/http.api.js';
4
4
  import type { EndpointMethod } from './api.js';
5
5
  import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicAwsSigV4Authorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
6
+ import type { PostCliTelemetry } from './cli/api.js';
7
+ import type { GetPublicClientMetadata } from './clientMetadata/http.api.js';
6
8
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
7
- import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
8
- import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
9
+ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchConnection, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
9
10
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
11
+ import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
10
12
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
11
13
  import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, GetEnvironments, ListApiKeys, PatchApiKey, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
12
14
  import type { PatchWebhook } from './environment/api/webhook.js';
@@ -14,7 +16,7 @@ import type { PostEnvironmentVariables } from './environment/variable/api.js';
14
16
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
15
17
  import type { DeleteIntegrationFunction, DeletePublicIntegrationFunction, GetFunctionDeployment, GetFunctionDryrun, GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, GetPublicIntegrationFunction, GetPublicIntegrationFunctions, GetPublicProviderTemplates, PostFunctionCompile, PostFunctionDeployment, PostFunctionDeploymentResult, PostFunctionDryrun, PostFunctionDryrunResult } from './functions/api.js';
16
18
  import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
17
- import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
19
+ import type { DeleteIntegration, DeletePublicIntegration, GetFunctionCode, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
18
20
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
19
21
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
20
22
  import type { GetMeta } from './meta/api.js';
@@ -29,8 +31,8 @@ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, Pos
29
31
  import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
30
32
  import type { GetUser, PatchUser, PutUserPassword } from './user/api.js';
31
33
  import type { PostPublicWebhook } from './webhooks/http.api.js';
32
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicAwsSigV4Authorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostFunctionCompile | PostFunctionDryrun | GetFunctionDryrun | PostFunctionDryrunResult | PostFunctionDeployment | GetFunctionDeployment | PostFunctionDeploymentResult | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | AllPublicProxy;
33
- export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetBillingUsage | GetBillingUsageTopDimensionValues | GetUser | PatchUser | PutUserPassword | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | GetIntegrationFunction | GetIntegrationFunctions | DeleteIntegrationFunction | GetIntegrationTemplates | GetProviderTemplates | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetConnectionRecordModels | GetConnectionRecords | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetPlainHmac;
34
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | 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 | GetPublicFunctionCode | GetPublicIntegrationFunctions | GetPublicIntegrationFunction | DeletePublicIntegrationFunction | GetPublicProviderTemplates | AllPublicProxy;
35
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetBillingUsage | GetBillingUsageTopDimensionValues | 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 | GetConnectionRecordModels | GetConnectionRecords | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PatchConnection | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction | GetPlainHmac;
34
36
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
35
37
  /**
36
38
  * Automatically narrow endpoints type with Method + Path
@@ -80,6 +80,7 @@ export interface BreakdownDimensions {
80
80
  webhook_forwards: 'environment_id' | 'integration_id' | 'connection_id' | 'success';
81
81
  records: 'environment_id' | 'integration_id' | 'connection_id' | 'model';
82
82
  connections: 'environment_id' | 'integration_id';
83
+ data_transfer: 'environment_id' | 'integration_id' | 'connection_id' | 'package' | 'callsite';
83
84
  }
84
85
  export type DimensionFor<M extends UsageMetric> = 'none' | BreakdownDimensions[M];
85
86
  export interface GetBillingUsageOpts {
@@ -93,10 +94,9 @@ export interface GetBillingUsageOpts {
93
94
  group_by?: 'environmentId' | 'environmentName' | 'integrationId' | 'type' | 'functionName' | 'model';
94
95
  };
95
96
  /**
96
- * Per-request override of the dashboard backend source. Honoured only
97
- * when `FLAG_ALLOW_OVERRIDE_GETUSAGE_SERVICE` is enabled (dev gate); ignored
98
- * everywhere else, so the default stays Orb. Only used by
99
- * `UsageTracker.getBillingUsage`; the Orb client itself ignores it.
97
+ * Dev-only escape hatch: pins the request to Orb for parity checks.
98
+ * Honoured only when `FLAG_ALLOW_OVERRIDE_GETUSAGE_SERVICE` is enabled;
99
+ * ignored everywhere else. Default is ClickHouse.
100
100
  */
101
101
  source?: 'clickhouse' | 'orb';
102
102
  /**
@@ -120,9 +120,11 @@ export interface GetBillingUsageOpts {
120
120
  metrics?: UsageMetric[];
121
121
  /**
122
122
  * Per-metric row-level filter: scopes that metric's response to rows
123
- * where the given dimension equals the given value. Mutually exclusive
124
- * with `breakdown[<metric>]` on the same metric — controllers reject
125
- * the combination. CH path only; the Orb client ignores it.
123
+ * where the given dimension equals the given value. Composes with
124
+ * `breakdown[<metric>]` on the same metric when the dimensions differ
125
+ * (drill-in: filter to one value, re-break-down by another); controllers
126
+ * reject only the same-dimension pairing. CH path only; the Orb client
127
+ * ignores it.
126
128
  */
127
129
  filter?: {
128
130
  [M in UsageMetric]?: {
@@ -159,11 +161,11 @@ export interface BillingUsageMetric {
159
161
  * dimension-value series (carrying its own `group: {key, value}`), with
160
162
  * one 'rest' entry aggregating the long tail.
161
163
  *
162
- * Mutually exclusive with the top-level `usage`/`total`: when breakdown
163
- * is requested the top-level is empty (`usage: []`, `total: 0`) and only
164
- * `breakdown` carries data — callers asking for a breakdown opt into the
165
- * per-dim view. When breakdown is NOT requested, the top-level is the
166
- * no-dim global and this field is absent.
164
+ * Paired with the top-level `usage`/`total`: when a breakdown is requested
165
+ * the top-level `usage` is empty (the per-day points live under `breakdown`)
166
+ * and `total` is the sum across the top-N + 'rest' series, which partition
167
+ * every row — so it equals the (filtered) global. When breakdown is NOT
168
+ * requested, the top-level is the no-dim global and this is absent.
167
169
  */
168
170
  breakdown?: BillingUsageMetric[];
169
171
  }
@@ -0,0 +1,12 @@
1
+ import type { Endpoint } from '../api.js';
2
+ export type CliTelemetryEvent = '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
+ export type PostCliTelemetry = Endpoint<{
4
+ Method: 'POST';
5
+ Path: '/cli/telemetry';
6
+ Body: {
7
+ deviceId: string;
8
+ event: CliTelemetryEvent;
9
+ ephemeral?: boolean;
10
+ };
11
+ Success: never;
12
+ }>;
@@ -0,0 +1,20 @@
1
+ import type { ApiError, Endpoint } from '../api.js';
2
+ export type GetPublicClientMetadata = Endpoint<{
3
+ Method: 'GET';
4
+ Path: '/oauth/client-metadata/:environmentUuid/:providerConfigKey';
5
+ Params: {
6
+ environmentUuid: string;
7
+ providerConfigKey: string;
8
+ };
9
+ Error: ApiError<'unknown_environment'> | ApiError<'unknown_provider_config'>;
10
+ Success: {
11
+ client_id: string;
12
+ client_name: string;
13
+ client_uri: string;
14
+ logo_uri?: string;
15
+ redirect_uris: string[];
16
+ grant_types: string[];
17
+ response_types: string[];
18
+ token_endpoint_auth_method: 'none';
19
+ };
20
+ }>;
@@ -9,6 +9,7 @@ export interface ConnectSessionInput {
9
9
  connection_config?: {
10
10
  [key: string]: unknown;
11
11
  oauth_scopes_override?: string | undefined;
12
+ webhook_url?: string | undefined;
12
13
  } | undefined;
13
14
  }> | undefined;
14
15
  end_user: EndUserInput;
@@ -7,7 +7,7 @@ import type { ActiveLog } from '../../notification/active-logs/db.js';
7
7
  import type { ReplaceInObject } from '../../utils.js';
8
8
  import type { ConnectionConfig, DBConnection, DBConnectionDecrypted } from '../db.js';
9
9
  import type { Merge } from 'type-fest';
10
- export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id' | 'connection_id' | 'provider_config_key' | 'created_at' | 'updated_at'> & {
10
+ export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id' | 'config_id' | 'connection_id' | 'provider_config_key' | 'created_at' | 'updated_at'> & {
11
11
  provider: string;
12
12
  errors: {
13
13
  type: string;
@@ -163,11 +163,32 @@ export type PatchPublicConnection = Endpoint<{
163
163
  Body: {
164
164
  end_user?: EndUserInput | undefined;
165
165
  tags?: Tags | undefined;
166
+ webhook_url?: string | undefined;
166
167
  };
167
168
  Success: {
168
169
  success: boolean;
169
170
  };
170
- Error: ApiError<'unknown_provider_config'>;
171
+ Error: ApiError<'unknown_provider_config' | 'not_found' | 'server_error' | 'invalid_body'>;
172
+ }>;
173
+ export type PatchConnection = Endpoint<{
174
+ Method: 'PATCH';
175
+ Path: '/api/v1/connections/:connectionId';
176
+ Params: {
177
+ connectionId: string;
178
+ };
179
+ Querystring: {
180
+ provider_config_key: string;
181
+ env: string;
182
+ };
183
+ Body: {
184
+ end_user?: EndUserInput | undefined;
185
+ tags?: Tags | undefined;
186
+ webhook_url?: string | undefined;
187
+ };
188
+ Success: {
189
+ success: boolean;
190
+ };
191
+ Error: ApiError<'unknown_provider_config' | 'not_found' | 'server_error' | 'invalid_body'>;
171
192
  }>;
172
193
  export type PostConnectionRefresh = Endpoint<{
173
194
  Method: 'POST';
@@ -11,6 +11,7 @@ export interface ConnectionConfig {
11
11
  oauth_scopes_override?: string[] | undefined;
12
12
  oauth_scopes?: string | undefined;
13
13
  authorization_params?: Record<string, string> | undefined;
14
+ webhook_url?: string | undefined;
14
15
  }
15
16
  export interface DBConnection extends TimestampsAndDeletedCorrect {
16
17
  id: number;
@@ -55,7 +56,7 @@ export interface FailedConnectionError {
55
56
  description: string;
56
57
  }
57
58
  export interface RecentlyFailedConnection {
58
- connection: DBConnection | Pick<DBConnection, 'connection_id' | 'provider_config_key'>;
59
+ connection: DBConnection | Pick<DBConnection, 'connection_id' | 'provider_config_key' | 'connection_config'>;
59
60
  auth_mode: AuthModeType;
60
61
  error?: FailedConnectionError;
61
62
  operation: AuthOperationType;
@@ -1,8 +1,8 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
- import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
3
- import type { SyncDeploymentResult } from './index.js';
4
2
  import type { OnEventType } from '../scripts/on-events/api.js';
5
3
  import type { FunctionSource } from '../syncConfigs/db.js';
4
+ import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
5
+ import type { SyncDeploymentResult } from './index.js';
6
6
  import type { JSONSchema7 } from 'json-schema';
7
7
  export type PostDeployConfirmation = Endpoint<{
8
8
  Method: 'POST';
@@ -27,7 +27,6 @@ export type PostPreBuiltDeploy = Endpoint<{
27
27
  env: string;
28
28
  };
29
29
  Body: {
30
- provider: string;
31
30
  providerConfigKey: string;
32
31
  scriptName: string;
33
32
  type: ScriptTypeLiteral;
@@ -68,7 +68,7 @@ export type FunctionDryrunResultBody = {
68
68
  payload?: unknown;
69
69
  };
70
70
  };
71
- export interface FunctionDeploymentBody {
71
+ export interface FunctionDeploymentCodeBody {
72
72
  type: 'function';
73
73
  integration_id: string;
74
74
  function_name: string;
@@ -77,9 +77,24 @@ export interface FunctionDeploymentBody {
77
77
  version?: string | undefined;
78
78
  allow_destructive?: boolean | undefined;
79
79
  }
80
+ export interface FunctionDeploymentTemplateBody {
81
+ type: 'template';
82
+ integration_id: string;
83
+ template: string;
84
+ /** Optional; inferred from the template name unless a sync and an action share it. */
85
+ function_type?: RunnableFunctionType | undefined;
86
+ }
87
+ export interface FunctionDeploymentTemplateStoredRequest {
88
+ type: 'template';
89
+ integration_id: string;
90
+ template: string;
91
+ function_name: string;
92
+ function_type: RunnableFunctionType;
93
+ }
94
+ export type FunctionDeploymentBody = FunctionDeploymentCodeBody | FunctionDeploymentTemplateBody;
80
95
  export interface FunctionDeploymentCreateSuccess {
81
96
  id: string;
82
- status: Extract<FunctionDeploymentStatus, 'waiting' | 'running'>;
97
+ status: FunctionDeploymentStatus;
83
98
  created_at: string;
84
99
  }
85
100
  export interface FunctionDeploymentResultSuccess {
@@ -154,7 +169,7 @@ export type PostFunctionDeployment = Endpoint<{
154
169
  Method: 'POST';
155
170
  Path: '/functions/deployments';
156
171
  Body: FunctionDeploymentBody;
157
- Error: ApiError<FunctionErrorCode>;
172
+ Error: ApiError<FunctionErrorCode> | ApiError<'template_not_found' | 'ambiguous_function' | 'plan_limit' | 'template_already_deployed'>;
158
173
  Success: FunctionDeploymentCreateSuccess;
159
174
  }>;
160
175
  export type GetFunctionDeployment = Endpoint<{
@@ -0,0 +1,7 @@
1
+ export interface FunctionCapabilities {
2
+ usesRecords: boolean;
3
+ usesCheckpoints: boolean;
4
+ usesMetadata: boolean;
5
+ usesOutbound: boolean;
6
+ usesInvoke: boolean;
7
+ }
@@ -1,5 +1,5 @@
1
- import type { GettingStartedOutput as GettingStartedProgressOutput, PatchGettingStartedInput as PatchGettingStartedProgressInput } from './dto.js';
2
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ import type { GettingStartedOutput as GettingStartedProgressOutput, PatchGettingStartedInput as PatchGettingStartedProgressInput } from './dto.js';
3
3
  export type GetGettingStarted = Endpoint<{
4
4
  Method: 'GET';
5
5
  Path: '/api/v1/getting-started';
@@ -1,7 +1,7 @@
1
- import type { DBGettingStartedMeta, DBGettingStartedProgress } from './db.js';
2
1
  import type { DBConnection } from '../connection/db.js';
3
2
  import type { DBEnvironment } from '../environment/db.js';
4
3
  import type { IntegrationConfig } from '../integration/db.js';
4
+ import type { DBGettingStartedMeta, DBGettingStartedProgress } from './db.js';
5
5
  export interface GettingStartedOutput {
6
6
  meta: {
7
7
  environment: Pick<DBEnvironment, 'id' | 'name'>;
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ export type * from './deploy/api.js';
55
55
  export type * from './deploy/index.js';
56
56
  export type * from './deploy/incomingFlow.js';
57
57
  export type * from './endpoints/db.js';
58
+ export type * from './cli/api.js';
58
59
  export type * from './connect/api.js';
59
60
  export type * from './connect/session.js';
60
61
  export type * from './endUser/index.js';
@@ -77,6 +78,7 @@ export type * from './environment/variable/api.js';
77
78
  export type * from './webhooks/api.js';
78
79
  export type * from './webhooks/dispatch.js';
79
80
  export type * from './webhooks/http.api.js';
81
+ export type * from './clientMetadata/http.api.js';
80
82
  export type * from './flow/http.api.js';
81
83
  export type * from './flow/index.js';
82
84
  export type * from './utils.js';
@@ -89,6 +91,7 @@ export type * from './checkpoint/types.js';
89
91
  export type * from './checkpoint/db.js';
90
92
  export type * from './mcp/api.js';
91
93
  export type * from './functions/api.js';
94
+ export type * from './functions/capabilities.js';
92
95
  export type * from './functions/domain.js';
93
96
  export type * from './lambda/index.js';
94
97
  export type * from './authz/types.js';
@@ -1,9 +1,9 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
- import type { IntegrationConfig } from './db.js';
3
- import type { AuthModeType, AuthModes } from '../auth/api.js';
2
+ import type { AuthModes, AuthModeType } from '../auth/api.js';
4
3
  import type { NangoSyncConfig } from '../flow/index.js';
5
4
  import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
6
5
  import type { Provider } from '../providers/provider.js';
6
+ import type { IntegrationConfig } from './db.js';
7
7
  import type { Merge } from 'type-fest';
8
8
  export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name' | 'forward_webhooks'>, ApiTimestamps> & {
9
9
  logo: string;
@@ -131,6 +131,28 @@ export type GetPublicFunctionCode = Endpoint<{
131
131
  }[];
132
132
  }>;
133
133
  }>;
134
+ export type GetFunctionCode = Endpoint<{
135
+ Method: 'GET';
136
+ Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName/code';
137
+ Params: {
138
+ providerConfigKey: string;
139
+ functionName: string;
140
+ };
141
+ Querystring: {
142
+ env: string;
143
+ type?: ScriptTypeLiteral | undefined;
144
+ };
145
+ Success: {
146
+ type: ScriptTypeLiteral;
147
+ code: string;
148
+ };
149
+ Error: ApiError<'not_found'> | ApiError<'ambiguous_function', undefined, {
150
+ matches: {
151
+ type: ScriptTypeLiteral;
152
+ name: string;
153
+ }[];
154
+ }>;
155
+ }>;
134
156
  export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
135
157
  export type ApiIntegrationList = ApiIntegration & {
136
158
  meta: {
@@ -231,6 +253,7 @@ export type GetIntegration = Endpoint<{
231
253
  data: {
232
254
  integration: ApiIntegration;
233
255
  template: Provider;
256
+ symLinkTargetName: string | null;
234
257
  meta: {
235
258
  connectionsCount: number;
236
259
  webhookUrl: string | null;
package/dist/mcp/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
- export type PostMcp = Endpoint<{
2
+ export type PostConnectionToolsMcp = Endpoint<{
3
3
  Method: 'POST';
4
4
  Path: '/mcp';
5
5
  Body: Record<string, unknown>;
@@ -10,7 +10,18 @@ export type PostMcp = Endpoint<{
10
10
  Success: Record<string, unknown>;
11
11
  Error: ApiError<'missing_connection_id' | 'unknown_connection'>;
12
12
  }>;
13
- export type GetMcp = Endpoint<{
13
+ export type GetConnectionToolsMcp = Endpoint<{
14
+ Method: 'GET';
15
+ Path: '/mcp';
16
+ Success: Record<string, unknown>;
17
+ }>;
18
+ export type PostControlPlaneMcp = Endpoint<{
19
+ Method: 'POST';
20
+ Path: '/mcp';
21
+ Body: Record<string, unknown>;
22
+ Success: Record<string, unknown>;
23
+ }>;
24
+ export type GetControlPlaneMcp = Endpoint<{
14
25
  Method: 'GET';
15
26
  Path: '/mcp';
16
27
  Success: Record<string, unknown>;
@@ -6,11 +6,6 @@ export type HTTP_METHOD = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
6
6
  export type SyncTypeLiteral = 'incremental' | 'full';
7
7
  export type ScriptFileType = 'actions' | 'syncs' | 'on-events' | 'functions' | 'webhooks' | 'post-connection-scripts';
8
8
  export type ScriptTypeLiteral = 'action' | 'sync' | 'on-event';
9
- /**
10
- * The `function` primitive is authored via `createFunction()` / `createWebhook()`. It is tracked
11
- * separately from {@link ScriptTypeLiteral} (sync/action/on-event) while it is introduced additively.
12
- */
13
- export type FunctionScriptTypeLiteral = 'function';
14
9
  export interface NangoYamlV1 {
15
10
  integrations: Record<string, Record<string, NangoYamlV1Integration>>;
16
11
  models: NangoYamlModel;
@@ -81,7 +76,6 @@ export interface NangoYamlParsedIntegration {
81
76
  providerConfigKey: string;
82
77
  syncs: ParsedNangoSync[];
83
78
  actions: ParsedNangoAction[];
84
- functions: ParsedNangoFunction[];
85
79
  onEventScripts: Record<OnEventType, string[]>;
86
80
  /**
87
81
  * @deprecated
@@ -107,47 +101,6 @@ export interface ParsedNangoSync {
107
101
  json_schema?: JSONSchema7 | undefined;
108
102
  features?: Feature[] | undefined;
109
103
  }
110
- /** Serializable view of a function trigger (the executable hooks live in the deployed file body). */
111
- export interface ParsedFunctionTrigger {
112
- type: 'http' | 'schedule' | 'event';
113
- /** http trigger: maps to the URL path segment. */
114
- name?: string;
115
- /** http trigger: 'integration' (default) or 'connection' for tokenized per-connection URLs. */
116
- scope?: 'integration' | 'connection';
117
- /** schedule trigger. */
118
- schedule?: string;
119
- /** event trigger. */
120
- event?: string;
121
- /** Whether ingress coalescing is configured (the window/key config). */
122
- debounce?: {
123
- key?: {
124
- body: string;
125
- } | {
126
- header: string;
127
- };
128
- windowMs: number;
129
- maxWindowMs?: number;
130
- maxEntities?: number;
131
- payloadMode?: 'latest' | 'all';
132
- };
133
- /** Whether the trigger ships an `ingressChallenge` hook (executed at ingress). */
134
- hasIngressChallenge?: boolean;
135
- /** Whether the trigger ships an `ingressValidation` hook (executed at ingress). */
136
- hasIngressValidation?: boolean;
137
- }
138
- export interface ParsedNangoFunction {
139
- name: string;
140
- type: 'function';
141
- description: string;
142
- triggers: ParsedFunctionTrigger[];
143
- input: string | null;
144
- output: string[] | null;
145
- scopes: string[];
146
- usedModels: string[];
147
- version: string;
148
- json_schema?: JSONSchema7 | undefined;
149
- features?: Feature[] | undefined;
150
- }
151
104
  export interface ParsedNangoAction {
152
105
  name: string;
153
106
  type: 'action';
@@ -193,5 +146,6 @@ export interface FlowsYaml {
193
146
  export type FlowZeroJson = Omit<NangoYamlParsedIntegration, 'functions'> & {
194
147
  jsonSchema?: JSONSchema7;
195
148
  sdkVersion: string;
149
+ symLinkTargetName?: string;
196
150
  };
197
151
  export type FlowsZeroJson = FlowZeroJson[];
@@ -73,4 +73,116 @@ export interface PutCheckpointSuccess {
73
73
  checkpoint: Checkpoint;
74
74
  version: number;
75
75
  }
76
+ export interface GetTaskAbortSuccess {
77
+ aborted: boolean;
78
+ }
79
+ export type PutTaskAbort = Endpoint<{
80
+ Method: 'PUT';
81
+ Path: '/environment/:environmentId/runner/task/:taskId/abort';
82
+ Params: {
83
+ environmentId: number;
84
+ taskId: string;
85
+ };
86
+ Error: ApiError<'put_task_abort_failed'>;
87
+ Success: never;
88
+ }>;
89
+ export type GetTaskAbort = Endpoint<{
90
+ Method: 'GET';
91
+ Path: '/environment/:environmentId/runner/task/:taskId/abort';
92
+ Params: {
93
+ environmentId: number;
94
+ taskId: string;
95
+ };
96
+ Error: ApiError<'get_task_abort_failed'>;
97
+ Success: GetTaskAbortSuccess;
98
+ }>;
99
+ export type PutSyncConflict = Endpoint<{
100
+ Method: 'PUT';
101
+ Path: '/environment/:environmentId/runner/sync-conflict';
102
+ Params: {
103
+ environmentId: number;
104
+ };
105
+ Body: {
106
+ scriptType: 'sync';
107
+ syncId: string;
108
+ refresh?: boolean;
109
+ ttlMs: number;
110
+ };
111
+ Error: ApiError<'sync_conflict' | 'put_sync_conflict_failed'>;
112
+ Success: never;
113
+ }>;
114
+ export type DeleteSyncConflict = Endpoint<{
115
+ Method: 'DELETE';
116
+ Path: '/environment/:environmentId/runner/sync-conflict';
117
+ Params: {
118
+ environmentId: number;
119
+ };
120
+ Body: {
121
+ scriptType: 'sync';
122
+ syncId: string;
123
+ };
124
+ Error: ApiError<'delete_sync_conflict_failed'>;
125
+ Success: never;
126
+ }>;
127
+ export interface TryAcquireLockSuccess {
128
+ acquired: boolean;
129
+ }
130
+ export type PostRunnerLockTryAcquire = Endpoint<{
131
+ Method: 'POST';
132
+ Path: '/environment/:environmentId/runner/locks/try-acquire';
133
+ Params: {
134
+ environmentId: number;
135
+ };
136
+ Body: {
137
+ owner: string;
138
+ key: string;
139
+ ttlMs: number;
140
+ };
141
+ Error: ApiError<'try_acquire_lock_failed'>;
142
+ Success: TryAcquireLockSuccess;
143
+ }>;
144
+ export interface ReleaseLockSuccess {
145
+ released: boolean;
146
+ }
147
+ export type PostRunnerLockRelease = Endpoint<{
148
+ Method: 'POST';
149
+ Path: '/environment/:environmentId/runner/locks/release';
150
+ Params: {
151
+ environmentId: number;
152
+ };
153
+ Body: {
154
+ owner: string;
155
+ key: string;
156
+ };
157
+ Error: ApiError<'release_lock_failed'>;
158
+ Success: ReleaseLockSuccess;
159
+ }>;
160
+ export type PostRunnerLockReleaseAll = Endpoint<{
161
+ Method: 'POST';
162
+ Path: '/environment/:environmentId/runner/locks/release-all';
163
+ Params: {
164
+ environmentId: number;
165
+ };
166
+ Body: {
167
+ owner: string;
168
+ };
169
+ Error: ApiError<'release_all_locks_failed'>;
170
+ Success: never;
171
+ }>;
172
+ export interface HasLockSuccess {
173
+ hasLock: boolean;
174
+ }
175
+ export type GetRunnerLock = Endpoint<{
176
+ Method: 'GET';
177
+ Path: '/environment/:environmentId/runner/locks';
178
+ Params: {
179
+ environmentId: number;
180
+ };
181
+ Querystring: {
182
+ owner: string;
183
+ key: string;
184
+ };
185
+ Error: ApiError<'has_lock_failed'>;
186
+ Success: HasLockSuccess;
187
+ }>;
76
188
  export {};
@@ -3,7 +3,7 @@ type FunctionRuntime = 'runner' | 'lambda';
3
3
  export interface DBPlan extends Timestamps {
4
4
  id: number;
5
5
  account_id: number;
6
- name: 'free' | 'starter-v2' | 'growth-v2' | 'enterprise' | 'starter' | 'growth' | 'starter-legacy' | 'scale-legacy' | 'growth-legacy';
6
+ name: 'free' | 'free-uncapped' | 'startup-deal' | 'starter-v2' | 'growth-v2' | 'enterprise' | 'enterprise-cloud-hosted' | 'starter' | 'growth' | 'starter-legacy' | 'scale-legacy' | 'growth-legacy';
7
7
  stripe_customer_id: string | null;
8
8
  stripe_payment_id: string | null;
9
9
  orb_customer_id: string | null;
@@ -89,7 +89,7 @@ export interface DBPlan extends Timestamps {
89
89
  * Change the applied rate limit for the public API
90
90
  * @default "m"
91
91
  */
92
- api_rate_limit_size: 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl';
92
+ api_rate_limit_size: 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
93
93
  /**
94
94
  * Enable or disable machine auto idling
95
95
  * @default true
@@ -1,8 +1,8 @@
1
- import type { DBPlan } from './db.js';
2
1
  import type { Endpoint } from '../api.js';
3
2
  import type { ApiBillingUsageMetrics, BillingCustomer, BillingInvoicingDetails, BreakdownDimensions } from '../billing/types.js';
4
3
  import type { MetricUsageSummary, UsageMetric } from '../usage/index.js';
5
4
  import type { ReplaceInObject } from '../utils.js';
5
+ import type { DBPlan } from './db.js';
6
6
  export type ApiPlan = ReplaceInObject<DBPlan, Date, string>;
7
7
  export type PostPlanExtendTrial = Endpoint<{
8
8
  Method: 'POST';
@@ -71,7 +71,8 @@ export type GetBillingUsageTopDimensionValues = Endpoint<{
71
71
  dimension: BreakdownDimensions[M];
72
72
  from: string;
73
73
  to: string;
74
- limit?: string | undefined;
74
+ search?: string | undefined;
75
+ page?: string | undefined;
75
76
  };
76
77
  }[UsageMetric];
77
78
  Success: {
@@ -80,6 +81,11 @@ export type GetBillingUsageTopDimensionValues = Endpoint<{
80
81
  id: string;
81
82
  label: string;
82
83
  }[];
84
+ pagination: {
85
+ page: number;
86
+ limit: number;
87
+ hasMore: boolean;
88
+ };
83
89
  };
84
90
  };
85
91
  }>;
@@ -1,6 +1,6 @@
1
1
  import type { Endpoint } from '../api.js';
2
- import type { Provider, SimplifiedJSONSchema } from './provider.js';
3
2
  import type { AuthModeType } from '../auth/api.js';
3
+ import type { McpOAuth2ClientRegistration, Provider, SimplifiedJSONSchema } from './provider.js';
4
4
  export type GetPublicProviders = Endpoint<{
5
5
  Method: 'GET';
6
6
  Path: `/providers`;
@@ -40,7 +40,7 @@ export interface ApiProviderListItem {
40
40
  docs_connect?: string | undefined;
41
41
  preConfigured: boolean;
42
42
  preConfiguredScopes: string[];
43
- clientRegistration?: 'dynamic' | 'static' | 'metadata';
43
+ clientRegistration?: McpOAuth2ClientRegistration;
44
44
  integration_config?: Record<string, SimplifiedJSONSchema> | undefined;
45
45
  }
46
46
  export type GetProviders = Endpoint<{
@@ -129,7 +129,7 @@ export interface ProviderCustom extends Omit<ProviderOAuth2, 'auth_mode'> {
129
129
  APP: string;
130
130
  };
131
131
  }
132
- export type McpOAuth2ClientRegistration = 'dynamic' | 'static' | 'metadata';
132
+ export type McpOAuth2ClientRegistration = 'dynamic' | 'static' | 'cimd';
133
133
  export interface ProviderMcpOAUTH2 extends Omit<BaseProvider, 'body_format'> {
134
134
  auth_mode: 'MCP_OAUTH2';
135
135
  registration_url?: string;
@@ -95,7 +95,7 @@ export type UsageWebhookForwardEvent = UsageEventBase<'usage.webhook_forward', {
95
95
  success: boolean;
96
96
  };
97
97
  }>;
98
- export type DataTransferCallsite = 'credential_test_hook' | 'credential_verification_hook' | 'connection_hook' | 'webhook_forward' | 'proxy' | 'uncontrolled_fetch' | 'persist_logs' | 'persist_records';
98
+ export type DataTransferCallsite = 'credential_test_hook' | 'credential_verification_hook' | 'connection_hook' | 'webhook_forward' | 'proxy' | 'uncontrolled_fetch' | 'persist_logs' | 'persist_records' | 'get_/records' | 'get_/proxy' | 'patch_/proxy' | 'post_/proxy' | 'put_/proxy' | 'delete_/proxy' | 'unknown_/proxy';
99
99
  export type UsageDataTransferEvent = UsageEventBase<'usage.data_transfer', {
100
100
  value: number;
101
101
  properties: {
@@ -1,7 +1,7 @@
1
- import type { TelemetryBag } from './sdk.js';
2
1
  import type { CheckpointRange } from '../checkpoint/types.js';
3
2
  import type { DBPlan } from '../plans/db.js';
4
3
  import type { Feature } from '../syncConfigs/db.js';
4
+ import type { TelemetryBag } from './sdk.js';
5
5
  export interface RunnerOutputError {
6
6
  type: string;
7
7
  payload: Record<string, unknown> | unknown[];
@@ -1,13 +1,13 @@
1
- import type { RunnerFlags } from './index.js';
2
1
  import type { LogLevel } from '../logs/messages.js';
3
2
  import type { IntegrationConfigForProxy } from '../proxy/api.js';
4
3
  import type { DBSyncConfig } from '../syncConfigs/db.js';
5
4
  import type { DBTeam } from '../team/db.js';
5
+ import type { RunnerFlags } from './index.js';
6
6
  import type { AxiosError, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios';
7
7
  export interface SdkLogger {
8
8
  level: LogLevel | 'off';
9
9
  }
10
- export type ConflictResolutionMode = 'IN_MEMORY' | 'REDIS';
10
+ export type ConflictResolutionMode = 'IN_MEMORY' | 'DISTRIBUTED';
11
11
  export type ScriptType = 'sync' | 'action' | 'webhook' | 'on-event';
12
12
  export interface NangoProps {
13
13
  scriptType: ScriptType;
@@ -1,5 +1,5 @@
1
- import type { ReportedSyncJobStatus } from './index.js';
2
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ import type { ReportedSyncJobStatus } from './index.js';
3
3
  export type PostPublicTrigger = Endpoint<{
4
4
  Method: 'POST';
5
5
  Path: '/sync/trigger';
@@ -1,8 +1,8 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
- import type { DBTeam } from './db.js';
3
2
  import type { DBInvitation } from '../invitations/db.js';
4
3
  import type { ApiUser } from '../user/api.js';
5
4
  import type { Role } from '../user/db.js';
5
+ import type { DBTeam } from './db.js';
6
6
  import type { Merge } from 'type-fest';
7
7
  export type GetTeam = Endpoint<{
8
8
  Method: 'GET';
@@ -1,4 +1,4 @@
1
- export type UsageMetric = 'proxy' | 'connections' | 'function_executions' | 'function_compute_gbms' | 'records' | 'webhook_forwards' | 'function_logs';
1
+ export type UsageMetric = 'proxy' | 'connections' | 'function_executions' | 'function_compute_gbms' | 'records' | 'webhook_forwards' | 'function_logs' | 'data_transfer';
2
2
  export interface MetricUsageSummary {
3
3
  label: string;
4
4
  usage: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.8",
3
+ "version": "0.71.0",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",